Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Vehicle stops following the route after calling moveToXY()

Hi,

I'm creating an application where I can either control a SUMO car from my program, or let SUMO drive autonomously over a route.
When my program is in control I call Vehicle::moveToXY() and Vehicle::setSpeed() to overrule the position. This works ok. But when I try to hand control back to SUMO (not calling moveToXY/setSpeed anymore) it just sits there without moving.

My vehicle is define in the .rou.xml file like this:

<vehicle id="ego" type="Ego_Car" route="r_1" depart="0.00" departLane="free" color="blue"/>

I tried explicitly setting the route ID:

Vehicle::setRouteID(egoName, routeID);

but that didn't help. Any idea how I can detect what is causing the vehicle not to follow the route anymore? Is it even possible after a call to Vehicle::moveToXY() to put the vehicle back on a route, or should I respawn the vehicle somehow from scratch? (even then I'd need to inject the latest position at least once)

Thanks,
Ruud van Gaal


Back to the top