How to make the car's left tires on the left marker lane using traci in SUMO

23 Views Asked by At

I am using SUMO to simulate car movement. Here is my code. I am using traci to make the car's left tires to be on the left lane marker while moving.

if current_lateral_position < target_lateral_position: 
                
   if step==40:

      current_lateral_position = traci.vehicle.getLateralLanePosition("d2")
      try:
        pos = traci.vehicle.getPosition("d2")
        print('pos:',pos)
      except traci.TraCIException:
        pass # or do something smarter
      if current_lateral_position < target_lateral_position: 
               
                x2, y2 = traci.vehicle.getPosition("d2")

                traci.vehicle.moveToXY("d2", 0,0,x2+0.1,y2+0.1
                            , 25, 1)

Whenever I see the printed position is the following:

pos: (151.92770915134918, -8.0)
And at time step 41,Warning: Vehicle 'd2' performs emergency braking on lane 'e1_0' with decel=9.00, wished=2.50, severity=1.00, time=41.00.

I appreciate if anyone can help me how can I make the car start moving on the left marker lane at time 41.

0

There are 0 best solutions below