LocalGuidance
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)
 
- 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

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

Constructor & Destructor Documentation

navigation_common::Path::Path ( )
default

Constructor.

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

Constructor.

Parameters
msgros path message.
navigation_common::Path::Path ( const typename PathBase< PathSegment >::PathBasePtr pathBase)
explicit

Constructor.

Parameters
pathfrom base class.
navigation_common::Path::~Path ( )
overridedefault

Destructor.

Member Function Documentation

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

Import a ros path message.

Parameters
msgros path message.
PathPtr navigation_common::Path::getDeepCopy ( ) const

Create a deep copy of this path.

Returns
new path.
double navigation_common::Path::getMinTraversability ( ) const

Get the minimum traversability of the path.

Returns
minimum traversability of the path.
double navigation_common::Path::getTraversability ( ) const

Get the traversability length of the entire path.

Returns
traversability of the path.
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.

Parameters
posepose, e.g. current robot pose.
void navigation_common::Path::splitLongSegments ( double  maxSegmentLength)

Splits long segments by inserting new nodes.

Parameters
maxSegmentLengthmaximal length of a segment.
navigation_msgs::Path navigation_common::Path::toRos ( ) const

Export a ros path message.

Returns
ros path message.

Member Data Documentation

double navigation_common::Path::costs_ = 0

Costs of the path.


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