What version of sumo are you using? If it's a recent version, please provide minimal scenario files for reproducing this situation including the traci commands that were called.
Am Sa., 22. Apr. 2023 um 16:09 Uhr schrieb ĐEEPTHI P <[email protected] >: > It is a straight highway road and all vehicles are moving from left to > right. Also, the behavior is not consistent. Most of the time, getLeader > returns a vehicle which is ahead of the ego vehicle, but sometimes it > returns a vehicle which is behind. > > On Sat, 22 Apr 2023 at 15:34, Jakob Erdmann <[email protected]> wrote: > >> looks like ego and leader are driving on a road that goes from right to >> left. >> >> Am Sa., 22. Apr. 2023 um 14:38 Uhr schrieb ĐEEPTHI P < >> [email protected]>: >> >>> Hi, >>> >>> I used the code below to get the position of leading vehicle. However, >>> sometimes the simulation gives the position of the leading vehicle behind >>> the ego vehicle (as shown in the output). How does this happen ? >>> >>> leader = traci.vehicle.getLeader(ego_id) >>> if leader != None: >>> leader_id = leader[0] >>> lead_pos = traci.vehicle.getPosition(leader_id) >>> ego_pos = traci.vehicle.getPosition(ego_id) >>> print("Ego position {}, Lead position {}".format(ego_pos, lead_pos)) >>> >>> Ego position (795.95, -1.6), Lead position (781.706206685247, -1.6) Ego >>> position (797.5900467095553, -1.6), Lead position (783.2492279457477, -1.6) >>> Ego >>> position (799.1890996324844, -1.6), Lead position (784.7922492062485, -1.6) >>> >>> Regards, >>> Deepthi >>> >> _______________________________________________ >>> sumo-user mailing list >>> [email protected] >>> To unsubscribe from this list, visit >>> https://www.eclipse.org/mailman/listinfo/sumo-user >>> >> _______________________________________________ >> sumo-user mailing list >> [email protected] >> To unsubscribe from this list, visit >> https://www.eclipse.org/mailman/listinfo/sumo-user >> > -- > Regards, > Deepthi > _______________________________________________ > sumo-user mailing list > [email protected] > To unsubscribe from this list, visit > https://www.eclipse.org/mailman/listinfo/sumo-user >
_______________________________________________ sumo-user mailing list [email protected] To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
