A library that generates velocity references to follow a path.
navigation_common::Path Class Reference

#include <Path.hpp>

Inheritance diagram for navigation_common::Path:
Inheritance graph

Public Types

using PathPtr = std::shared_ptr< Path >
- Public Types inherited from navigation_common::PathBase< PathSegment >
using PathSegmentTypePtr = std::shared_ptr< PathSegment >
using PathBasePtr = std::shared_ptr< PathBase >
using Header = std_msgs::Header

Public Member Functions

 Path ()=default
 Path (const navigation_msgs::Path &msg)
 Path (const typename PathBase< PathSegment >::PathBasePtr &pathBase)
 ~Path () override=default
void fromRos (const navigation_msgs::Path &msg)
navigation_msgs::Path toRos () const
void removeFragmentBehindPose (const PoseStamped &pose)
double getTraversability () const
double getMinTraversability () const
PathPtr getDeepCopy () const
void splitLongSegments (double maxSegmentLength, bool interpolateOrientation)
- Public Member Functions inherited from navigation_common::PathBase< PathSegment >
 PathBase ()=default
 PathBase (const PathBasePtr &pathBase)
virtual ~PathBase ()=default
void clear ()
unsigned int getNumberOfSegments () const
PathSegmentTypePtr getSegment (unsigned int id) const
PathSegmentTypePtr getSegmentStartingFromEnd (unsigned int id) const
const PathSegmentTypePtrgetFirstSegment () const
const PathSegmentTypePtrgetLastSegment () const
void addSegment (unsigned int id, const PathSegmentTypePtr &segment)
void addSegmentStartingFromEnd (unsigned int id, const PathSegmentTypePtr &segment)
void addSegmentToStart (const PathSegmentTypePtr &segment)
void addSegmentToEnd (const PathSegmentTypePtr &segment)
void removeSegment (unsigned int id)
void removeSegmentStartingFromEnd (unsigned int id)
void removeSegmentAtStart ()
void removeSegmentAtEnd ()
PathSegmentTypePtr getNearestSegment (const PoseStamped &pose) const
bool getClosestPoseOnPath (const PoseStamped &poseIn, PoseStamped *closestPoseOnPath, double *distance, unsigned int *idSegmentClosestPoseOnPath) const
void getClosestPoseOnLine (const PoseStamped &poseIn, const PoseStamped &pose0, const PoseStamped &pose1, PoseStamped *closestPoseOnLine, double *distance, bool *poseOutCloserToPose0) const
bool moveForwardAlongPath (const PoseStamped &poseIn, const double requestedDistance, PoseStamped *closestPoseOnPath, unsigned int *idSegmentClosestPoseOnPath, PoseStamped *poseOut, double *travelledDistanceOnPath, unsigned int *idSegmentPoseOut) const
bool removeSegmentsBehindPose (const PoseStamped &pose)
bool getIdOfSegment (const PathSegmentTypePtr &segment, unsigned int &id) const
unsigned int getIdFirstSegment () const
unsigned int getIdLastSegment () const
double getLengthOfSegment (unsigned int id) const
double getLengthOfFragment (unsigned int startId, unsigned int endId) const
double getLength () const
void interpolateOrientations ()
void addYawToZ (double zScale, double yawScale)
PathBasePtr getDeepCopyBase () const
std::enable_if<!std::numeric_limits< T >::is_integer, bool >::type almostEqual (T x, T y, int ulp=2) const

Public Attributes

double costs_ = 0
 Costs of the path. More...
- Public Attributes inherited from navigation_common::PathBase< PathSegment >
Header header_
 Header. More...
std::deque< PathSegmentTypePtrpathSegments_
 Array of segments. More...

Member Typedef Documentation

◆ PathPtr

using navigation_common::Path::PathPtr = std::shared_ptr<Path>

Constructor & Destructor Documentation

◆ Path() [1/3]

navigation_common::Path::Path ( )


◆ Path() [2/3]

navigation_common::Path::Path ( const navigation_msgs::Path msg)


msgros path message.

◆ Path() [3/3]

navigation_common::Path::Path ( const typename PathBase< PathSegment >::PathBasePtr pathBase)


pathfrom base class.

◆ ~Path()

navigation_common::Path::~Path ( )


Member Function Documentation

◆ fromRos()

void navigation_common::Path::fromRos ( const navigation_msgs::Path msg)

Import a ros path message.

msgros path message.

◆ getDeepCopy()

PathPtr navigation_common::Path::getDeepCopy ( ) const

Create a deep copy of this path.

new path.

◆ getMinTraversability()

double navigation_common::Path::getMinTraversability ( ) const

Get the minimum traversability of the path.

minimum traversability of the path.

◆ getTraversability()

double navigation_common::Path::getTraversability ( ) const

Get the traversability length of the entire path.

traversability of the path.

◆ removeFragmentBehindPose()

void navigation_common::Path::removeFragmentBehindPose ( const PoseStamped pose)

Remove fragment of the path which would lead to backward movement. Leaves at least one segment in the path.

posepose, e.g. current robot pose.

◆ splitLongSegments()

void navigation_common::Path::splitLongSegments ( double  maxSegmentLength,
bool  interpolateOrientation 

Splits long segments by inserting new nodes.

maxSegmentLengthmaximal length of a segment.
interpolateOrientationTwo modes for interpolating the orientation are available. interpolateOrientation == true: -> Insert nodes on segments, interpolate the rotation quaternion interpolateOrientation == false: -> Insert node on start of segment with orientation pointing along next edge (if start node does not already face that direction) -> Insert node on segment with orientation along current edge -> Insert node on end of segment with orientation pointing along previous edge (if end node does not already face that direction)

◆ toRos()

navigation_msgs::Path navigation_common::Path::toRos ( ) const

Export a ros path message.

ros path message.

Member Data Documentation

◆ costs_

double navigation_common::Path::costs_ = 0

Costs of the path.

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