Skip to main content

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

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/


Back to the top