class mrpt::nav::CWaypointsNavigator¶
This class extends CAbstractNavigator
with the capability of following a list of waypoints.
By default, waypoints are followed one by one, but, if they are tagged with allow_skip=true
and the derived navigator class supports it, the navigator may choose to skip some to make a smoother, safer and shorter navigation.
Waypoints have an optional target_heading
field, which will be honored only for waypoints that are skipped, and if the underlying robot interface supports the pure-rotation methods.
Notes on navigation status and event dispatchment:
Navigation state may briefly pass by the
IDLE
status between a waypoint is reached and a new navigation command is issued towards the next waypoint.sendNavigationEndEvent()
will be called only when the last waypoint is reached.Reaching an intermediary waypoint (or skipping it if considered so by the navigator) generates a call to
sendWaypointReachedEvent()
instead.
See also:
Base class CAbstractNavigator, CWaypointsNavigator::navigateWaypoints(), and derived classes.
#include <mrpt/nav/reactive/CWaypointsNavigator.h> class CWaypointsNavigator: public mrpt::nav::CAbstractNavigator { public: // structs struct TNavigationParamsWaypoints; struct TWaypointsNavigatorParams; // fields TWaypointsNavigatorParams params_waypoints_navigator; TAbstractNavigatorParams params_abstract_navigator; // construction CWaypointsNavigator(CRobot2NavInterface& robot_interface_impl); // methods bool isRethrowNavExceptionsEnabled() const; virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c); virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const; }; // direct descendants class CAbstractPTGBasedReactive;
Inherited Members¶
public: // enums enum TErrorCode; enum TState; // structs struct TMsg; struct TAbstractNavigatorParams; struct TErrorReason; struct TNavigationParams; struct TNavigationParamsBase; struct TRobotPoseVel; struct TargetInfo; // fields mrpt::system::CTimeLogger m_navProfiler { false, "mrpt::nav::CAbstractNavigator"}; // methods virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c); virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const; virtual void initialize() = 0; virtual void navigationStep(); virtual void navigate(const TNavigationParams* params); virtual void cancel(); virtual void resume(); virtual void suspend(); virtual void resetNavError(); TState getCurrentState() const; const TErrorReason& getErrorReason() const; void setFrameTF(const std::weak_ptr<mrpt::poses::FrameTransformer<2>>& frame_tf); std::weak_ptr<mrpt::poses::FrameTransformer<2>> getFrameTF() const; void enableRethrowNavExceptions(const bool enable); const mrpt::system::CTimeLogger& getDelaysTimeLogger() const;
Methods¶
virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c)
Loads all params from a file.
To be called before initialize(). Each derived class MUST load its own parameters, and then call ITS PARENT’S overriden method to ensure all params are loaded.
virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const
Saves all current options to a config file.
Each derived class MUST save its own parameters, and then call ITS PARENT’S overriden method to ensure all params are saved.