Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] How to use the getLeader in python to retrieve the leader info?

with traci, either check whether the vehicle '00' has departed yet or catch the TraCIException (it's harmless).
for logging, see https://github.com/eclipse/sumo/issues/7864

Am Do., 26. Nov. 2020 um 16:22 Uhr schrieb mateen-malik <mateen.malik@xxxxx>:
I want to use traCI to get the distance of the car in front and log it, how
can I do it? please help

I started with trying the following in python script but this gave me error
that the vehID is not known, that in my case is 00

 tl = traci.vehicle.getLeader("00", "200")


Also how can I log the getLeader parameter at each time step of simulation?

I have also attached the code getLeader_python_code_example.txt
<http://sumo-user-mailing-list.90755.n8.nabble.com/file/t527/getLeader_python_code_example.txt
demo.txt
<http://sumo-user-mailing-list.90755.n8.nabble.com/file/t527/demo.txt

Thanks in advance,

Best regards,
/mateen




--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top