eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.42k stars 1.37k forks source link

the vehicle didn't follow the given trajectory when executing lane change #14240

Open LemonPasserby opened 5 months ago

LemonPasserby commented 5 months ago

Hello!I met a problem when the ego vehicle was executing lane change with the given trajectory, and the scenario is the three-lane highway. Trajectory planning was based on quintic polynomial curves.

1. My problem

the vehicle didn't quite follow the given trajectory when executing lane change. In the beginning, it could follow the speed quite well. However, as the planned speed increased, the actual speed of ego-vehicle keeped constant. After a while, its actual speed increased but did't follow the given trajectory. here is the comparision of the position and speed between the planned trajectory and the actual trajectory: self.realEgoY refers to the actual lateral movement of ego-vehicle image self.plan_y_ego refers to the planned lateral movement of ego-vehicle image self.realEgoLatVel refers to the actual lateral speed of ego-vehicle image self.latVelInforefers to the planned lateral speed of ego-vehicle (only shows 1.1s) image

2. My codes

                    traci.vehicle.changeSublane(self.egoID, relLatMove[self.stepNum])
                    traci.vehicle.setSpeed(self.egoID, self.plan_vx_ego[self.stepNum])
                    traci.simulationStep()

and i have set the lanechange mode with:

if vehID == self.egoID:
traci.vehicle.setLaneChangeMode(vehID, 0)
      <input>
           <net-file value="test_planning_env.net.xml"/>
           <route-files value="test_planning_env.rou.xml"/>
      </input>

      <time>
    <begin value="0"/>
    <end value="200"/>
    <step-length value="0.1"/>
      </time>
      <gui_only>
    <start value="t"/>
    <quit-on-end value="t"/>
      </gui_only>
      <processing>
    <lateral-resolution value = "0.1"/>
      </processing>

3.

I’m sure there aren't any other vehicle in the road. The above are some necessary settings. If there are any other settings i should share, please tell me. I am really appreciated if anyone can solve this error

SUMO-version: 1.18.0

operating system: window 10

m-kro commented 5 months ago

The lateral acceleration is limited by the lane change parameter lcAccelLat. If changing this does not help, could you maybe plot the speed over time and the lateral position over time (both requested and sumo)? This would be much easier to interpret as a bunch of numbers.

LemonPasserby commented 5 months ago

thank you for your advice. The timestep is 0.1s. The whole lane change process is about 3s and the lanewidth is 3.5m. So i think lcAccelLat='4' won't be over large. Then I try 'lcAccelLat=8' and 'lcAccelLat=100', as the results show. Surprisely, when it is 'lcAccelLat=100', the vehicle can follow the planned trajectory perfectly. How did that happen? position_lcAccelLat=4 position_lcAccelLat=8 position_lcAccelLat=100 speed_lcAccelLat=4 speed_lcAccelLat=8 speed_lcAccelLat=100

LemonPasserby commented 5 months ago

well, I tried lcAccelLat=20. The ego-vehicle could also follow perfectly while lcAccelLat=15 couldn't.