Skip to content

python moveToVTD does not work. (trac #1720) #1720

@behrisch

Description

@behrisch

it isn't even tested with the testclient or the python library )-:

reported by David Mansolino:

In the last version of sumo (0.23) and on the repository their is an
error with the python function
traci.vehicle.moveToVTD(vehID, edgeID, lane, x, y)
(http://sumo.dlr.de/trac.wsgi/browser/trunk/sumo/tools/traci/vehicle.py#L903)

According to the traci server, this function should have one more
argument which should be the angle:
http://sumo.dlr.de/trac.wsgi/browser/trunk/sumo/src/traci-server/TraCIServerAPI_Vehicle.cpp#L1180

The function traci.vehicle.moveToVTD(vehID, edgeID, lane, x, y) should
be replaced by the following:

  def moveToVTD(vehID, edgeID, lane, x, y, angle):
      traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE,

tc.VAR_MOVE_TO_VTD, vehID, 1 + 4 + 1 + 4 + len(edgeID) + 1 + 4 + 1 + 8

  • 1 + 8 + 1 + 8)
    traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 5)
    traci._message.string += struct.pack("!Bi", tc.TYPE_STRING,
    len(edgeID)) + str(edgeID)
    traci._message.string += struct.pack("!Bi", tc.TYPE_INTEGER, lane)
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, x)
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, y)
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, angle)
    traci._sendExact()

Migrated from http://sumo.dlr.de/ticket/1720

{
    "status": "closed", 
    "changetime": "2015-04-14T10:35:03Z", 
    "description": "it isn't even tested with the testclient or the python library )-:\n\nreported by David Mansolino:\n\n\n In the last version of sumo (0.23) and on the repository their is an\n error with the python function\n traci.vehicle.moveToVTD(vehID, edgeID, lane, x, y)\n (http://sumo.dlr.de/trac.wsgi/browser/trunk/sumo/tools/traci/vehicle.py#L903)\n \n According to the traci server, this function should have one more\n argument which should be the angle:\n http://sumo.dlr.de/trac.wsgi/browser/trunk/sumo/src/traci-server/TraCIServerAPI_Vehicle.cpp#L1180\n \n The function traci.vehicle.moveToVTD(vehID, edgeID, lane, x, y) should\n be replaced by the following:\n \n      def moveToVTD(vehID, edgeID, lane, x, y, angle):\n          traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE,\n tc.VAR_MOVE_TO_VTD, vehID, 1 + 4 + 1 + 4 + len(edgeID) + 1 + 4 + 1 + 8\n + 1 + 8 + 1 + 8)\n          traci._message.string += struct.pack(\"!Bi\", tc.TYPE_COMPOUND, 5)\n          traci._message.string += struct.pack(\"!Bi\", tc.TYPE_STRING,\n len(edgeID)) + str(edgeID)\n          traci._message.string += struct.pack(\"!Bi\", tc.TYPE_INTEGER, lane)\n          traci._message.string += struct.pack(\"!Bd\", tc.TYPE_DOUBLE, x)\n          traci._message.string += struct.pack(\"!Bd\", tc.TYPE_DOUBLE, y)\n          traci._message.string += struct.pack(\"!Bd\", tc.TYPE_DOUBLE, angle)\n          traci._sendExact()\n", 
    "reporter": "namdre", 
    "cc": "", 
    "resolution": "fixed", 
    "_ts": "1429007703821910", 
    "component": "TraCI", 
    "summary": "python moveToVTD does not work.", 
    "priority": "major", 
    "keywords": "", 
    "time": "2015-04-14T07:18:29Z", 
    "milestone": "0.24.0", 
    "owner": "namdre", 
    "type": "defect"
}

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions