106 virtual void navigationStep();
114 virtual void cancel();
115 virtual void resume();
116 virtual void suspend();
117 virtual void resetNavError();
168 m_rethrow_exceptions = enable;
171 return m_rethrow_exceptions;
200 void internal_onStartNewNavigation();
224 void dispatchPendingNavEvents();
233 virtual void onNavigateCommandReceived();
240 virtual void updateCurrentPoseAndSpeeds();
246 virtual void performNavigationStepNavigating(
bool call_virtual_nav_method =
true);
249 virtual void doEmergencyStop(
const std::string &msg );
252 virtual bool changeSpeedsNOP();
253 virtual bool stop(
bool isEmergencyStop);
258 virtual bool checkHasReachedTarget(
const double targetDist)
const;
263 virtual bool checkCollisionWithLatestObstacles(
const mrpt::math::TPose2D &relative_robot_pose)
const;
Virtual base for velocity commands of different kinematic models of planar mobile robot.
This is the base class for any reactive/planned navigation system.
const TErrorReason & getErrorReason() const
In case of state=NAV_ERROR, this returns the reason for the error.
mrpt::poses::CPose2DInterpolator m_latestOdomPoses
Latest robot poses (updated in CAbstractNavigator::navigationStep() )
std::list< TPendingEvent > m_pending_events
Events generated during navigationStep(), enqueued to be called at the end of the method execution to...
mrpt::synch::CCriticalSectionRecursive m_nav_cs
mutex for all navigation methods
CRobot2NavInterface & m_robot
The navigator-robot interface.
std::string m_last_curPoseVelUpdate_pose_frame_id
TErrorCode
Explains the reason for the navigation error.
@ ERR_CANNOT_REACH_TARGET
virtual void initialize()=0
Must be called before any other navigation command.
TState m_navigationState
Current internal state of navigator:
mrpt::utils::CTimeLogger m_timlog_delays
Time logger to collect delay-related stats.
void enableRethrowNavExceptions(const bool enable)
By default, error exceptions on navigationStep() will dump an error message to the output logger inte...
mrpt::system::TTimeStamp m_badNavAlarm_lastMinDistTime
TErrorReason m_navErrorReason
TNavigationParams * m_navigationParams
Current navigation parameters.
bool m_navigationEndEventSent
Will be false until the navigation end is sent, and it is reset with each new command.
const mrpt::utils::CTimeLogger & getDelaysTimeLogger() const
Gives access to a const-ref to the internal time logger used to estimate delays.
TRobotPoseVel m_curPoseVel
Current robot pose (updated in CAbstractNavigator::navigationStep() )
virtual void onStartNewNavigation()=0
Called whenever a new navigation has been started.
double m_badNavAlarm_minDistTarget
For sending an alarm (error event) when it seems that we are not approaching toward the target in a w...
TState getCurrentState() const
Returns the current navigator state.
TState m_lastNavigationState
Last internal state of navigator:
TAbstractNavigatorParams params_abstract_navigator
bool isRethrowNavExceptionsEnabled() const
bool m_rethrow_exceptions
int m_counter_check_target_is_blocked
const mrpt::poses::FrameTransformer< 2 > * getFrameTF() const
Get the current frame tf object (defaults to nullptr)
TState
The different states for the navigation system.
@ NAV_ERROR
In this case, use getErrorReason()
virtual void performNavigationStep()=0
To be implemented in derived classes.
mrpt::poses::FrameTransformer< 2 > * m_frame_tf
Optional, user-provided frame transformer.
double m_last_curPoseVelUpdate_robot_time
The pure virtual interface between a real or simulated robot and any CAbstractNavigator-derived class...
This class stores a time-stamped trajectory in SE(2) (mrpt::math::TPose2D poses).
Recursive mutex: allow recursive locks by the owner thread.
This class allows loading and storing values and vectors of different types from a configuration text...
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
A bidirectional version of std::map, declared as bimap<KEY,VALUE> and which actually contains two std...
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLenum const GLfloat * params
GLsizei const GLchar ** string
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
bool NAV_IMPEXP operator==(const CAbstractNavigator::TNavigationParamsBase &, const CAbstractNavigator::TNavigationParamsBase &)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
2D twist: 2D velocity vector (vx,vy) + planar angular velocity (omega)
double dist_check_target_is_blocked
(Default value=0.6) When closer than this distance, check if the target is blocked to abort navigatio...
int hysteresis_check_target_is_blocked
double dist_to_target_for_sending_event
Default value=0, means use the "targetAllowedDistance" passed by the user in the navigation request.
double alarm_seems_not_approaching_target_timeout
navigator timeout (seconds) [Default=30 sec]
std::string error_msg
Human friendly description of the error.
Base for all high-level navigation commands.
friend bool NAV_IMPEXP operator==(const TNavigationParamsBase &, const TNavigationParamsBase &)
virtual std::string getAsText() const =0
Gets navigation params as a human-readable format.
virtual bool isEqual(const TNavigationParamsBase &o) const =0
virtual ~TNavigationParamsBase()
The struct for configuring navigation requests.
TargetInfo target
Navigation target.
bool event_cannot_get_closer_target
bool event_wp_reached_reached
int event_wp_reached_index
functor_event_void_t event_noargs
event w/o arguments
mrpt::math::TPose2D rawOdometry
raw odometry (frame does not match to "pose", but is expected to be smoother in the short term).
mrpt::system::TTimeStamp timestamp
std::string pose_frame_id
map frame ID for pose
mrpt::math::TTwist2D velGlobal
Individual target info in CAbstractNavigator::TNavigationParamsBase and derived classes.
std::string target_frame_id
(Default="map") Frame ID in which target is given. Optional, use only for submapping applications.
mrpt::math::TPose2D target_coords
Coordinates of desired target location. Heading may be ignored by some reactive implementations.
double targetDesiredRelSpeed
(Default=.05) Desired relative speed (wrt maximum speed), in range [0,1], of the vehicle at target....
float targetAllowedDistance
(Default=0.5 meters) Allowed distance to target in order to end the navigation.
bool operator!=(const TargetInfo &o) const
bool targetIsIntermediaryWaypoint
bool targetIsRelative
(Default=false) Whether the target coordinates are in global coordinates (false) or are relative to t...
mrpt::nav::CAbstractNavigator::TState enum_t
static void fill(bimap< enum_t, std::string > &m_map)
Only specializations of this class are defined for each enum type of interest.