TraCI/Environment-related commands

Contents

Environment-related commands

Command 0x71: Position Conversion

Position ubyte
Position PositionId

Use this command to convert between the different position types used by TraCI. The specified Position is converted into the requested format given through PositionId. The result is the closest position that was found to match the given one.
The converted value is returned within a PositionConversion command that is added to the response message.

Command 0x72: Distance Request

Position Position ubyte
Position1 Position2 Flag

To obtain information about distances on the road network, the DistanceRequest command is available. The distance between Position1 and Position2 is determined, whereas the value of Flag has the following meaning:

  • 0x00: the air distance between the two positions is computed
  • 0x01: the driving distance is computed

The result is returned within a DistanceRequest response (s. below).

Response 0x72: Distance Request

ubyte float
Flag Distance

Each DistanceRequest command is, in addition to a successful Status command, answered by this response. It holds the requested Distance and a Flag to indicate whether the result is air or driving distance.

Command 0x73: Scenario

ubyte ubyte integer ubyte ubyte ValueDataType
Flag Domain DomainId Variable ValueDataType Value

Scenario is used to obtain all kinds of parameters about the simulation and may be used as a read or write command, indicated by Flag:

  • 0x00: get: the Variable is read and will not be altered, the data field Value is not used (except if stated otherwise)
  • 0x01: set: the Variable is overwritten by the given Value

A Scenario is divided into domains (Domain) which represent different aspects of the simulation world; DomainId addresses a certain object within such a domain. The id is a numerical value that may reach from 0 to the total number of domain objects -1. The different parameters that can be get or set are identified by Variable and may be domain specific. ValueType indicates the data type that the addressed parameter consists of, thus Value (if any) must have the same type.
Read-messages are responded by a Scenario command that contains the read Value and its type. The requested Variable will be returned in the specified data type if possible (e.g. position formats), otherwise the correct type is chosen by SUMO.

Overview of Domains and Variables
  Domain:
  road map (id 0x00) vehicle (id 0x01) traffic light (id 0x02) point of interest (id 0x03) polygon (id 0x04)
read
only
variables
shape (id 0x09) count max (id 0x0A) actual phase (id 0x05)   shape (id 0x09)
  equipped count (id 0x0B) next phase change (id 0x06)    
  equipped count max (id 0x0C)      
  speed (id 0x04)      
  air distance (id 0x10)      
  driving distance (id 0x11)      
  route (id 0x0E)      
  allowed speed (id 0x0F)      
  angle (id 0x13)   type (id 0x07)
  CO2 emissions (id 0x20)      
  CO emissions (id 0x21)      
  HC emissions (id 0x22)      
  PMx emissions (id 0x23)      
  NOx emissions (id 0x24)      
  fuel consumption (id 0x25)      
  noise emission (id 0x26)      
net boundaries(id 0x03) position (id 0x02)
count(id 0x01)
name(id 0x0D)
external ID (id 0x12)
simulation time (id 0x14)


Domain: road map (id 0x00)

  • name (id 0x0D): Returns the internal sumo id string of the road that is referenced by the given object id. Data type: string.
  • external ID (id 0x12): Returns the numerical object id used by TraCI for the domain object identified by a given sumo id string. The Value parameter is used to pass the id string. Data type: integer.
  • net boundaries (id 0x03): The boundary box of the simulation network. Data type: Boundary Box.
  • count (id 0x01): The overall number of roads (=MSEdges) in the roadmap. Data type: integer.
  • shape (id 0x09): The course of a road, defined at least by its start- and end-point. Data type: Polygon.


