Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
laelaps::LaePath Class Reference

Robot path class. More...

#include <laeTraj.h>

Public Member Functions

 LaePath ()
 Default constructor.
 
 LaePath (const LaePath &src)
 Copy constructor.
 
 ~LaePath ()
 Destructor.
 
LaePath operator= (const LaePath &rhs)
 Assignment operator. More...
 
timespec_t getStartTime ()
 Get navigation start time. More...
 
void setStartTime (timespec_t timeStart)
 Set navigation start time. More...
 
size_t getNumPoints ()
 Get the number of wheel points in trajectory. More...
 
void append (const LaePose &pose, const double fVelocity, const double fAcceleration, const std::string &strName="", const timespec_t &timeStart=StartImmediately)
 Append waypoint to end of path. More...
 
LaeWaypointoperator[] (const size_t i)
 Subscript operator to get reference to wheel point at the given index. More...
 
void clear ()
 Clear data.
 

Protected Attributes

timespec_t m_timeStart
 start time
 
std::vector< LaeWaypointm_path
 path
 

Detailed Description

Robot path class.

A waypoint specifies the goal pose (absolute x,y,theta position), plus the target velocity with the given acceleration at the destination. The waypoint is used in path navigation.

A sequence of waypoints points Wp_i, i=0,n define a path.

Definition at line 693 of file laeTraj.h.

Member Function Documentation

void LaePath::append ( const LaePose pose,
const double  fVelocity,
const double  fAcceleration,
const std::string &  strName = "",
const timespec_t timeStart = StartImmediately 
)

Append waypoint to end of path.

Parameters
PoseRobot 2D pose (x,y,theta).
fVelocityRobot target velocity at waypoint (meters/second).
fAccelerationRobot target acceleration (meters/second^2).
strNameName of waypoint
timeStartStart time to navigate to this waypoint.

Definition at line 172 of file laeTraj.cxx.

177 {
178  stringstream ss;
179 
180  if( strName.empty() )
181  {
182  ss << "wp_" << m_path.size();
183  }
184  else
185  {
186  ss << strName;
187  }
188 
189  LaeWaypoint pt(pose, fVelocity, fAcceleration, ss.str(), timeStart);
190  m_path.push_back(pt);
191 }
Robot fully-defined waypoint.
Definition: laeTraj.h:584
std::vector< LaeWaypoint > m_path
path
Definition: laeTraj.h:807
size_t laelaps::LaePath::getNumPoints ( )
inline

Get the number of wheel points in trajectory.

Returns
Number of points.

Definition at line 761 of file laeTraj.h.

762  {
763  return m_path.size();
764  }
std::vector< LaeWaypoint > m_path
path
Definition: laeTraj.h:807
timespec_t laelaps::LaePath::getStartTime ( )
inline

Get navigation start time.

Returns
Start time. Time is in seconds,nanoseconds from last Epoch.

Definition at line 740 of file laeTraj.h.

741  {
742  return m_timeStart;
743  }
timespec_t m_timeStart
start time
Definition: laeTraj.h:806
LaePath laelaps::LaePath::operator= ( const LaePath rhs)
inline

Assignment operator.

Parameters
rhsRight hand side object.
Returns
Returns copy of this.

Definition at line 727 of file laeTraj.h.

References m_path, and m_timeStart.

728  {
729  m_timeStart = rhs.m_timeStart;
730  m_path = rhs.m_path;
731 
732  return *this;
733  }
std::vector< LaeWaypoint > m_path
path
Definition: laeTraj.h:807
timespec_t m_timeStart
start time
Definition: laeTraj.h:806
LaeWaypoint& laelaps::LaePath::operator[] ( const size_t  i)
inline

Subscript operator to get reference to wheel point at the given index.

Big boy warranty. No out of bound checks are made.

Parameters
iIndex.
Returns
Wheel point.

Definition at line 791 of file laeTraj.h.

792  {
793  return m_path[i];
794  }
std::vector< LaeWaypoint > m_path
path
Definition: laeTraj.h:807
void laelaps::LaePath::setStartTime ( timespec_t  timeStart)
inline

Set navigation start time.

Parameters
timeStartStart time. Time is in seconds,nanoseconds from last Epoch.

Definition at line 751 of file laeTraj.h.

752  {
753  m_timeStart = timeStart;
754  }
timespec_t m_timeStart
start time
Definition: laeTraj.h:806

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