Difference between revisions of "TraCI/Change Vehicle State"

From Sumo
Jump to navigation Jump to search
(Command 0xc4: Change Vehicle State)
Line 26: Line 26:
 
|-
 
|-
 
| stop (0x12)
 
| stop (0x12)
| string, float, byte, float
+
| 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.
 
| 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)
 
| change lane (0x13)
| byte, float
+
| 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.
 
| 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)
 
| slow down (0x14)
| float, float
+
| compound (float, float), see below
 
| Reduces the speed to the given for the given amount of time.
 
| Reduces the speed to the given for the given amount of time.
 
|-
 
|-
Line 54: Line 54:
 
'''stop (0x12)'''
 
'''stop (0x12)'''
 
{| cellpadding="4" cellspacing="0" border="0"
 
{| cellpadding="4" cellspacing="0" border="0"
 +
| align="center"| byte
 +
| align="center"| integer
 +
| align="center"| byte
 
| align="center"| string
 
| align="center"| string
 +
| align="center"| byte
 
| align="center"| float
 
| align="center"| float
| width="150" align="center"| byte
+
| align="center"| byte
 +
| align="center"| byte
 +
| align="center"| byte
 
| align="center"| float
 
| align="center"| float
 
|-
 
|-
 +
! style="border: 1pt solid;" | value type ''compound''
 +
! style="border: 1pt solid;" | item number (always 4)
 +
! style="border: 1pt solid;" | value type ''string''
 
! style="border: 1pt solid;" | Edge ID
 
! style="border: 1pt solid;" | Edge ID
 +
! style="border: 1pt solid;" | value type ''float''
 
! style="border: 1pt solid;" | Position
 
! style="border: 1pt solid;" | Position
 +
! style="border: 1pt solid;" | value type ''byte''
 
! style="border: 1pt solid;" | Lane Index
 
! style="border: 1pt solid;" | Lane Index
 +
! style="border: 1pt solid;" | value type ''float''
 
! style="border: 1pt solid;" | Duration
 
! style="border: 1pt solid;" | Duration
 
|}
 
|}
Line 67: Line 79:
 
'''change lane (0x13)'''
 
'''change lane (0x13)'''
 
{| cellpadding="4" cellspacing="0" border="0"
 
{| cellpadding="4" cellspacing="0" border="0"
| width="150" align="center"| byte
+
| align="center"| byte
 +
| align="center"| integer
 +
| align="center"| byte
 +
| align="center"| byte
 +
| align="center"| byte
 
| align="center"| float
 
| align="center"| float
 
|-
 
|-
 +
! style="border: 1pt solid;" | value type ''compound''
 +
! style="border: 1pt solid;" | item number (always 2)
 +
! style="border: 1pt solid;" | value type ''byte''
 
! style="border: 1pt solid;" | Lane Index
 
! style="border: 1pt solid;" | Lane Index
 +
! style="border: 1pt solid;" | value type ''float''
 
! style="border: 1pt solid;" | Duration
 
! style="border: 1pt solid;" | Duration
 
|}
 
|}
Line 76: Line 96:
 
'''slow down (0x14)'''
 
'''slow down (0x14)'''
 
{| cellpadding="4" cellspacing="0" border="0"
 
{| cellpadding="4" cellspacing="0" border="0"
| width="150" align="center"| float
+
| align="center"| byte
 +
| align="center"| integer
 +
| align="center"| byte
 +
| align="center"| float
 +
| align="center"| byte
 
| align="center"| float
 
| align="center"| float
 
|-
 
|-
 +
! style="border: 1pt solid;" | value type ''compound''
 +
! style="border: 1pt solid;" | item number (always 2)
 +
! style="border: 1pt solid;" | value type ''float''
 
! style="border: 1pt solid;" | Speed
 
! style="border: 1pt solid;" | Speed
 +
! style="border: 1pt solid;" | value type ''float''
 
! style="border: 1pt solid;" | Duration
 
! style="border: 1pt solid;" | Duration
 
|}
 
|}

Revision as of 10:48, 27 July 2009

Command 0xc4: Change Vehicle State

Caution:
Note that this API is currently only available in the SVN version
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