paralleldomain.data_lab.generators.position_request¶
- class AbsolutePositionRequest(*, proto=None, position=None, rotation=None, lane_id=None, resolve_z=None)¶
Returns a location based on an exact coordinate system. Note that when a vehicle agent is placed using an Absolute Position Request, the vehicle may not be placed in the exact position specified by the user.
The vehicle will be placed in the center of, and aligned with, the lane which is closest to the position requested by the user, as long as the initially requested position falls within a drivable lane.
If a
lane_id
is provided, the vehicle will be placed in the center of, and aligned with, that lane, regardless of what position is requested inside the Absolute Position Request.- Parameters:
- position¶
x, y, z coordinates in world coordinates of the position desired.
- rotation¶
3x3 Rotation matrix which specifies the rotation of the returned location. If not provided, rotation will be determined by the lane underneath the specified
position
.
- lane_id¶
Specify the id of a lane on which the position should be returned. If no id is provided, the lane id will be inferred from the
position
specified. In cases where the lane is inferred, the lane will be inferred from one of the following lane types:"Drivable" "Sidewalk" "Parking" "ParkingAisle" "ParkingSpace"
- resolve_z¶
Flag to control whether the z value of the returned location is automatically resolved. If set to True, the returned z location will be the ground location of the specified x and y in
position
. If set to False, the returned z location will be that specified inposition
.If not provided, will be set to True.
- classmethod from_transformation(transformation)¶
- Generates and AbsolutePositionRequest object which corresponds to a location specified in a Transformation
object
- Parameters:
transformation (
Transformation
) – A Transformation object containing the location which the created AbsolutePositionRequest object should specify- Return type:
- Returns:
An AbsolutePositionRequest object which specifies the region passed in the transformation parameter
- class JunctionSpawnPolicy(*, proto=None, distance_to_junction=None, use_intersection_type_probability=None, intersection_type_probability=None)¶
Policy to return a spawn location based on proximity to a junction.
- Parameters:
distance_to_junction (
Optional
[ContinousUniformDistribution
]) –distance_to_junction
use_intersection_type_probability (
Optional
[bool
]) –use_intersection_type_probability
intersection_type_probability (
Optional
[EnumDistribution
]) –intersection_type_probability
proto (Optional[pd_unified_generator_pb2.JunctionSpawnPolicy]) –
- distance_to_junction¶
Specifies a desired range of distances from the spawn location and the junction. The distance between the returned spawn point and the junction will be randomly samples from this distribution. Specified values must be greater than 0.0. If not provided, will revert to default.
- use_intersection_type_probability¶
Flag to control whether to use specified intersection type probabilities. Default: False
- intersection_type_probability¶
Specifies distribution for intersection types (with associated probability) to use if
use_intersection_type_probability
is True. Must be provided ifuse_intersection_type_probability
is True.Valid values:
"Signaled" "Signed"
- class LaneSpawnPolicy(*, proto=None, min_num_lanes_in_same_direction=None, lane_type=None, min_num_lanes_in_opposite_direction=None, lateral_offset=None, bicycles_only_in_bike_lanes=None, nearby_asset_policy=None, road_type=None, position_of_interest_policy=None, min_path_length=None, min_length_behind=None, on_road_parking_angle_distribution=None, lane_decoration_distribution=None)¶
Specifies a lane type (or multiple) on which a location can be returned.
- Parameters:
min_num_lanes_in_same_direction (
Optional
[int
]) –min_num_lanes_in_same_direction
min_num_lanes_in_opposite_direction (
Optional
[int
]) –min_num_lanes_in_opposite_direction
lateral_offset (
Optional
[CenterSpreadConfig
]) –lateral_offset
bicycles_only_in_bike_lanes (
Optional
[bool
]) –bicycles_only_in_bike_lanes
nearby_asset_policy (
Optional
[NearbyAssetPolicy
]) –nearby_asset_policy
position_of_interest_policy (
Optional
[List
[PositionOfInterestPolicy
]]) –position_of_interest_policy
min_path_length (
Optional
[CenterSpreadConfig
]) –min_path_length
min_length_behind (
Optional
[CenterSpreadConfig
]) –min_length_behind
on_road_parking_angle_distribution (
Optional
[EnumDistribution
]) –on_road_parking_angle_distribution
lane_decoration_distribution (
Optional
[EnumDistribution
]) –lane_decoration_distribution
proto (Optional[pd_unified_generator_pb2.LaneSpawnPolicy]) –
- min_num_lanes_in_same_direction¶
Specifies the minimum number of lanes that should exist in the same direction on the road on which the returned location is located. Must be an integer greater than 0. If not provided, will use 0.
- lane_type¶
Specifies the lane types on which the returned location should exist and their associated probabilities.
Valid lane types are:
"Drivable" "NonDrivable" "Parking" "Shoulder" "Biking" "Crosswalk" "ParkingAisle" "ParkingSpace" "Sidewalk"
- min_num_lanes_in_opposite_direction¶
Specifies the minimum number of lanes that should exist in the opposite direction on the road on which the returned location is located. Must be an integer greater than 0. Default: 0
- lateral_offset¶
Specifies the lateral offset in lanes of the returned location. Values in the range from -1.0 to 1.0 are valid. Negative values offset to the left of the lane, positive values to the right. If not provided, will use 0.0.
- bicycles_only_in_bike_lanes¶
Flag to specify if bicycles should only be spawned in bike lanes. Default: True
- nearby_asset_policy¶
Specifies a policy which controls assets near which the returned location should be located.
- road_type¶
Specifies the road types on which the returned location should exist and their associated probabilities. If not provided, no restrictions are placed on the type of road on which a returned location can be located.
Valid values:
"Motorway" "Residential" "Trunk" "Primary" "Secondary" "Tertiary" "Unclassified" "Motorway_Link" "Truck_Link" "Primary_Link" "Secondary_Link" "Tertiary_Link" "Service" "Driveway" "Parking_Aisle" "Driveway_Parking_Entry"
- position_of_interest_policy¶
Specifies a policy which controls the proximity of a returned location to a particular position of interest.
- min_path_length¶
Specifies the minimum length (in meters) of the path (ahead of the spawn location) on which the returned location exists. min_path_length is specified as a CenterSpreadConfig with a minimum and maximum value. The exact min_path_length for a returned location will be randomly sampled from this distribution.
This parameter does not have an effect if spawning in a driveway, parking aisle or parking space. If not provided, 200.0 will be used.
- min_length_behind¶
Specifies the minimum length (in meters) of the path (behind the spawn location) on which the returned location exists. min_path_length is specified as a CenterSpreadConfig with a minimum and maximum value. The exact min_path_length for a returned location will be randomly sampled from this distribution.
This parameter does not have an effect if spawning in a driveway, parking aisle or parking space. If not provided, 100.0 will be used.
- on_road_parking_angle_distribution¶
Specifies the type of parking spaces which should exist on stree parking spaces if a location on street parking spaces is returned by this LaneSpawnPolicy. Parking space types for parking spaces in lots are specified in
ParkingSpaceData
.Valid values:
"PARALLEL" "ANGLE_30" "ANGLE_45" "ANGLE_60" "PERPENDICULAR"
- lane_decoration_distribution¶
Specifies the distribution of lane decorations and their associated probabilities if object decorations are enabled. If not provided, no lane decorations are applied. See
ObjectDecorationParams
for list of valid values.
- class LocationRelativePositionRequest(*, proto=None, agent_tags=None, max_spawn_radius=None, lane_spawn_policy=None)¶
Returns a location in a position relative to a tagged agent. Requires the tagged agent to be placed first.
- Parameters:
agent_tags (
Optional
[List
[str
]]) –agent_tags
max_spawn_radius (
Optional
[float
]) –max_spawn_radius
lane_spawn_policy (
Optional
[LaneSpawnPolicy
]) –lane_spawn_policy
proto (Optional[pd_unified_generator_pb2.LocationRelativePositionRequest]) –
- agent_tags¶
The tag(s) of the agent(s) relative to which the returned location should be calculated.
- max_spawn_radius¶
The maximum radius in meters from the agent in
agent_tags
the returned location can exist. Any value greater than 0.0 can be specified.Default: 150.0
- lane_spawn_policy¶
Specifies a lane criteria on which the returned location can exist. If not provided, no restrictions are placed on what lane type the returned location can exist on.
- class PathTimeRelativePositionRequest(*, proto=None, agent_tags=None, time_to_path=None, time_along_path=None, incident_angle=None)¶
Generator to place an agent in a position and path that will cause it to intersect with another agent’s path at a specified time.
Only works on DRIVABLE lanes and requires the agent with which an intersecting path is desired to the placed first.
- Parameters:
agent_tags (
Optional
[List
[str
]]) –agent_tags
time_to_path (
Optional
[ContinousUniformDistribution
]) –time_to_path
time_along_path (
Optional
[ContinousUniformDistribution
]) –time_along_path
incident_angle (
Optional
[ContinousUniformDistribution
]) –incident_angle
proto (Optional[pd_unified_generator_pb2.PathTimeRelativePositionRequest]) –
- agent_tags¶
The tag(s) of the agent(s) with which the agent being placed should intersect paths with.
- time_to_path¶
The time in seconds required for the agent being placed to intersect with the agent(s) specified in
agent_tags
. The minimum and maximum of a continuous distribution must be specified and the returned time_to_path will be randomly sampled from this distribution.If not provided, will default to 0. If both
time_to_path
andtime_along_path
are 0, aPositionRequest.longitudinal_offset
and/orPositionRequest.lateral_offset
must be specified.
- time_along_path¶
Time for agent(s) specified by agent_tag to reach intersection point. The minimum and maximum of a continuous distribution must be specified and the returned time_along_path will be randomly sampled from this distribution.
If not provided, will default to 0. If both
time_to_path
andtime_along_path
are 0, aPositionRequest.longitudinal_offset
and/orPositionRequest.lateral_offset
must be specified.
- incident_angle¶
Specifies the angle at which the paths of the agent being placed and the agent(s) specified in
agent_tags
cross. Angle is specified in radians in the form of the minimums and maximums of a continuous uniform distribution. If not provided, paths can cross at any angle.
- class PositionOfInterestPolicy(*, proto=None, lane_curvature_spawn_policy=None, junction_spawn_policy=None)¶
Specifies a type of policy to be applied when spawning agents on a lane.
- Parameters:
lane_curvature_spawn_policy (
Optional
[LaneCurvatureSpawnPolicy
]) –lane_curvature_spawn_policy
junction_spawn_policy (
Optional
[JunctionSpawnPolicy
]) –junction_spawn_policy
proto (Optional[pd_unified_generator_pb2.PositionOfInterestPolicy]) –
- lane_curvature_spawn_policy¶
- junction_spawn_policy¶
- class PositionRequest(*, proto=None, longitudinal_offset=None, lateral_offset=None, yaw_offset=None, absolute_position_request=None, path_time_relative_position_request=None, location_relative_position_request=None, lane_spawn_policy=None, road_pitch_position_request=None)¶
Specifies a location in the world which can be used to govern object placement.
- Parameters:
longitudinal_offset (
Optional
[CenterSpreadConfig
]) –longitudinal_offset
lateral_offset (
Optional
[CenterSpreadConfig
]) –lateral_offset
yaw_offset (
Optional
[CenterSpreadConfig
]) –yaw_offset
absolute_position_request (
Optional
[AbsolutePositionRequest
]) –absolute_position_request
path_time_relative_position_request (
Optional
[PathTimeRelativePositionRequest
]) –path_time_relative_position_request
location_relative_position_request (
Optional
[LocationRelativePositionRequest
]) –location_relative_position_request
lane_spawn_policy (
Optional
[LaneSpawnPolicy
]) –lane_spawn_policy
road_pitch_position_request (
Optional
[RoadPitchPositionRequest
]) –road_pitch_position_request
proto (Optional[pd_unified_generator_pb2.PositionRequest]) –
- longitudinal_offset¶
Specifies the distance in meters to move along a lane after an initial is found within the
PositionRequest
. Can be any float: positive values will move forwards along the lane and negative values will move backwards along the lane. If not provided, will default to 0.0.
- lateral_offset¶
Specifies the distance in meters to move laterally (relative to a lane) after an initial is found within the
PositionRequest
. Can be any float: positive values will move rightwards in the lane and negative values will move leftwards in the lane. If not provided, will default to 0.0.
- yaw_offset¶
Specifies a rotation of the returned position about the up axis of the world. The rotation is specified in radians and is aligned with the right hand rule for rotation about the up axis. Rotation is applied about the center of the object. If not specified, will use a value of 0.0.
- absolute_position_request¶
Position request that specifies an x,y,z position in the world.
- path_time_relative_position_request¶
Position request that specifies a time to “path-crossing” between agents.
- location_relative_position_request¶
Position request that specifies a location relative to another agent.
- lane_spawn_policy¶
Position request that returns a location in a specified lane.
- road_pitch_position_request¶
DEPRECATED