paralleldomain.data_lab.generators
- class AgentType
- Description:
Currently supported agent types
Args:
- class EgoAgentGeneratorParameters(*, proto=None, agent_type=None, drone_spawn_data=None, ego_model=None, pedestrian_spawn_data=None, position_request=None, traffic_light_color_probability=None, use_traffic_light_color_probability=None, vehicle_spawn_data=None)
- Description:
Places an ego sensor in the world. Required for every scenario. Only works with VEHICLE agent_type, other agent types not implemented yet. All agents placed by the EgoAgentGenerator will have an “EGO” tag added by default.
- Parameters:
agent_type (
Optional
[AgentType
]) –- Description:
Determines what the ego sensor is attached to
- Required:
No, will default to AgentType.VEHICLE
ego_model (
Optional
[str
]) –- Description:
If AgentType is VEHICLE, determines what vehicle type the ego sensor attaches to. Must be a vehicle model from asset registry.
- Required:
No, will default to suv_medium_02.
position_request (
Optional
[PositionRequest
]) –- Description:
Determines where the ego vehicle will spawn
- Required:
Yes
use_traffic_light_color_probability (
Optional
[bool
]) –- Description:
Specifies whether we want to set ego in front of certain traffic light color
- Required:
No, will default to false
traffic_light_color_probability (
Optional
[EnumDistribution
]) –- Description:
Specifies desired traffic light distribution to use if use_traffic_light_color_probability is true Possible values:
Red Yellow Green
- Required:
If use_traffic_light_color_probability is set to true, it is required.
vehicle_spawn_data (
Optional
[VehicleSpawnData
]) –- Description:
Used if agent_type is AgentType.VEHICLE
- Required:
No, will use defaults specified in VehicleSpawnData
pedestrian_spawn_data (
Optional
[PedestrianSpawnData
]) –- Description:
Used if agent_type is AgentType.PEDESTRIAN
- Required:
No, will use defaults specified in PedestrianSpawnData
drone_spawn_data (
Optional
[DroneSpawnData
]) –- Description:
Used if agent_type is AgentType.DRONE
- Required:
No, will use defaults specified in DroneSpawnData
proto (Optional[pd_unified_generator_pb2.EgoAgentGeneratorParameters]) –
- class RenderEgoGenerator(ego_asset_name='suv_medium_02')
Allows the ego vehicle to be rendered
- Parameters:
ego_asset_name (
str
) –- Description:
Name of the ego vehicle model as it appears in the asset registry
- Range:
Name must match a vehicle in the asset registry
- Required:
No, will default to “suv_medium_02” if no name is provided
- class DebrisGeneratorParameters(*, proto=None, agent_spawn_data=None, asset_distribution=None, debris_asset_remove_tag=None, debris_asset_tag=None, debris_center_bias=None, max_debris_distance=None, min_debris_distance=None, position_request=None, spawn_probability=None)
Description: Places debris into the world. Requires ego atomic.
- Parameters:
spawn_probability (
Optional
[float
]) –- Description:
For every possible spawn location, use the probability to determine if object actually spawns. (i.e controls density)
- Range:
0.0 to 1.0, where 1.0 is the most dense
- Required:
No, will use default value if not specified
debris_center_bias (
Optional
[float
]) –- Description:
Determines where in the lane we want to spawn on
- Range:
-1.0 to 1.0, where 1.0 is spawning toward center of lane, -1.0 is spawning towards edges of lane, 0.0 is evenly spaced.
- Required:
No, uses 0.0 if not specified
min_debris_distance (
Optional
[float
]) –- Description:
Minimum spawning distance from ego
- Range:
Greater than or equal to 0.0
- Required:
No, uses 0.0 if not specified
max_debris_distance (
Optional
[float
]) –- Description:
Maximum spawning distance
- Range:
Must be greater than min_debris_distance
- Required:
No, uses default value if not specified
debris_asset_tag (
Optional
[str
]) –- Description:
Comma separated list of asset names from asset registry to spawn with this generator. Example: “trash_bottle_tall_01,trash_box_amazon_01” Each asset has an equal chance of being spawned.
- Required:
No, uses default value if not specified
debris_asset_remove_tag (
Optional
[str
]) –- Description:
Removes any assets present in debris_asset_tag
- Required:
No
position_request (
Optional
[PositionRequest
]) –- Description:
Determines the spawn radius of debris (see LocationRelativePositionRequest)
- Range:
Works with LocationRelativePositionRequest and LaneSpawnPolicy.
- Required:
Yes
asset_distribution (
Optional
[Dict
[str
,float
]]) –- Description:
Specifies the likelihood of each asset when spawning. Asset names must exist in asset registry. If specified, debris_asset_tag and debris_asset_remove_tag are ignored
- Required:
No, if not specified we use the list generated from debris_asset_tag
agent_spawn_data (
Optional
[AgentSpawnData
]) –- Description:
Data associated with this agent.
- Required:
No
proto (Optional[pd_unified_generator_pb2.DebrisGeneratorParameters]) –
- class DroneGeneratorParameters(*, proto=None, drone_spawn_data=None, position_request=None)
Description: Not implemented
- Parameters:
position_request (
Optional
[PositionRequest
]) –- Description:
Determines where the drone will spawn. Note: Will use position request result as the ground end of the flight path
- Required:
Yes
drone_spawn_data (
Optional
[DroneSpawnData
]) –- Description:
This contains parameters that control drone/drone related behavior
- Required:
No, will use defaults specified in DroneSpawnData
proto (Optional[pd_unified_generator_pb2.DroneGeneratorParameters]) –
- class ParkedVehicleGeneratorParameters(*, proto=None, agent_spawn_data=None, position_request=None, spawn_probability=None, vehicle_distribution=None)
Description: Places a parked vehicle into the world. Requires ego atomic.
- Parameters:
position_request (
Optional
[PositionRequest
]) –- Description:
Determines the spawn radius of parked vehicles (see LocationRelativePositionRequest)
- Range:
Only works with LocationRelativePositionRequest
- Required:
Yes
spawn_probability (
Optional
[CenterSpreadConfig
]) –- Description:
For every available parking space within the spawn radius, the generator will use this probability to determine if a parked vehicle should spawn there, (i.e. controls density)
- Required:
No, if not specified will use default probability: {center=0.5, spread=0}
vehicle_distribution (
Optional
[Dict
[str
,VehicleCategoryWeight
]]) –- Description:
Likelihood of vehicle types spawning
- Required:
No, if not specified, will use these defaults:
MIDSIZE 0.181 COMPACT 0.177 BUS 0.019 TRUCK 0.038 SUV 0.197 VAN 0.066 BICYCLE 0.061 MOTORCYCLE 0.068 CARAVAN/RV 0.009 FULLSIZE 0.184
agent_spawn_data (
Optional
[AgentSpawnData
]) –- Description:
Specifies spawn data that applies across agent types
- Required:
No
proto (Optional[pd_unified_generator_pb2.ParkedVehicleGeneratorParameters]) –
- class PedestrianGeneratorParameters(*, proto=None, ped_spawn_data=None, position_request=None)
Description: Places a single pedestrian into the world. Requires ego atomic.
- Parameters:
position_request (
Optional
[PositionRequest
]) –- Description:
Determines where the pedestrian will spawn
- Range:
Any PositionRequest except PathTimeRelativePositionRequest
- Required:
Yes
ped_spawn_data (
Optional
[PedestrianSpawnData
]) –- Description:
This contains parameters that control pedestrian spawning and movement behavior
- Required:
No, will use defaults specified in PedestrianSpawnData
proto (Optional[pd_unified_generator_pb2.PedestrianGeneratorParameters]) –
- class VehiclePeripheral(*, proto=None, disable_accessories=None, disable_occupants=None, emergency_light_probability=None, headlight_probability=None, randomize_vehicle_parts=None, set_headlight_based_on_time_of_day=None, spawn_trailer_probability=None, trailer_initial_yaw=None)
Description: This contains parameters that control vehicle peripheral behavior (i.e. accessory data, color, occupants, etc.)
- Parameters:
spawn_trailer_probability (
Optional
[float
]) – [0.0-1.0] chance of spawning with articulated trailer attachedtrailer_initial_yaw (
Optional
[ContinousUniformDistribution
]) – Trailer angle when spawned, in radiansdisable_occupants (
Optional
[bool
]) – Disables occupants in vehiclesdisable_accessories (
Optional
[bool
]) – Not implemented yetrandomize_vehicle_parts (
Optional
[bool
]) – Toggle for blueprint feature to randomize color based on agent idemergency_light_probability (
Optional
[float
]) – Chance of turning on emergency lights for police/service vehicles Ignored if the vehicle has no emergency lightsset_headlight_based_on_time_of_day (
Optional
[bool
]) –- Description:
If true, turn headlights on in night time scenarios and off in day time scenarios. If false, use the next field headlight_probability to determine headlight state.
- Required:
No, defaults to true
headlight_probability (
Optional
[float
]) –- Description:
Probability of the vehicle having its headlights on. Only used if set_headlight_based_on_time_of_day is false. Ignored if it’s true. Has no impact on daytime running lights.
- Range:
[0-1]
- Required:
No, defaults to 1
proto (Optional[pd_unified_generator_pb2.VehiclePeripheral]) –
- class AbsolutePositionRequest(*, proto=None, lane_id=None, position=None, resolve_z=None, rotation=None)
Description: Uses specific coordinates for initial pose
- Parameters:
position (
Optional
[Float3
]) –- Description:
XYZ Position to spawn at.
- Range:
Position existing on map
- Required:
Yes
rotation (
Optional
[Float3x3
]) –- Description:
3x3 Rotation matrix for spawning agent.
- Required:
No, if not specified will determine the rotation based on the lane and position
lane_id (
Optional
[int
]) –- Description:
Lane ID to spawn in (UMD), inferred by position if not specified.
- Range:
Lane id of lane in the loaded (UMD) map.
- Required:
No. Lane will be inferred from the position and the map data. The lane picked will be of one of the following types: Drivable, Sidewalk, Parking, ParkingAisle, ParkingSpace. In cases where the lane can not be determined automatically, an error will be returned.
resolve_z (
Optional
[bool
]) –- Description:
If true the AbsolutePositionRequest Z value for position will be ignored, and the Z will be set to the ‘ground’ height at the specified XY coordinate.
- Range:
True or False
- Required:
No
proto (Optional[pd_unified_generator_pb2.AbsolutePositionRequest]) –
- class JunctionSpawnPolicy(*, proto=None, distance_to_junction=None, intersection_type_probability=None, use_intersection_type_probability=None)
- Description:
Specifies junction lanes as spawning locations.
- Required:
No
- Parameters:
distance_to_junction (
Optional
[ContinousUniformDistribution
]) –- Description:
Specifies minimum distance from junction
- Range:
Greater than or equal to 0
- Required:
No, will use default zero values
use_intersection_type_probability (
Optional
[bool
]) –- Description:
Specifies whether we want to specify probabilities of intersection types
- Required:
No, will default to false
intersection_type_probability (
Optional
[EnumDistribution
]) –- Description:
Specifies distribution for intersection types to use if use_intersection_type_probability is true Possible values:
Signaled Signed
- Required:
If use_intersection_type_probability is true, it is required.
proto (Optional[pd_unified_generator_pb2.JunctionSpawnPolicy]) –
- class LaneSpawnPolicy(*, proto=None, bicycles_only_in_bike_lanes=None, lane_decoration_distribution=None, lane_type=None, lateral_offset=None, min_length_behind=None, min_num_lanes_in_opposite_direction=None, min_num_lanes_in_same_direction=None, min_path_length=None, nearby_asset_policy=None, on_road_parking_angle_distribution=None, position_of_interest_policy=None, road_type=None)
Description: Specifies lanes to spawn at
- Parameters:
min_num_lanes_in_same_direction (
Optional
[int
]) –- Description:
Minimum number of lanes in the same direction as the selected lane
- Range:
Greater than to equal to 0.0
- Required:
No, will use default 0 values
lane_type (
Optional
[EnumDistribution
]) –- Description:
Specifies lane types to spawn at and their probabilities
- Range:
LaneType, which includes:
{ "Drivable" (regular driving lanes/roads), "NonDrivable" (driveways), "Parking" (parallel parking lanes that run along drivable lanes), "Shoulder" (highway shoulder lanes), "Biking" (bike lanes, typically narrower than Drivable), "Crosswalk" (crosswalk, pedestrian crossings in junction), "ParkingAisle" (aisle lanes in parking lots), "ParkingSpace" (parking lot perpendicular spaces), "Sidewalk" (sidewalks, not including pedestrian crossings in junctions) }
- Required:
No
min_num_lanes_in_opposite_direction (
Optional
[int
]) –- Description:
Minimum number of lanes in the opposite direction as the selected lane
- Range:
Greater than or equal to 0
- Required:
No, will use default value
lateral_offset (
Optional
[CenterSpreadConfig
]) –- Description:
Lateral offset as a percentage of half lane width. Positive means offset to the right. Negative means offset to the left.
- Range:
-1.0 to 1.0
- Required:
No, will default to 0 values
bicycles_only_in_bike_lanes (
Optional
[bool
]) –- Description:
Specifies if bicycles should only spawn in bike lanes
- Required:
No, will use default value
nearby_asset_policy (
Optional
[NearbyAssetPolicy
]) –- Description:
Option to spawn near map assets
- Required:
No
road_type (
Optional
[EnumDistribution
]) –- Description:
Specifies road types to spawn at and their probabilities. Recommended guidance: If specifying highway scenes, set this parameter to {“Motorway”: 1.0}. For other placements, leave empty and use lane_type instead.
- Range:
RoadType, which includes:
{ "Motorway" (highway roads) "Residential" (non-highway and non-parking roads) "Trunk" "Primary" "Secondary" "Tertiary" "Unclassified" "Motorway_Link" "Truck_Link" "Primary_Link" "Secondary_Link" "Tertiary_Link" "Service" "Driveway" "Parking_Aisle" "Driveway_Parking_Entry" }
- Required:
No, if not specified will spawn on any valid road type depending on agent type
min_path_length (
Optional
[CenterSpreadConfig
]) –- Description:
Specifies the desired minimum path length for agent. The length is from the beginning of the lane. This parameter does not have an effect if spawning in a driveway, parking aisle or parking space.
- Required:
No. Defaults to 200.
min_length_behind (
Optional
[CenterSpreadConfig
]) –- Description:
Specifies the desired minimum path length behind the agent. The length is the distance behind the agent’s location to the world edge. This parameter does not have an effect if spawning in a driveway, parking aisle or parking space.
- Required:
No. Defaults to 100.
on_road_parking_angle_distribution (
Optional
[EnumDistribution
]) –- Description:
If this lane spawn policy resolves to a set of parking spaces on the road, this distribution determines what parking space should be selected based on the parking angle. Valid angles are:
PARALLEL ANGLE_30 ANGLE_45 ANGLE_60 PERPENDICULAR
For angled parking in parking lots, the angle_distribution in ParkingSpaceData determines the angle present in the scenario.
- Required:
No.
lane_decoration_distribution (
Optional
[EnumDistribution
]) –- Description:
If object decorations are enabled in the environment paramters you can use the lane_decoration_distribution to select lanes with one of the decorations for spawning. Default is empty, and all decorations (if any) are ignored for spawning. See ObjectDecoratoinParams for a list of valid decorations.
- Required:
No.
proto (Optional[pd_unified_generator_pb2.LaneSpawnPolicy]) –
position_of_interest_policy (Optional[List[PositionOfInterestPolicy]]) –
- class LocationRelativePositionRequest(*, proto=None, agent_tags=None, lane_spawn_policy=None, max_spawn_radius=None)
Description: Gives a location relative to tagged agent (i.e. EGO or STAR). Requires tagged agent to be placed first, otherwise will return error.
- Parameters:
agent_tags (
Optional
[List
[str
]]) –- Description:
Tag of agent to spawn relative to
- Required:
Yes
max_spawn_radius (
Optional
[float
]) –- Description:
The max spawn radius specifies viable spawn locations from the origin, which is the position of tagged agent
- Range:
Must be greater than 0.0
- Required:
No, will use default value if not specified
lane_spawn_policy (
Optional
[LaneSpawnPolicy
]) –- Description:
Specifies lane criteria for viable spawn lanes
- Required:
No
proto (Optional[pd_unified_generator_pb2.LocationRelativePositionRequest]) –
- class PathTimeRelativePositionRequest(*, proto=None, agent_tags=None, incident_angle=None, time_along_path=None, time_to_path=None)
- Description:
Sets an intersection point that the placed agent and the tagged agent’s (i.e. EGO or STAR) will cross, as well as a path for the placed agent. Requires tagged agent to be placed first, otherwise will return error. Only works on Drivable lane type, and only works with vehicles relative to other vehicles
- Parameters:
agent_tags (
Optional
[List
[str
]]) –- Description:
Tag of agent to spawn relative to. Tags are case sensitive.
- Required:
Yes
time_to_path (
Optional
[ContinousUniformDistribution
]) –- Description:
Time for agent being placed to reach intersection point
- Range:
Distribution must sample from nonzero values
- Required:
No, will default to 0 values. Note: If both time_to_path and time_along_path are 0 or not specified, user must specify longitudinal_offset_m and/or lateral_offset_m.
time_along_path (
Optional
[ContinousUniformDistribution
]) –- Description:
Time for agent specified by agent_tag to reach intersection point
- Range:
Distribution must sample from nonzero values
- Required:
No, will default to 0 values. Note: If both time_to_path and time_along_path are 0 or not specified, user must specify longitudinal_offset_m and/or lateral_offset_m.
incident_angle (
Optional
[ContinousUniformDistribution
]) –- Description:
Angle to cross paths at
- Range:
Valid angle in rad
- Required:
No, if not specified then will intersect at any angle
proto (Optional[pd_unified_generator_pb2.PathTimeRelativePositionRequest]) –
- class PositionOfInterestPolicy(*, proto=None, junction_spawn_policy=None, lane_curvature_spawn_policy=None)
- Description:
Specifies what policy to use in order to spawn agents on a lane.
- Required:
No
Args:
- Parameters:
proto (Optional[pd_unified_generator_pb2.PositionOfInterestPolicy]) –
junction_spawn_policy (Optional[JunctionSpawnPolicy]) –
lane_curvature_spawn_policy (Optional[LaneCurvatureSpawnPolicy]) –
- class PositionRequest(*, proto=None, absolute_position_request=None, lane_spawn_policy=None, lateral_offset=None, location_relative_position_request=None, longitudinal_offset=None, path_time_relative_position_request=None, road_pitch_position_request=None, yaw_offset=None)
Description: Determines pose of agents, or spawn center for multiple agents
- Parameters:
longitudinal_offset (
Optional
[CenterSpreadConfig
]) –- Description:
Only applied after initial pose is determined by position_type. Determines how much farther ahead along a lane to move the returned pose
- Required:
No, will default to 0.0
lateral_offset (
Optional
[CenterSpreadConfig
]) –- Description:
Only applied after initial pose is determined by position_type. Determines how much farther to the left (negative for right) we want to move the returned pose
- Required:
No, will default to 0.0
yaw_offset (
Optional
[CenterSpreadConfig
]) –- Description:
Rotates the object around its up axis by yaw_offset radians, positive counter-clockwise. Rotation is around the center of the object, so that a rotation of pi radians occupies the same space as no rotation. Units are in radians. Example: pi/2 radians would rotate pose to the left.
- Required:
No, will default to 0.0
position_type –
- Description:
Determines initial pose
- Required:
Yes
proto (Optional[pd_unified_generator_pb2.PositionRequest]) –
absolute_position_request (Optional[AbsolutePositionRequest]) –
lane_spawn_policy (Optional[LaneSpawnPolicy]) –
location_relative_position_request (Optional[LocationRelativePositionRequest]) –
path_time_relative_position_request (Optional[PathTimeRelativePositionRequest]) –
road_pitch_position_request (Optional[RoadPitchPositionRequest]) –
- class RoadPitchPositionRequest(*, proto=None, bin_pitch_points=None, bin_width=None, lane_spawn_policy=None, road_pitch=None)
Description: Gives a position based on desired road pitch angle to spawn at
Args:
- Parameters:
proto (Optional[pd_unified_generator_pb2.RoadPitchPositionRequest]) –
bin_pitch_points (Optional[bool]) –
bin_width (Optional[float]) –
lane_spawn_policy (Optional[LaneSpawnPolicy]) –
road_pitch (Optional[_pd_distributions_pb2.ContinousUniformDistribution]) –
- class SpecialAgentTag
DEPRECATED: Special Tag used in relative position requests.
Args:
- class RandomPedestrianGeneratorParameters(*, proto=None, min_radius_between_pedestrians=None, num_of_pedestrians_range=None, ped_spawn_data=None, position_request=None, speed_range=None)
Description: Places multiple pedestrians (i.e. a crowd) into the world. Requires ego atomic.
- Parameters:
speed_range (
Optional
[MinMaxConfigFloat
]) –- Description:
Speed of each pedestrian is set randomly within this range
- Range:
Min > 0, Max > Min
- Required:
No, if not specified then will use range {0.5, 1.5}
position_request (
Optional
[PositionRequest
]) –- Description:
Determines the center of where the pedestrians will spawn. Radius controlled by LocationRelativePositionRequest. Also compatible with LaneSpawnPolicy and will use default radius of 20.
- Required:
Yes
num_of_pedestrians_range (
Optional
[MinMaxConfigInt
]) –- Description:
Number of pedestrians to generate is selected randomly within this range. If min_radius_between_pedestrians is high and the determined number of pedestrians can’t be placed, scenario generation will fail.
- Range:
Min > 0, Max > Min
- Required:
Yes
min_radius_between_pedestrians (
Optional
[float
]) –- Description:
Specifies how much space should be between individual pedestrians. The higher the value, the more spaced out the pedestrians will be from each other.
- Range:
Greater than 0.0
- Required:
No, if not specified will use default value
ped_spawn_data (
Optional
[PedestrianSpawnData
]) –- Description:
This contains parameters that control pedestrian and pedestrian related behavior
- Required:
No, will use defaults specified in PedestrianSpawnData
proto (Optional[pd_unified_generator_pb2.RandomPedestrianGeneratorParameters]) –
- class AgentSpawnData(*, proto=None, tags=None)
Contains spawn data that applies across agent types
- Parameters:
tags (
Optional
[List
[str
]]) – Tags we want to apply to this agent. Tags are case sensitive.proto (Optional[pd_unified_generator_pb2.AgentSpawnData]) –
- class DroneSpawnData(*, proto=None, agent_spawn_data=None, ascend_probability=None, flight_path_dir=None, ground_asset_height_offset=None, ground_asset_probability=None, ground_assets=None, height_offset=None)
Description: This contains parameters that control drone/drone related behavior
- Parameters:
ascend_probability (
Optional
[float
]) – Ascend or descendground_asset_probability (
Optional
[float
]) – Probability of having a ground asset at flight path ground endground_assets (
Optional
[List
[str
]]) – List of ground assets to choose fromflight_path_dir (
Optional
[str
]) – Directory where flight path csv is storedagent_spawn_data (
Optional
[AgentSpawnData
]) – Common spawn data across agent typesheight_offset (
Optional
[ContinousUniformDistribution
]) – How far up to offset flight path bottom from ground/top of assetground_asset_height_offset (
Optional
[ContinousUniformDistribution
]) – Height offset for the ground asset itself. used to address z fightingproto (Optional[pd_unified_generator_pb2.DroneSpawnData]) –
- class PedestrianSpawnData(*, proto=None, agent_spawn_data=None, asset_name=None, check_occupancy=None, jaywalker_ego_fwd_offset=None, orient_to_velocity=None, ped_behavior=None, pedestrian_color_override_probability=None, pedestrian_color_override_rgb=None, pedestrians_dynamic_pathing=None, speed=None)
Description: This contains parameters that control pedestrian/pedestrian related behavior
- Parameters:
pedestrian_color_override_probability (
Optional
[CenterSpreadConfig
]) –- Description:
Specifies probability of overriding color of pedestrian’s clothes to RGB color specified by pedestrian_color_override_rgb
- Range:
Greater than or equal to 0
- Required:
No, will default to 0 values
pedestrian_color_override_rgb (
Optional
[Float3
]) –- Description:
Specifies color to override pedestrian’s clothes with if determining an override should happen
- Range:
Valid RGB color
- Required:
No, will use default 0 values if this field is required
pedestrians_dynamic_pathing (
Optional
[bool
]) –- Description:
Specifies whether pedestrian should use dynamic pathing or not. If true, determines path to take during sim and can change depending on location. If false, uses a predetermined path to take during scenario generation.
- Required:
No, will use default value
orient_to_velocity (
Optional
[bool
]) –- Description:
Specifies whether pedestrian should face the direction of movement
- Required:
No, will use default value
check_occupancy (
Optional
[bool
]) –- Description:
Specifies whether or not we check if the area we are trying to spawn in is occupied.
- Required:
No, will use default value
jaywalker_ego_fwd_offset (
Optional
[float
]) –- Description:
Specifies how far ahead the jaywalker should be from the tagged vehicle. If ped_behavior is not set to JAYWALKING, this field will be ignored.
- Range:
Greater than or equal to 0
- Required:
No, will use default value
agent_spawn_data (
Optional
[AgentSpawnData
]) –- Description:
Specifies spawn data that applies across agent types
- Required:
No
ped_behavior (
Optional
[PedestrianBehavior
]) –- Description:
Specifies desired behavior of pedestrian
- Required:
No, will default to NORMAL for PedestrianBehavior
asset_name (
Optional
[str
]) –- Description:
Asset name of pedestrian, must be an asset from asset registry.
- Required:
Yes
speed (
Optional
[float
]) –- Description:
Speed of pedestrian
- Range:
Greater than or equal to 0
- Required:
No, will use default value
proto (Optional[pd_unified_generator_pb2.PedestrianSpawnData]) –
- class VehicleSpawnData(*, proto=None, agent_spawn_data=None, vehicle_behavior=None, vehicle_peripheral=None)
Description: Controls the vehicle’s spawning characteristics and movement behavior
- Parameters:
vehicle_behavior (
Optional
[VehicleBehavior
]) –- Description:
Specifies parameters that control vehicle behavior (i.e. lane change, speed, etc.)
- Required:
No
vehicle_peripheral (
Optional
[VehiclePeripheral
]) –- Description:
Specifies that control vehicle peripheral behavior (i.e. accessory data, color, occupants, etc.)
- Required:
No
agent_spawn_data (
Optional
[AgentSpawnData
]) –- Description:
Specifies spawn data that applies across agent types
- Required:
No
proto (Optional[pd_unified_generator_pb2.VehicleSpawnData]) –
- class StaticAgentGeneratorParameters(*, proto=None, agent_spawn_data=None, model=None, position_request=None)
Description: Places a static agent into the world. Requires ego atomic.
- Parameters:
position_request (
Optional
[PositionRequest
]) –- Description:
Determines where the static agent will spawn
- Required:
Yes
model (
Optional
[str
]) –- Description:
The asset name of the static agent we want to place
- Required:
Yes
agent_spawn_data (
Optional
[AgentSpawnData
]) –- Description:
Data associated with this agent.
- Required:
No
proto (Optional[pd_unified_generator_pb2.StaticAgentGeneratorParameters]) –
- class TrafficGeneratorParameters(*, proto=None, position_request=None, spawn_probability=None, start_separation_time_map=None, target_separation_time_map=None, vehicle_distribution=None, vehicle_spawn_data=None)
Description: Places multiple vehicles into the world. Requires ego atomic.
- Parameters:
position_request (
Optional
[PositionRequest
]) –- Description:
Determines the spawn radius of vehicles (see LocationRelativePositionRequest)
- Range:
Only works with LocationRelativePositionRequest. min_path_length and min_length_behind in the lane spawn policy of LocationRelativePositionRequest should be set smaller than the values used when placing the reference agent to ensure traffic is placed between the reference agent and edge of the world. The default values are halved compared to the normal LaneSpawnPolicy defaults.
- Required:
Yes
spawn_probability (
Optional
[float
]) –- Description:
Within spawn radius, probability that a vehicle will spawn in an available spot. (i.e. controls density) The distance between available spots is tuned by start_separation_time_map.
- Range:
0.0 to 1.0, with 1.0 being the most dense. Recommended to use 0.8 for high density.
- Required:
No, will use default value if not specified
vehicle_spawn_data (
Optional
[VehicleSpawnData
]) –- Description:
This contains parameters that control vehicle and vehicle related behavior
- Required:
No, will use defaults specified in VehicleSpawnData
vehicle_distribution (
Optional
[Dict
[str
,VehicleCategoryWeight
]]) –- Description:
Likelihood of vehicles spawning
- Required:
No. If not specified, will default to:
MIDSIZE 0.181 COMPACT 0.177 BUS 0.019 TRUCK 0.038 SUV 0.197 VAN 0.066 BICYCLE 0.061 MOTORCYCLE 0.068 CARAVAN/RV 0.009 FULLSIZE 0.184
start_separation_time_map (
Optional
[Dict
[str
,ContinousUniformDistribution
]]) –- Description:
Controls the minimum distance between traffic vehicles. Actual spawn distance may be higher as spawn points are skipped based on spawn_probability. Recommended to leave as default. Map of vehicle type to their start separation time distributions. Uses initial speed * separation time to determine distance between vehicles.
- Required:
No, if not specified will use defaults, see map below:
{"bicycle", {0.7f, 1.7f}}, {"heavy", {2.5f, 3.5f}}, {"heavy_nondriven", {2.5f, 3.5f}}, {"light", {0.7f, 1.7f}}, {"light_nondriven", {0.7f, 1.7f}}, {"medium", {1.5f, 2.5f}}, {"medium_nondriven", {1.5f, 2.5f}}, {"motorcycle", {0.7f, 1.7f}}
target_separation_time_map (
Optional
[Dict
[str
,ContinousUniformDistribution
]]) –- Description:
Map of vehicle type to their target separation time distributions
- Required:
No, if not specified it will use the values provided in start_separation_time_map.
proto (Optional[pd_unified_generator_pb2.TrafficGeneratorParameters]) –
- class VehicleGeneratorParameters(*, proto=None, model=None, position_request=None, vehicle_spawn_data=None)
Description: Places a single vehicle into the world. Requires ego atomic.
- Parameters:
model (
Optional
[str
]) –- Description:
Vehicle asset name we want to spawn. Vehicle model must be in asset registry.
- Required:
Yes
position_request (
Optional
[PositionRequest
]) –- Description:
Determines where the vehicle will spawn
- Required:
Yes
vehicle_spawn_data (
Optional
[VehicleSpawnData
]) –- Description:
Controls the single vehicle’s spawning characteristics and movement behavior
- Required:
No, will use defaults specified in VehicleSpawnData
proto (Optional[pd_unified_generator_pb2.VehicleGeneratorParameters]) –
- class DrivewayCreepGenerator(behavior_duration, number_of_vehicles=3, min_driveway_length=6.0, driveway_entry_probability=0.5, vehicles_to_spawn=None, radius=15.0)
Places vehicle into driveways within the world. These vehicles will traverse along the driveway over the course of the scene
- Parameters:
behavior_duration (
float
) –- Description:
Length of time in seconds in which the vehicle should travel from the start to end of the driveway
- Required:
Yes
number_of_vehicles (
int
) –- Description:
Number of vehicles to place in the world
- Range:
Greater than 0
- Required:
No, will default to 3
min_driveway_length (
float
) –- Description:
The minimum length of driveway in meters on which to place vehicles
- Required:
No, will default to 6.0 meters
driveway_entry_probability (
float
) –- Description:
The probability that a placed vehicle will travel inwards on a driveway vs travelling outwards
- Range:
Between 0 and 1.0
- Required:
No, will default to 0.5
vehicles_to_spawn (
Optional
[List
[str
]]) –- Description:
The list of vehicles to spawn in Driveways. Each placed vehicle will be randomly selected from this list
- Range:
Each name must match a vehicle in the asset registry
- Required:
No, will default to randomly selecting a vehicle from the following vehicle categories (“COMPACT”, “FULLSIZE”, “MIDSIZE”, “SUV”)
radius (
float
) –- Description:
The radius in meters around the ego vehicle in which driveways are selected for placement of driveway creeping vehicles
- Range:
Greater than 0
- Required:
No, will default to 15 meters