michele-segata / plexe-pyapi

Python APIs to control Plexe models in SUMO
49 stars 14 forks source link

What is the logic of the lane-chaning in Plexe? #13

Closed 17150934 closed 1 year ago

17150934 commented 1 year ago

I noticed that the lane-changing maneuvers in Plexe is the continuous lane-changing action, like the following: 车队拆分换道

The lane-changing action in the joindemo.py is decided by the function: def set_fixed_lane(self, vid, lane, safe=True)

But I want to know what is the mechanism or logic of lane change by the function def set_fixed_lane(self, vid, lane, safe=True) . For example, how much steering angle is implemented by the controller of this function.

And, another similar question exists in the function def enable_auto_lane_changing(self, vid, enable) in demo of platoon-lane-change-test.py. What is the mechanism or logic of the auto lane-changing.

If anyone can give me an answer about the two questions, I would be greatly grateful.

michele-segata commented 1 year ago

The lane-changing action in the joindemo.py is decided by the function: def set_fixed_lane(self, vid, lane, safe=True)

But I want to know what is the mechanism or logic of lane change by the function def set_fixed_lane(self, vid, lane, safe=True) . For example, how much steering angle is implemented by the controller of this function.

In fact there is no steering control. The lane change is a feature of sumo you can enable with the --lanechange.duration parameter, as done here. The documentation can be found here.

And, another similar question exists in the function def enable_auto_lane_changing(self, vid, enable) in demo of platoon-lane-change-test.py. What is the mechanism or logic of the auto lane-changing.

The automatic lane change is a feature that enables an entire platoon to change lane. It is an experimental feature and it is known to have bugs. When this is enabled, the leader checks whether it would gain speed by changing lane (or if it should obey the keep-right rule) and, if so, queries all the members in the platoon if changing lane is safe. If so, the platoon changes lane all at the same time. This is not done by means of actual communications, but internally in sumo. The APIs you should consider to use this feature are described here (enable_auto_lane_changing, add_member, and remove_member). Again, remember that the feature is experimental and can lead to vehicle collisions in some cases.