Vehicles
Wheeled vehicles that are able to move (having kinetic energy) or are able to change their state. Even if they remain unchanged during the scenario, they are still dynamic elements (e.g., a parked vehicle). They can be simulated with varying degrees of detail in both shape (from bounding boxes to detailed 3D models and animation), behavior (from following waypoints to intelligent behavior), or physics. The required attributes will deppend on the test goals and what the simulation infrastructure is capable of rendering. In most cases, the ADS will detect vehicles as bounding boxes with a classification.
Common vehicle attributes:
<!-- Vehicle-->
<node id='-1' lat='43.47405036465' lon='-80.54810497509'>
<tag k='gs' v='vehicle' />
<tag k='vid' v='1' /> <!-- must be unique-->
<tag k='name' v='my_vehicle' /> <!-- must be unique-->
<tag k='model' v='sedan' />
<tag k='btype' v='SDV' /> <!-- behavior type-->
</node>
k | v | description |
---|---|---|
gs* | vehicle | GS role key |
name | string | A name for the vehicle. Must be unique. If not assigned, a name will be generated. |
speed | float (m/s) | Vehicle standard target speed |
yaw | int (deg) | Vehicle starting yaw in degrees |
btype | string | Vehicle Behavior Type (SDV, TV, PV, or undefined) |
Additional optional attributes can specify the vehicle's physical properties, and the simulator must connect suitable 3D meshes and animation during execution. Therefore, testing results must take into account additional details of the simulation infrastructure running the scenario and what types of vehicles it can create. For bounding box simulation, the dimensions are sufficient to reproduce the scenario independently from the 3D meshes. If no dimensions are set, the actual dimensions of the 3D meshes must be used to generate the bounding boxes. We use a set of generic vehicle models as samples (e.g., "suv", "sedan", "hatchback") that are easy to match in any simulation. More specific vehicle models and makers (e.g., "Mercedes C Class 2020") must be followed by a compatible model list from the simulator.
k | v | description |
---|---|---|
gs* | vehicle | GS role key |
model | string[] | The vehicle's 3D model. If a list is provided, any compatible value is accepted. |
color | string[] | Vehicle's color. Examples: 'white', 'black', 'red',etc. If a list is provided, any compatible value is accepted. |
width | float(m) | vehicle and bounding box dimension |
length | float(m) | vehicle and bounding box dimension |
height | float(m) | vehicle and bounding box dimension |
weight | float(kg) | vehicle's weight |
<node id='-1' lat='43.47405036465' lon='-80.54810497509'>
<tag k='gs' v='vehicle' />
<tag k='vid' v='1' />
<tag k='width' v='2' />
<tag k='length' v='4.5' />
<tag k='height' v='1.5' />
<tag k='color' v='silver,white' /> <!-- either option is suitable -->
<tag k='model' v='sedan' />
</node>
In the GSServer, if model and color are not specified, the vehicle will choose a random value from ('suv', 'sedan', 'hatchback'), and ('white', 'black', 'silver') as safe choices. These attributes do not change the simulation in the server as vehicles are simulated as bounding boxes, but they are syncronized with the client. In the GSClient, we support a collection of 7 vehicle models: 'suv', 'sedan', 'hatchback','familyvan', 'deliveryvan', 'sport','taxi' and 5 colors: 'white', 'black', 'silver','red', 'blue'.
Vehicle Behavior Types
Vehicles can be defined with 4 types based on Vehicle Behavior (attribute btype).
type | name | description |
---|---|---|
SDV | Driver-Vehicle Model | Vehicle using the dynamic driver-vehicle model. They are self-driving agents and react to traffic according to the assigned detailed behavior. More details on the Section SDV Model |
TV | Trajectory-based Vehicle | Vehicles that follow a timed trajectory. |
PV | Path-based Vehicle | Path Vehicles that follow a GeoScenario Path. A speed attribute (in km/h) can be used to define a standard constant velocity. Complex kinetics with variable velocity and acceleration is defined with a speed profile in the Path element. |
n/a | not applicable | Vehicles without a behavior (example: parked vehicles don't require a behavior model), or using an external model that is not part of GeoScenario (example: a tool specific model) |
Simulated Driver-Vehicle (SDV):
Vehicles using the SDV Model require a route and a root Behavior Tree to perform the driving task. Typically, the root tree is a scenario tree (tailored to specific scenarios) built by composable behaviors from normal driving (sub-trees). We provide a standard tree to perform basic driving tasks if no additional behavior is needed in a scenario. Vehicles following this standard behavior will only drive to the destination. More details about the route and the vehicle behavior are availalbe in a dedicated section for the SDV Model.
Vehicles starting with arbitrary state can also be specified with a start_frenet
. If this option is used, the position will be based on the longitudinal and lateral position on the current lanelet (the lanelet where the vehicle's node is positioned). The frené state has 6 values: longitudinal position, longitudinal velocity, longitudinal acceleration, lateral position, lateral velocity , lateral acceleration.
<node id='-1' lat='43.47405036465' lon='-80.54810497509'>
<tag k='gs' v='vehicle' />
<tag k='btype' v='SDV' />
<tag k='btree' v='fast_drive_scenario_tree.btree' />
<tag k='route' v='east_west_route' /> <!-- assigned route-->
<tag k='start_frenet' v='20,0,0,0,0,0' />
</node>
k | v | description |
---|---|---|
*btree | string | The root Behavior Tree. GSClient can use the st_standard_driver.btree for normal driving that will obey traffic rules and keep a safe distance from other vehicles. |
*route | string | The GeoScenario route the vehicle will use to perform the driving task. |
start_cartesian | float[] | Starting motion state in cartesian simulation coordinates when they differ from the node location. Must contain 4 values for X and Y movement (x_vel, x_acc, y_vel, y_acc). Example: '4.0 ,0.0 ,2.0 ,0.0' will be translated to vehicle starting at 4m/s in X and 2.0m/s in Y. The position is defined by the node, as usual. |
start_frenet | float[] | Starting longitudinal and lateral position and movement on the current lanelet. Must contain six values for for S and D states. Example: '20,5,0,0.4,0,0 will be translated to vehicle starting 20 meters from the begining of the lane, driving at constant 5 m/s, 40cm to the left of the center lane, and no lateral movement. |
Route
In order to operate, vehicles using the SDV model require a driving mission through a Route. The route can be a single node representing the goal, or a collection of nodes (way) forming all points to be visited in order until the last node representin the goal.
k | v | description |
---|---|---|
gs* | 'route' | GS role key. Can be assigned to node, or way. |
name* | string | A name for this route. Must be unique. |
Trajectory Vehicle:
Vehicles that follow a timed trajectory. The trajectory is either designed manually or computed offline. This option is ideal to reproduce vehicle behavior extracted directly from traffic, where the vehicle state over time is fixed and must be aligned with the remaining data. For example, a bag data replay from ROS where camera and lidar data must be aligned with the vehicle's state in simulation, or simply recreating scenes from naturalistic traffic databases without changes.
<node id='-1' lat='43.47405036465' lon='-80.54810497509'>
<tag k='gs' v='vehicle' />
<tag k='btype' v='TV' />
<tag k='trajectory' v='my_trajectory' />
</node>
Trajectory
k | v | description |
---|---|---|
gs* | 'trajectory' | GS role key. Can be assigned to way. |
name* | string | A name for this trajectory. Must be unique. |
interpolate | bool | If yes, the vehicle state between the trajectory points will be interpolated based on simulation time. |
gs | 'tnode' | GS role key. Can be assigned to node. time | float(s) | Simulation time (from trajectory start) speed | float(m/s) | Vehicle speed in m/s yaw | yaw(deg) | Vehicle yaw in degrees
GeoScenario trajectory example:
<way id='-1'>
<tag k='gs' v='trajectory' />
<tag k='name' v='v1_trajectory' />
<tag k='interpolate' v='yes' />
<nd ref='-10' />
<nd ref='-11' />
<nd ref='-12' />
<nd ref='-13' />
</way>
Trajectory node example:
<node id='-13' lat='43.50929904003' lon='-80.53401271512'>
<tag k='time' v='1.2' />
<tag k='speed' v='12.0' />
<tag k='yaw' v='128' />
</node>
Path Vehicle:
Note This Behavior type is the standard vehicle behavior in GeoScenario 1.0. If using GeoScenario 2.0, we recommend using vehicles with dynamic driving with the SDV model or Trajectory Vehicles.
Vehciles that follow a GeoScenario Path. A speed attribute (km/h) can be used to define a standard constant velocity. Complex kinetics with variable velocity and acceleration is defined with a speed profile in the Path element. The starting path can be defined with the attribute ’path’, or changed at runtime using the Orchestration mechanism (triggers).
<node id='-1' lat='43.5094' lon='-80.5367'>
<tag k='gs' v='vehicle' />
<tag k='btype' v='PV' />
<tag k='speed' v='14' />
<tag k='yaw' v='45' />
<tag k='path' v='northpath' />
<tag k='usespeedprofile' v='yes' />
</node>
Attributes:
k | v | description |
---|---|---|
gs* | vehicle | GS role key |
speed | float (km/h) | Vehicle standard target speed |
path | string | Path's name |
orientation | int (deg) | Vehicle starting orientarion |
cycles | int | Number of times the vehicle will follow a given path. If not given, the vehicle must follow the path once. If -1, the vehicle will loop through the path untill scenario ends. This attribute can be used to simulate dense traffic situations without creating every single vehicle as an individual element. |
usespeedprofile | bool (yes/no) | If yes, when assigned to a path a vehicle will follow the speed profile from the path. Otherwise, the vehicle will follow the path with its standard target speed. |
model | string | A reference to a vehicle model to be used in simulation. Typically, 3D meshes and skeleton. |
Paths
In order to move, Path vehicles need to be assigned to a path. A path is defined as a way element, and can be used for both vehicles and pedestrians. Paths should be interpreted as splines composed by ordered connected nodes. When a dynamic agent is assigned to a path, it will travel along the path with its reference speed. To support more realistic kinetics with variable velocity and acceleration, or to reproduce scenarios from recorded traffic data, an agent can be assigned to a speed profile. When a path has a speed profile, it must contain nodes with the tag agentspeed to indicate the target speed in km/h for the agent once it reaches that node. The agent must always try to match the speed of the next node in its path with a constant acceleration.
With high density paths (i.e., more nodes) and a speed profile, a GeoScenario model can represent a diverse range of traffic situations, manually designed by experts, extracted from real traffic by sensors, or imported from naturalistic driving databases. In the following example, note how the ID references to the nodes composing a path are given by the tag 'nd' and must be interpreted as an ordered list.
GeoScenario path example:
<way id='-166757'>
<tag k='gs' v='path' />
<tag k='name' v='east_path' />
<tag k='abstract' v='no' />
<nd ref='-133584' />
<nd ref='-133598' />
<nd ref='-133600' />
<nd ref='-133604' />
</way>
Speed profile node example:
<node id='-133584' lat='43.50929904003' lon='-80.53401271512'>
<tag k='agentspeed' v='30' />
<tag k='agentacceleration' v='1' />
<tag k='timetoacceleration' v='0.4' />
</node>
By default, all paths are grounded to fixed node coordinates. We introduce the tag abstract to define flexible paths. Abstract paths are designed on fixed coordinates, but during execution must be shifted to a new origin point based on the agent’s current location. Abstract paths can be used to design dynamic maneuvers. For example, a lane change that can occur at different locations of the road network.
Path attributes:
k | v | description |
---|---|---|
gs* | paths | GS role key |
name* | string | A name for the Agent |
abstract | bool | If the path as abstract, the points must be adapteed to the agent's current location. |
nd | Node id list | Unlike other attributes, the node references are defined using a list of Example: <nd ref='-1' /> <nd ref='-2' /> |
Speed profile node attributes:
k | v | description |
---|---|---|
agentspeed | float (km/h) | the velocity that the agent should have when it reaches this node. |
agentacceleration | float (m/s |
the acceleration the agent should use to achieve the velocity at the next node. |
timetoacceleration | time (s) | the time in which an agent should reach the given acceleration. The acceleration is linearly increased from the agent's previous acceleration to the target one over this period of time. |