Domain: vehicle (id 0x01)

  • name (id 0x0D): Returns the sumo internal id string of the vehicle that is referenced by the given object id. Data type: string.
  • external ID (id 0x12): Returns the numerical object id used by TraCI for the domain object identified by a given sumo id string. The Value parameter is used to pass the id string. Data type: integer.
  • count (id 0x01): Total number of active vehicles within the simulation at the current simulation step. Data type: integer.
  • count max (id 0x0A): Upper bound for the total number of vehicles in the simulation. Data type: integer.
  • equipped count (id 0x0B): Total number of vehicles that can be accessed via TraCI at the current simulation step. Data type: integer.
  • equipped count max (id 0x0C): Upper bound for the total number of vehicles that can be accessed via TraCI in the simulation. Data type: integer.
  • position (id 0x02): The position of a certain vehicle within the simulation network. Data type: Position.
  • speed (id 0x04): Speed of a certain vehicle at the current simulation time. Data type: float.
  • route (id 0x0E): The desired route of a vehicle. May change during simulation runtime, e.g., due to the ChangeRoute command. Data type: string.
  • allowed speed (id 0x0F): Maximum allowed speed of a certain vehicle on the current lane. Data type: float.
  • air distance (id 0x10): Air distance from a vehicles position to another position that is passed by the Value parameter. Data type: float.
  • driving distance (id 0x11): Driving distance from a vehicles position to another position that is passed by the Value parameter. Data type: float.
  • CO2 emissions (id 0x20): Vehicle's CO2 emissions during this time step, computed based on HBEFA. Data type: float.
  • CO emissions (id 0x21): Vehicle's CO emissions during this time step, computed based on HBEFA. Data type: float.
  • HC emissions (id 0x22): Vehicle's HC emissions during this time step, computed based on HBEFA. Data type: float.
  • PMx emissions (id 0x23): Vehicle's PMx emissions during this time step, computed based on HBEFA. Data type: float.
  • NOx emissions (id 0x24): Vehicle's NOx emissions during this time step, computed based on HBEFA. Data type: float.
  • fuel consumption (id 0x25): Vehicle's fuel consumption during this time step, computed based on HBEFA. Data type: float.
  • noise emission (id 0x26): Noise generated by the vehicle, computed based on Harmonoise. Data type: float.


Domain: traffic light (id 0x02)

  • name (id 0x0D): Returns the sumo internal id string of the traffic light that is referenced by the given object id. Data type: string.
  • external ID (id 0x12): Returns the numerical object id used by TraCI for the domain object identified by a given sumo id string. The Value parameter is used to pass the id string. Data type: integer.
  • count (id 0x01): Overall number of traffic lights within the simulation. Data type: integer.
  • position (id 0x02): The position of a certain traffic light within the network. Data type: 3DPosition.
  • actual phase (id 0x05): For a junction that is controlled by traffic lights, the current phase of each individual light at the current simulation time is reported. Data type: Traffic Light Phase List.
  • next phase change (id 0x06): For a junction that is controlled by traffic lights, the next phase that each individual light will switch to is reported. Data type: Traffic Light Phase List.


Domain: point of interest (id 0x03)

  • name (id 0x0D): Returns the sumo internal id string of the point of interest that is referenced by the given object id. Data type: string.
  • external ID (id 0x12): Returns the numerical object id used by TraCI for the domain object identified by a given sumo id string. The Value parameter is used to pass the id string. Data type: integer.
  • count (id 0x01): Overall number of points of interest (poi) within the simulation. Data type: integer.
  • position (id 0x02): The position of a poi within the network. Data type: 3DPosition.
  • type (id 0x07): The type assigned to a certain poi. Data type: String.


Domain: polygon (id 0x04)

  • name (id 0x0D): returns the sumo internal id string of the polygon that is referenced by the given object id. Data type: string.
  • external ID (id 0x12): Returns the numerical object id used by TraCI for the domain object identified by a given sumo id string. The Value parameter is used to pass the id string. Data type: integer.
  • count (id 0x01): overall number of polygons within the simulation. Data type: integer.
  • position (id 0x02): the position of a polygon within the network. Data type: 3DPosition.
  • type (id 0x07): the type assigned to a certain polygon. Data type: String.
  • shape (id 0x09): the actual shape (sequence of points) of a certain polygon. Data type: Polygon.

This page was last modified on 27 October 2011, at 07:39.