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