Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
carma_wm::TrackPos Class Reference

Position in a track based coordinate system where the axis are downtrack and crosstrack. Positive crosstrack is to the left of the reference line. More...

#include <TrackPos.hpp>

Collaboration diagram for carma_wm::TrackPos:
Collaboration graph

Public Member Functions

 TrackPos (double down_track, double cross_track)
 Constructor. More...
 
 TrackPos (const lanelet::ArcCoordinates &arc_coord)
 Constructor from lanelet ArcCoordinates which are converted to TrackPos where downtrack = ArcCoordinates.length and crosstrack = -ArcCoordinates.distance. More...
 
lanelet::ArcCoordinates toArcCoordinates ()
 Returns a lanelet ArcCoordinate built from this TrackPos where downtrack = ArcCoordinates.length and crosstrack = -ArcCoordinates.distance. More...
 
bool operator== (const TrackPos &other) const
 
bool operator!= (const TrackPos &other) const
 

Public Attributes

double downtrack = 0
 
double crosstrack = 0
 

Detailed Description

Position in a track based coordinate system where the axis are downtrack and crosstrack. Positive crosstrack is to the left of the reference line.

The position of a point relative to a reference line. The perpendicular distance from the point to the reference line is the crosstrack The distance to the intersection of the perpendicular from the start of the line is the downtrack distance If an x,y point would be located to the right of the reference line then the crosstrack is positive. It is negative if on the left side of the line. NOTE: The positive/negative crosstrack side is flipped relative to a lanelet::ArcCoordinate Most utility functions will assume that the downtrack/crosstrack values are specified in meters

Definition at line 34 of file TrackPos.hpp.

Constructor & Destructor Documentation

◆ TrackPos() [1/2]

carma_wm::TrackPos::TrackPos ( double  down_track,
double  cross_track 
)
inline

Constructor.

Parameters
down_trackThe downtrack distance
cross_trackThe crosstrack distance

Definition at line 45 of file TrackPos.hpp.

45 : downtrack(down_track), crosstrack(cross_track)
46 {
47 }

◆ TrackPos() [2/2]

carma_wm::TrackPos::TrackPos ( const lanelet::ArcCoordinates &  arc_coord)
inline

Constructor from lanelet ArcCoordinates which are converted to TrackPos where downtrack = ArcCoordinates.length and crosstrack = -ArcCoordinates.distance.

Parameters
arc_coordArcCoordinate to copy

Definition at line 54 of file TrackPos.hpp.

54 : downtrack(arc_coord.length), crosstrack(-arc_coord.distance)
55 {
56 }

Member Function Documentation

◆ operator!=()

bool carma_wm::TrackPos::operator!= ( const TrackPos other) const
inline

Definition at line 74 of file TrackPos.hpp.

75 {
76 return !(*this == other);
77 }

◆ operator==()

bool carma_wm::TrackPos::operator== ( const TrackPos other) const
inline

Definition at line 69 of file TrackPos.hpp.

70 {
71 return this == &other || (this->downtrack == other.downtrack && this->crosstrack == other.crosstrack);
72 }

References crosstrack, and downtrack.

◆ toArcCoordinates()

lanelet::ArcCoordinates carma_wm::TrackPos::toArcCoordinates ( )
inline

Returns a lanelet ArcCoordinate built from this TrackPos where downtrack = ArcCoordinates.length and crosstrack = -ArcCoordinates.distance.

Returns
lanelet::ArcCoordinates with values copied from this object

Definition at line 63 of file TrackPos.hpp.

64 {
65 return lanelet::ArcCoordinates{ downtrack, -crosstrack };
66 }

References crosstrack, and downtrack.

Member Data Documentation

◆ crosstrack

◆ downtrack


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