Skip to main content

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

Most likely, the last call to setSpeed is keeping the vehicle from moving. To hand speed control back to SUMO, call setSpeed(vehID, -1).
You can check whether the route was set correctly in sumo-gui: https://sumo.dlr.de/docs/sumo-gui.html#showing_routes_and_route-related_information

Am Fr., 17. Feb. 2023 um 12:56 Uhr schrieb Ruud van Gaal <r.vangaal@xxxxxxxxxx>:
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

_______________________________________________
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