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, double
+
| string, float, byte, float
 
| 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.
|-
 
| phase index (0x22)
 
| integer
 
| Sets the phase of the traffic light to the given. The given index must be valid for the current program of the traffic light, this means it must be between 0 and the number of phases known to the current program of the tls - 1.
 
 
|-
 
|-
 
| change lane (0x13)
 
| change lane (0x13)
Line 38: Line 34:
 
|-
 
|-
 
| slow down (0x14)
 
| slow down (0x14)
| float, double
+
| float, float
 
| 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 46: Line 42:
 
|-
 
|-
 
|}
 
|}
 +
 +
The message contents are as following:
 +
 +
'''max speed (0x11)'''
 +
{| cellpadding="4" cellspacing="0" border="0"
 +
| align="center"| float
 +
|-
 +
! style="border: 1pt solid;" | New Maximum Speed
 +
|}
 +
 +
'''stop (0x12)'''
 +
{| cellpadding="4" cellspacing="0" border="0"
 +
| align="center"| string
 +
| align="center"| float
 +
| width="150" align="center"| byte
 +
| align="center"| float
 +
|-
 +
! style="border: 1pt solid;" | Edge ID
 +
! style="border: 1pt solid;" | Position
 +
! style="border: 1pt solid;" | Lane Index
 +
! style="border: 1pt solid;" | Duration
 +
|}
 +
 +
'''change lane (0x13)'''
 +
{| cellpadding="4" cellspacing="0" border="0"
 +
| width="150" align="center"| byte
 +
| align="center"| float
 +
|-
 +
! style="border: 1pt solid;" | Lane Index
 +
! style="border: 1pt solid;" | Duration
 +
|}
 +
 +
'''slow down (0x14)'''
 +
{| cellpadding="4" cellspacing="0" border="0"
 +
| width="150" align="center"| float
 +
| align="center"| float
 +
|-
 +
! style="border: 1pt solid;" | Speed
 +
! style="border: 1pt solid;" | Duration
 +
|}
 +
 +
'''change target (0x31)'''
 +
{| cellpadding="4" cellspacing="0" border="0"
 +
| width="150" align="center"| string
 +
|-
 +
! style="border: 1pt solid;" | Edge ID
 +
|}
 +
  
 
[[Category:RevisitAfterNextRelease]]
 
[[Category:RevisitAfterNextRelease]]

Revision as of 09:44, 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) string, float, byte, float 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) byte, float 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) float, float 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)

string float byte float
Edge ID Position Lane Index Duration

change lane (0x13)

byte float
Lane Index Duration

slow down (0x14)

float float
Speed Duration

change target (0x31)

string
Edge ID