TraCI/Change Vehicle State

From Sumo
Revision as of 13:08, 29 July 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 The vehicle's destination edge is set to the given. The route is rebuilt.

The message contents are as following:

max speed (0x11)

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)

string
Edge ID