TraCI/Change Vehicle State

From Sumo
Revision as of 11:16, 4 September 2009 by Dkrajzew (talk | contribs)
Jump to navigation Jump to search

Command 0xc4: Change Vehicle State

ubyte string ubyte <value_type>
Variable Vehicle ID Type of the value New Value

Changes the state of a vehicle. Because it is possible to change different values of a vehicle, the number of parameter to supply and their types differ between commands. The following values can be changed, the parameter which must be given are also shown in the table.

Overview Changeable Vehicle Variables
Variable ValueType Description
max speed (0x11) float Sets the vehicle's maximum speed to the given value
stop (0x12) compound (string, float, byte, float), see below Lets the vehicle stop at the given edge, at the given position and lane. The vehicle will stop for the given duration.
change lane (0x13) compound (byte, float), see below Forces a lane change to the lane with the given index; if successfull, the lane will be chosen for the given amount of time.
slow down (0x14) compound (float, float), see below Reduces the speed to the given for the given amount of time.
change target (0x31) string (destination edge id) The vehicle's destination edge is set to the given. The route is rebuilt.
change route by id (0x54) string (route id) Assigns the named route to the vehicle, assuming a) the named route exists, and b) it starts on the edge the vehicle is currently at.
change route (0x57) stringlist (ids of edges to pass) Assigns the list of edges as the vehicle's new route assuming the first edge given is the one the vehicle is curently at.
Caution:
Note that "change route by id" (0x54) and "change route" (0x57) are currently only available within the SVN.

The message contents are as following:

max speed (0x11)

byte float
value type float New Maximum Speed

stop (0x12)

byte integer byte string byte float byte byte byte float
value type compound item number (always 4) value type string Edge ID value type float Position value type byte Lane Index value type float Duration

change lane (0x13)

byte integer byte byte byte float
value type compound item number (always 2) value type byte Lane Index value type float Duration

slow down (0x14)

byte integer byte float byte float
value type compound item number (always 2) value type float Speed value type float Duration

change target (0x31)

byte string
value type string Edge ID


change route by id (0x54)

byte string
value type string Route ID


change route (0x57)

byte int string
value type string list number of elements Edge ID