[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] TraCIException: MoveToXY vehicle should obtain: edgeID, lane, x, y, angle and optionally keepRouteFlag.
|
Dear Akua,
at least the message indicates you are using an older SUMO version, as since some releases it should state "MoveToXY vehicle should obtain: edgeID, lane, x, y, angle and optionally keepRouteFlag and matchThreshold.". Could you be please update to the most recent SUMO and check your TraCI python module is from the same release?
Best regards
Mirko
-----Original-Nachricht-----
Betreff: [sumo-user] TraCIException: MoveToXY vehicle should obtain: edgeID, lane, x, y, angle and optionally keepRouteFlag.
Datum: 2023-10-24T23:44:44+0200
Von: "Akua Dickson via sumo-user" <sumo-user@xxxxxxxxxxx>
An: "sumo-user@xxxxxxxxxxx" <sumo-user@xxxxxxxxxxx>
Dear all,
Please I am trying to use Traci's MovetoXY function and I come across this error.
traci.exceptions.TraCIException: MoveToXY vehicle should obtain: edgeID, lane, x, y, angle and optionally keepRouteFlag. I tried implementing the code found in the github repository below but I still get the same error. Could someone please help out? Thank you.
My code is shown below:
if __name__ == "__main__":
options = get_options()
sumoBinary = '/home/akua/opt/carla-simulator/Co-Simulation/Sumo/examples/sumo-gui'
# traci starts sumo as a subprocess and then this script connects and runs
sumoCmd = [sumoBinary, "-c", "Town05.sumocfg"]
traci.start(sumoCmd, port=8813, label="sim1")
conn1 = traci.getConnection("sim1")
conn1.setOrder(1)
step = 0
while traci.simulation.getMinExpectedNumber() > 0:
conn1.simulationStep()
if step == 2:
phi = 0
pos = traci.vehicle.getPosition("1")
x = pos[0]
y = pos[1]
pos2 = (pos[0] + 2, pos[1])
traci.vehicle.moveToXY('1', "45.0.00", -1, pos2[0], pos2[1], 0, keepRoute=1)
step += 1
conn1.close()