Drake
PoseSelector< T > Class Template Reference

PoseSelector is a class that provides the relevant pose or poses with respect to a given ego vehicle driving within a given maliput road geometry. More...

#include <drake/automotive/pose_selector.h>

Public Member Functions

 PoseSelector ()=delete
 
Does not allow copy, move, or assignment
 PoseSelector (const PoseSelector &)=delete
 
PoseSelectoroperator= (const PoseSelector &)=delete
 
 PoseSelector (PoseSelector &&)=delete
 
PoseSelectoroperator= (PoseSelector &&)=delete
 

Static Public Member Functions

static std::map< AheadOrBehind, const ClosestPose< T > > FindClosestPair (const maliput::api::Lane *lane, const systems::rendering::PoseVector< T > &ego_pose, const systems::rendering::PoseBundle< T > &traffic_poses, const T &scan_distance)
 Returns the leading and trailing vehicles in a given lane that are closest to an ego vehicle (within lane or another lane) as measured along the s-coordinate of the ego vehicle's lane. More...
 
static ClosestPose< T > FindSingleClosestPose (const maliput::api::Lane *lane, const systems::rendering::PoseVector< T > &ego_pose, const systems::rendering::PoseBundle< T > &traffic_poses, const T &scan_distance, const AheadOrBehind side)
 Same as PoseSelector::FindClosestPair() except that it returns a single ClosestPose for either the vehicle ahead (AheadOrBehind::kAhead) or behind (AheadOrBehind::kBehind). More...
 
static T GetSigmaVelocity (const RoadOdometry< T > &road_odometry)
 Extracts the vehicle's s-direction velocity based on its RoadOdometry road_odometry in the Lane coordinate frame. More...
 
static bool IsWithinDriveable (const maliput::api::LanePosition &lane_position, const maliput::api::Lane *lane)
 Returns true if and only if lane_position is within the longitudinal (s), driveable (r) and elevation (h) bounds of the specified lane (i.e. More...
 
static bool IsWithinLane (const maliput::api::GeoPosition &geo_position, const maliput::api::Lane *lane)
 Returns true if and only if geo_position is within the longitudinal (s), lateral (r) and elevation (h) bounds of the specified lane (i.e. More...
 
static bool IsWithinLane (const maliput::api::LanePosition &lane_position, const maliput::api::Lane *lane)
 Returns true if and only if lane_position is within the driveable bounds of lane and, in addition, r is within its lane bounds. More...
 

Detailed Description

template<typename T>
class drake::automotive::PoseSelector< T >

PoseSelector is a class that provides the relevant pose or poses with respect to a given ego vehicle driving within a given maliput road geometry.

Instantiated templates for the following kinds of T's are provided:

  • double

They are already available to link against in the containing library.

TODO(jadecastro): Enable AutoDiffXd support, and add unit tests.

Constructor & Destructor Documentation

PoseSelector ( const PoseSelector< T > &  )
delete
PoseSelector ( PoseSelector< T > &&  )
delete
PoseSelector ( )
delete

Member Function Documentation

std::map< AheadOrBehind, const ClosestPose< T > > FindClosestPair ( const maliput::api::Lane lane,
const systems::rendering::PoseVector< T > &  ego_pose,
const systems::rendering::PoseBundle< T > &  traffic_poses,
const T &  scan_distance 
)
static

Returns the leading and trailing vehicles in a given lane that are closest to an ego vehicle (within lane or another lane) as measured along the s-coordinate of the ego vehicle's lane.

The ego vehicle must be within the driveable_bounds of lane (i.e. the road is contiguous with lane along the r-direction). This function is used, for instance, as logic for lane-change planners (e.g. MOBIL). The ego car's pose (ego_pose) and the poses of the traffic cars (traffic_poses) are provided. The parameter scan_distance determines the distance along the sequence of lanes to scan before declaring that no traffic car is ahead (resp. behind) the ego car. If no leading/trailing vehicles are seen within traffic_lane, s-positions are taken to be at infinite distances away from the ego car. Traffic vehicles having exactly the same s-position as the ego vehicle but situated in a different (parallel) lane are taken to be behind the ego vehicle.

Returns
A map of AheadOrBehind values to vehicle ClosestPoses (containing RoadOdometries and closest relative distances). Relative distances are always positive, and a distance of positive infinity is returned if no traffic cars are found. Note that when no vehicle is detected in front of (resp. behind) the ego vehicle, the respective RoadPosition within ClosestPoses will contain an s-value of positive (resp. negative) infinity. Any traffic poses that are redunant with ego_pose (i.e. have the same RoadPosition as the ego car) are discarded.

The RoadGeometry from which lane is drawn is required to have default branches set for all branches in the road network.

Here is the caller graph for this function:

ClosestPose< T > FindSingleClosestPose ( const maliput::api::Lane lane,
const systems::rendering::PoseVector< T > &  ego_pose,
const systems::rendering::PoseBundle< T > &  traffic_poses,
const T &  scan_distance,
const AheadOrBehind  side 
)
static

Same as PoseSelector::FindClosestPair() except that it returns a single ClosestPose for either the vehicle ahead (AheadOrBehind::kAhead) or behind (AheadOrBehind::kBehind).

Note that when no car is detected in front of the ego car, the returned RoadOdometry within ClosestPose will contain an s-value of std::numeric_limits<double>::infinity().

Here is the call graph for this function:

Here is the caller graph for this function:

T GetSigmaVelocity ( const RoadOdometry< T > &  road_odometry)
static

Extracts the vehicle's s-direction velocity based on its RoadOdometry road_odometry in the Lane coordinate frame.

Assumes the road has zero elevation and superelevation. Throws if any element of road_odometry.pos is not within the respective bounds of road_odometry.lane.

Here is the call graph for this function:

Here is the caller graph for this function:

bool IsWithinDriveable ( const maliput::api::LanePosition lane_position,
const maliput::api::Lane lane 
)
static

Returns true if and only if lane_position is within the longitudinal (s), driveable (r) and elevation (h) bounds of the specified lane (i.e.

within lane->driveable_bounds() and lane->elevation_bounds()).

Here is the call graph for this function:

static bool IsWithinLane ( const maliput::api::GeoPosition geo_position,
const maliput::api::Lane lane 
)
static

Returns true if and only if geo_position is within the longitudinal (s), lateral (r) and elevation (h) bounds of the specified lane (i.e.

within lane->lane_bounds() and lane->elevation_bounds()).

Here is the caller graph for this function:

static bool IsWithinLane ( const maliput::api::LanePosition lane_position,
const maliput::api::Lane lane 
)
static

Returns true if and only if lane_position is within the driveable bounds of lane and, in addition, r is within its lane bounds.

PoseSelector& operator= ( const PoseSelector< T > &  )
delete
PoseSelector& operator= ( PoseSelector< T > &&  )
delete

The documentation for this class was generated from the following files: