Main MRPT website > C++ reference for MRPT 1.9.9
CAbstractNavigator.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
18 #include <mrpt/obs/obs_frwds.h>
19 
20 #include <mutex>
21 #include <memory> // unique_ptr
22 #include <functional>
23 
24 namespace mrpt
25 {
26 namespace nav
27 {
28 /** This is the base class for any reactive/planned navigation system. See
29  * derived classes.
30  *
31  * How to use:
32  * - A class derived from `CRobot2NavInterface` with callbacks must be defined
33  * by the user and provided to the constructor.
34  * - `navigationStep()` must be called periodically in order to effectively run
35  * the navigation. This method will internally call the callbacks to gather
36  * sensor data and robot positioning data.
37  *
38  * It implements the following state machine (see
39  * CAbstractNavigator::getCurrentState() ), taking into account the extensions
40  * described in CWaypointsNavigator
41  * \dot
42  * digraph CAbstractNavigator_States {
43  * IDLE; NAVIGATING; SUSPENDED; NAV_ERROR;
44  * IDLE -> NAVIGATING [ label="CAbstractNavigator::navigate()"];
45  * IDLE -> NAVIGATING [ label="CWaypointsNavigator::navigateWaypoints()" ];
46  * NAVIGATING -> IDLE [ label="Final target reached" ];
47  * NAVIGATING -> IDLE [ label="CAbstractNavigator::cancel()" ];
48  * NAVIGATING -> NAV_ERROR [ label="Upon sensor errors, timeout,..." ];
49  * NAVIGATING -> SUSPENDED [ label="CAbstractNavigator::suspend()" ];
50  * SUSPENDED -> NAVIGATING [ label="CAbstractNavigator::resume()" ];
51  * NAV_ERROR -> IDLE [ label="CAbstractNavigator::resetNavError()" ];
52  * }
53  * \enddot
54  *
55  * \sa CWaypointsNavigator, CReactiveNavigationSystem, CRobot2NavInterface, all
56  * children classes
57  * \ingroup nav_reactive
58  */
60 {
61  public:
62  /** ctor */
63  CAbstractNavigator(CRobot2NavInterface& robot_interface_impl);
64  /** dtor */
65  virtual ~CAbstractNavigator();
66 
67  /** Individual target info in CAbstractNavigator::TNavigationParamsBase and
68  * derived classes */
69  struct TargetInfo
70  {
71  /** Coordinates of desired target location. Heading may be ignored by
72  * some reactive implementations. */
74  /** (Default="map") Frame ID in which target is given. Optional, use
75  * only for submapping applications. */
77  /** (Default=0.5 meters) Allowed distance to target in order to end the
78  * navigation. */
80  /** (Default=false) Whether the \a target coordinates are in global
81  * coordinates (false) or are relative to the current robot pose (true).
82  */
84  /** (Default=.05) Desired relative speed (wrt maximum speed), in range
85  * [0,1], of the vehicle at target. Holonomic nav methods will perform
86  * "slow down" approaching target only if this is "==.0". Intermediary
87  * values will be honored only by the higher-level navigator, based on
88  * straight-line Euclidean distances. */
90  bool targetIsIntermediaryWaypoint; // !< (Default=false) If true, event
91  // callback
92  // `sendWaypointReachedEvent()` will
93  // be called instead of
94  // `sendNavigationEndEvent()`
95 
96  TargetInfo();
97  /** Gets navigation params as a human-readable format */
98  std::string getAsText() const;
99  bool operator==(const TargetInfo& o) const;
100  bool operator!=(const TargetInfo& o) const { return !(*this == o); }
101  };
102 
103  /** Base for all high-level navigation commands. See derived classes */
105  {
107  /** Gets navigation params as a human-readable format */
108  virtual std::string getAsText() const = 0;
109 
110  protected:
111  friend bool operator==(
113  virtual bool isEqual(const TNavigationParamsBase& o) const = 0;
114  };
115 
116  /** The struct for configuring navigation requests. Used in
117  * CAbstractPTGBasedReactive::navigate() */
119  {
120  /** Navigation target */
122 
123  /** Gets navigation params as a human-readable format */
124  virtual std::string getAsText() const override;
125  virtual std::unique_ptr<TNavigationParams> clone() const
126  {
127  return std::make_unique<TNavigationParams>(*this);
128  }
129 
130  protected:
131  virtual bool isEqual(const TNavigationParamsBase& o) const override;
132  };
133 
134  /** \name Navigation control API
135  * @{ */
136 
137  /** Loads all params from a file. To be called before initialize().
138  * Each derived class *MUST* load its own parameters, and then call *ITS
139  * PARENT'S* overriden method to ensure all params are loaded. */
140  virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c);
141  /** Saves all current options to a config file.
142  * Each derived class *MUST* save its own parameters, and then call *ITS
143  * PARENT'S* overriden method to ensure all params are saved. */
144  virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const;
145 
146  /** Must be called before any other navigation command */
147  virtual void initialize() = 0;
148  /** This method must be called periodically in order to effectively run the
149  * navigation */
150  virtual void navigationStep();
151 
152  /** Navigation request to a single target location. It starts a new
153  * navigation.
154  * \param[in] params Pointer to structure with navigation info (its
155  * contents will be copied, so the original can be freely destroyed upon
156  * return if it was dynamically allocated.)
157  * \note A pointer is used so the passed object can be polymorphic with
158  * derived types.
159  */
160  virtual void navigate(const TNavigationParams* params);
161 
162  /** Cancel current navegation. */
163  virtual void cancel();
164  /** Continues with suspended navigation. \sa suspend */
165  virtual void resume();
166  /** Suspend current navegation. \sa resume */
167  virtual void suspend();
168  /** Resets a `NAV_ERROR` state back to `IDLE` */
169  virtual void resetNavError();
170 
171  /** The different states for the navigation system. */
172  enum TState
173  {
174  IDLE = 0,
178  };
179 
180  /** Returns the current navigator state. */
181  inline TState getCurrentState() const { return m_navigationState; }
182  /** Sets a user-provided frame transformer object; used only if providing
183  * targets in a frame ID
184  * different than the one in which robot odometry is given (both IDs
185  * default to `"map"`).
186  */
187  void setFrameTF(
188  const std::weak_ptr<mrpt::poses::FrameTransformer<2>>& frame_tf);
189 
190  /** Get the current frame tf object (defaults to nullptr) \sa setFrameTF */
191  std::weak_ptr<mrpt::poses::FrameTransformer<2>> getFrameTF() const
192  {
193  return m_frame_tf;
194  }
195 
196  /** @}*/
197 
199  {
200  /** Default value=0, means use the "targetAllowedDistance" passed by the
201  * user in the navigation request. */
203  /** navigator timeout (seconds) [Default=30 sec] */
205  /** (Default value=0.6) When closer than this distance, check if the
206  * target is blocked to abort navigation with an error. */
208  /** (Default=3) How many steps should the condition for
209  * dist_check_target_is_blocked be fulfilled to raise an event */
211 
212  virtual void loadFromConfigFile(
214  const std::string& s) override;
215  virtual void saveToConfigFile(
217  const std::string& s) const override;
219  };
220 
222 
223  /** Gives access to a const-ref to the internal time logger used to estimate
224  * delays \sa getTimeLogger() in derived classes */
226  {
227  return m_timlog_delays;
228  }
229 
230  private:
231  /** Last internal state of navigator: */
233  /** Will be false until the navigation end is sent, and it is reset with
234  * each new command */
237 
238  /** Called before starting a new navigation. Internally, it calls to
239  * child-implemented onStartNewNavigation() */
241 
242  protected:
243  /** Events generated during navigationStep(), enqueued to be called at the
244  * end of the method execution to avoid user code to change the navigator
245  * state. */
246  std::vector<std::function<void(void)>> m_pending_events;
247 
249 
250  /** To be implemented in derived classes */
251  virtual void performNavigationStep() = 0;
252 
253  /** Called whenever a new navigation has been started. Can be used to reset
254  * state variables, etc. */
255  virtual void onStartNewNavigation() = 0;
256 
257  /** Called after each call to CAbstractNavigator::navigate() */
258  virtual void onNavigateCommandReceived();
259 
260  /** Call to the robot getCurrentPoseAndSpeeds() and updates members
261  * m_curPoseVel accordingly.
262  * If an error is returned by the user callback, first, it calls
263  * robot.stop() ,then throws an std::runtime_error exception. */
265 
266  /** Factorization of the part inside navigationStep(), for the case of state
267  * being NAVIGATING.
268  * Performs house-hold tasks like raising events in case of starting/ending
269  * navigation, timeout reaching destination, etc.
270  * `call_virtual_nav_method` can be set to false to avoid calling the
271  * virtual method performNavigationStep()
272  */
273  virtual void performNavigationStepNavigating(
274  bool call_virtual_nav_method = true);
275 
276  /** Does the job of navigate(), except the call to
277  * onNavigateCommandReceived() */
279 
280  /** Stops the robot and set navigation state to error */
281  void doEmergencyStop(const std::string& msg);
282 
283  /** Default: forward call to m_robot.changeSpeed(). Can be overriden. */
284  virtual bool changeSpeeds(const mrpt::kinematics::CVehicleVelCmd& vel_cmd);
285  /** Default: forward call to m_robot.changeSpeedsNOP(). Can be overriden. */
286  virtual bool changeSpeedsNOP();
287  /** Default: forward call to m_robot.stop(). Can be overriden. */
288  virtual bool stop(bool isEmergencyStop);
289 
290  /** Default implementation: check if target_dist is below the accepted
291  * distance.
292  * If true is returned here, the end-of-navigation event will be sent out
293  * (only for non-intermediary targets).
294  */
295  virtual bool checkHasReachedTarget(const double targetDist) const;
296 
297  /** Checks whether the robot shape, when placed at the given pose (relative
298  * to the current pose),
299  * is colliding with any of the latest known obstacles.
300  * Default implementation: always returns false. */
302  const mrpt::math::TPose2D& relative_robot_pose) const;
303 
304  /** Current internal state of navigator: */
306  /** Current navigation parameters */
307  std::unique_ptr<TNavigationParams> m_navigationParams;
308 
309  /** The navigator-robot interface. */
311 
312  /** Optional, user-provided frame transformer. */
313  std::weak_ptr<mrpt::poses::FrameTransformer<2>> m_frame_tf;
314 
315  /** mutex for all navigation methods */
316  std::recursive_mutex m_nav_cs;
317 
319  {
322  /** raw odometry (frame does not match to "pose", but is expected to be
323  * smoother in the short term). */
326  /** map frame ID for `pose` */
328  TRobotPoseVel();
329  };
330 
331  /** Current robot pose (updated in CAbstractNavigator::navigationStep() ) */
335  /** Latest robot poses (updated in CAbstractNavigator::navigationStep() ) */
337 
338  /** Time logger to collect delay-related stats */
340 
341  /** For sending an alarm (error event) when it seems that we are not
342  * approaching toward the target in a while... */
345 
346  public:
348 };
349 
350 bool operator==(
353 } // namespace nav
354 } // namespace mrpt
355 
357 using namespace mrpt::nav;
mrpt::nav::CAbstractNavigator::m_navigationState
TState m_navigationState
Current internal state of navigator:
Definition: CAbstractNavigator.h:305
mrpt::nav::CAbstractNavigator::changeSpeeds
virtual bool changeSpeeds(const mrpt::kinematics::CVehicleVelCmd &vel_cmd)
Default: forward call to m_robot.changeSpeed().
Definition: CAbstractNavigator.cpp:412
mrpt::nav::CAbstractNavigator::onNavigateCommandReceived
virtual void onNavigateCommandReceived()
Called after each call to CAbstractNavigator::navigate()
Definition: CAbstractNavigator.cpp:273
mrpt::nav::CAbstractNavigator::TargetInfo::TargetInfo
TargetInfo()
Definition: CAbstractNavigator.cpp:24
mrpt::nav::CAbstractNavigator::TRobotPoseVel::timestamp
mrpt::system::TTimeStamp timestamp
Definition: CAbstractNavigator.h:325
mrpt::nav::CAbstractNavigator::initialize
virtual void initialize()=0
Must be called before any other navigation command.
MRPT_ENUM_TYPE_END
#define MRPT_ENUM_TYPE_END()
Definition: TEnumType.h:74
mrpt::nav::CAbstractNavigator::performNavigationStep
virtual void performNavigationStep()=0
To be implemented in derived classes.
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::dist_to_target_for_sending_event
double dist_to_target_for_sending_event
Default value=0, means use the "targetAllowedDistance" passed by the user in the navigation request.
Definition: CAbstractNavigator.h:202
mrpt::nav::CAbstractNavigator::TargetInfo
Individual target info in CAbstractNavigator::TNavigationParamsBase and derived classes.
Definition: CAbstractNavigator.h:69
mrpt::nav::CAbstractNavigator::NAV_ERROR
@ NAV_ERROR
Definition: CAbstractNavigator.h:177
s
GLdouble s
Definition: glext.h:3676
mrpt::nav::CAbstractNavigator::dispatchPendingNavEvents
void dispatchPendingNavEvents()
Definition: CAbstractNavigator.cpp:249
mrpt::nav::CAbstractNavigator::TNavigationParamsBase::operator==
friend bool operator==(const TNavigationParamsBase &, const TNavigationParamsBase &)
mrpt::nav::CAbstractNavigator::checkHasReachedTarget
virtual bool checkHasReachedTarget(const double targetDist) const
Default implementation: check if target_dist is below the accepted distance.
Definition: CAbstractNavigator.cpp:479
mrpt::nav::CAbstractNavigator::TState
TState
The different states for the navigation system.
Definition: CAbstractNavigator.h:172
mrpt::nav::CAbstractNavigator::m_last_curPoseVelUpdate_robot_time
double m_last_curPoseVelUpdate_robot_time
Definition: CAbstractNavigator.h:333
mrpt::nav::CAbstractNavigator::m_badNavAlarm_minDistTarget
double m_badNavAlarm_minDistTarget
For sending an alarm (error event) when it seems that we are not approaching toward the target in a w...
Definition: CAbstractNavigator.h:343
mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose_frame_id
std::string pose_frame_id
map frame ID for pose
Definition: CAbstractNavigator.h:327
mrpt::nav::CAbstractNavigator::m_pending_events
std::vector< std::function< void(void)> > m_pending_events
Events generated during navigationStep(), enqueued to be called at the end of the method execution to...
Definition: CAbstractNavigator.h:246
mrpt::system::CTimeLogger
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
Definition: system/CTimeLogger.h:43
CPose2DInterpolator.h
mrpt::nav::CAbstractNavigator::TRobotPoseVel::velLocal
mrpt::math::TTwist2D velLocal
Definition: CAbstractNavigator.h:321
mrpt::nav::CAbstractNavigator::internal_onStartNewNavigation
void internal_onStartNewNavigation()
Called before starting a new navigation.
Definition: CAbstractNavigator.cpp:485
mrpt::nav::CAbstractNavigator::navigationStep
virtual void navigationStep()
This method must be called periodically in order to effectively run the navigation.
Definition: CAbstractNavigator.cpp:182
mrpt::nav::CAbstractNavigator::setFrameTF
void setFrameTF(const std::weak_ptr< mrpt::poses::FrameTransformer< 2 >> &frame_tf)
Sets a user-provided frame transformer object; used only if providing targets in a frame ID different...
Definition: CAbstractNavigator.cpp:153
c
const GLubyte * c
Definition: glext.h:6313
mrpt::nav::CAbstractNavigator::m_navigationParams
std::unique_ptr< TNavigationParams > m_navigationParams
Current navigation parameters.
Definition: CAbstractNavigator.h:307
mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds
void updateCurrentPoseAndSpeeds()
Call to the robot getCurrentPoseAndSpeeds() and updates members m_curPoseVel accordingly.
Definition: CAbstractNavigator.cpp:323
mrpt::nav::CAbstractNavigator::processNavigateCommand
void processNavigateCommand(const TNavigationParams *params)
Does the job of navigate(), except the call to onNavigateCommandReceived()
Definition: CAbstractNavigator.cpp:281
mrpt::nav::CAbstractNavigator::TNavigationParams::target
TargetInfo target
Navigation target.
Definition: CAbstractNavigator.h:121
mrpt::nav::CAbstractNavigator::getFrameTF
std::weak_ptr< mrpt::poses::FrameTransformer< 2 > > getFrameTF() const
Get the current frame tf object (defaults to nullptr)
Definition: CAbstractNavigator.h:191
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::saveToConfigFile
virtual void saveToConfigFile(mrpt::config::CConfigFileBase &c, const std::string &s) const override
This method saves the options to a ".ini"-like file or memory-stored string list.
Definition: CAbstractNavigator.cpp:440
mrpt::nav
Definition: CAbstractHolonomicReactiveMethod.h:23
mrpt::nav::CAbstractNavigator::TargetInfo::targetAllowedDistance
float targetAllowedDistance
(Default=0.5 meters) Allowed distance to target in order to end the navigation.
Definition: CAbstractNavigator.h:79
mrpt::nav::CAbstractNavigator::TRobotPoseVel::TRobotPoseVel
TRobotPoseVel()
Definition: CAbstractNavigator.cpp:79
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::nav::CAbstractNavigator
This is the base class for any reactive/planned navigation system.
Definition: CAbstractNavigator.h:59
MRPT_FILL_ENUM_MEMBER
MRPT_FILL_ENUM_MEMBER(CAbstractNavigator, IDLE)
mrpt::nav::CAbstractNavigator::m_navigationEndEventSent
bool m_navigationEndEventSent
Will be false until the navigation end is sent, and it is reset with each new command.
Definition: CAbstractNavigator.h:235
mrpt::nav::CRobot2NavInterface
The pure virtual interface between a real or simulated robot and any CAbstractNavigator-derived class...
Definition: CRobot2NavInterface.h:44
mrpt::nav::CAbstractNavigator::TargetInfo::targetIsRelative
bool targetIsRelative
(Default=false) Whether the target coordinates are in global coordinates (false) or are relative to t...
Definition: CAbstractNavigator.h:83
mrpt::nav::CAbstractNavigator::TNavigationParamsBase::getAsText
virtual std::string getAsText() const =0
Gets navigation params as a human-readable format.
MRPT_ENUM_TYPE_BEGIN
#define MRPT_ENUM_TYPE_BEGIN(_ENUM_TYPE_WITH_NS)
Definition: TEnumType.h:58
FrameTransformer.h
mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose
mrpt::math::TPose2D pose
Definition: CAbstractNavigator.h:320
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::TAbstractNavigatorParams
TAbstractNavigatorParams()
Definition: CAbstractNavigator.cpp:425
mrpt::nav::CAbstractNavigator::TNavigationParamsBase::~TNavigationParamsBase
virtual ~TNavigationParamsBase()
Definition: CAbstractNavigator.h:106
mrpt::nav::CAbstractNavigator::~CAbstractNavigator
virtual ~CAbstractNavigator()
dtor
Definition: CAbstractNavigator.cpp:111
mrpt::nav::CAbstractNavigator::TNavigationParams::isEqual
virtual bool isEqual(const TNavigationParamsBase &o) const override
Definition: CAbstractNavigator.cpp:72
mrpt::system::TTimeStamp
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
Definition: datetime.h:31
mrpt::nav::CAbstractNavigator::params_abstract_navigator
TAbstractNavigatorParams params_abstract_navigator
Definition: CAbstractNavigator.h:221
mrpt::nav::CAbstractNavigator::onStartNewNavigation
virtual void onStartNewNavigation()=0
Called whenever a new navigation has been started.
mrpt::nav::CAbstractNavigator::loadConfigFile
virtual void loadConfigFile(const mrpt::config::CConfigFileBase &c)
Loads all params from a file.
Definition: CAbstractNavigator.cpp:159
mrpt::nav::CAbstractNavigator::TNavigationParams
The struct for configuring navigation requests.
Definition: CAbstractNavigator.h:118
mrpt::nav::CAbstractNavigator::TRobotPoseVel
Definition: CAbstractNavigator.h:318
mrpt::nav::operator==
bool operator==(const CAbstractNavigator::TNavigationParamsBase &, const CAbstractNavigator::TNavigationParamsBase &)
Definition: CAbstractNavigator.cpp:471
mrpt::nav::CAbstractNavigator::m_lastNavigationState
TState m_lastNavigationState
Last internal state of navigator:
Definition: CAbstractNavigator.h:232
mrpt::nav::CAbstractNavigator::performNavigationStepNavigating
virtual void performNavigationStepNavigating(bool call_virtual_nav_method=true)
Factorization of the part inside navigationStep(), for the case of state being NAVIGATING.
Definition: CAbstractNavigator.cpp:494
mrpt::nav::CAbstractNavigator::TargetInfo::targetDesiredRelSpeed
double targetDesiredRelSpeed
(Default=.05) Desired relative speed (wrt maximum speed), in range [0,1], of the vehicle at target.
Definition: CAbstractNavigator.h:89
CRobot2NavInterface.h
mrpt::nav::CAbstractNavigator::TargetInfo::target_frame_id
std::string target_frame_id
(Default="map") Frame ID in which target is given.
Definition: CAbstractNavigator.h:76
mrpt::nav::CAbstractNavigator::TNavigationParams::clone
virtual std::unique_ptr< TNavigationParams > clone() const
Definition: CAbstractNavigator.h:125
COutputLogger.h
mrpt::nav::CAbstractNavigator::TRobotPoseVel::rawOdometry
mrpt::math::TPose2D rawOdometry
raw odometry (frame does not match to "pose", but is expected to be smoother in the short term).
Definition: CAbstractNavigator.h:324
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::nav::CAbstractNavigator::doEmergencyStop
void doEmergencyStop(const std::string &msg)
Stops the robot and set navigation state to error.
Definition: CAbstractNavigator.cpp:260
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams
Definition: CAbstractNavigator.h:198
mrpt::nav::CAbstractNavigator::TargetInfo::target_coords
mrpt::math::TPose2D target_coords
Coordinates of desired target location.
Definition: CAbstractNavigator.h:73
mrpt::nav::CAbstractNavigator::m_latestOdomPoses
mrpt::poses::CPose2DInterpolator m_latestOdomPoses
Definition: CAbstractNavigator.h:336
mrpt::nav::CAbstractNavigator::getDelaysTimeLogger
const mrpt::system::CTimeLogger & getDelaysTimeLogger() const
Gives access to a const-ref to the internal time logger used to estimate delays.
Definition: CAbstractNavigator.h:225
mrpt::nav::CAbstractNavigator::m_robot
CRobot2NavInterface & m_robot
The navigator-robot interface.
Definition: CAbstractNavigator.h:310
TEnumType.h
mrpt::config::CLoadableOptions
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
Definition: config/CLoadableOptions.h:28
mrpt::math::TPose2D
Lightweight 2D pose.
Definition: lightweight_geom_data.h:186
mrpt::nav::CAbstractNavigator::TNavigationParams::getAsText
virtual std::string getAsText() const override
Gets navigation params as a human-readable format.
Definition: CAbstractNavigator.cpp:64
mrpt::nav::CAbstractNavigator::TargetInfo::getAsText
std::string getAsText() const
Gets navigation params as a human-readable format.
Definition: CAbstractNavigator.cpp:35
mrpt::nav::CAbstractNavigator::stop
virtual bool stop(bool isEmergencyStop)
Default: forward call to m_robot.stop().
Definition: CAbstractNavigator.cpp:420
obs_frwds.h
mrpt::poses::CPose2DInterpolator
This class stores a time-stamped trajectory in SE(2) (mrpt::math::TPose2D poses).
Definition: CPose2DInterpolator.h:50
mrpt::poses::FrameTransformer< 2 >
mrpt::nav::CAbstractNavigator::m_curPoseVel
TRobotPoseVel m_curPoseVel
Current robot pose (updated in CAbstractNavigator::navigationStep() )
Definition: CAbstractNavigator.h:332
mrpt::nav::CAbstractNavigator::NAVIGATING
@ NAVIGATING
Definition: CAbstractNavigator.h:175
mrpt::nav::CAbstractNavigator::suspend
virtual void suspend()
Suspend current navegation.
Definition: CAbstractNavigator.cpp:131
mrpt::system::COutputLogger
Versatile class for consistent logging and management of output messages.
Definition: system/COutputLogger.h:117
mrpt::nav::CAbstractNavigator::resetNavError
virtual void resetNavError()
Resets a NAV_ERROR state back to IDLE
Definition: CAbstractNavigator.cpp:145
mrpt::nav::CAbstractNavigator::changeSpeedsNOP
virtual bool changeSpeedsNOP()
Default: forward call to m_robot.changeSpeedsNOP().
Definition: CAbstractNavigator.cpp:418
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::hysteresis_check_target_is_blocked
int hysteresis_check_target_is_blocked
(Default=3) How many steps should the condition for dist_check_target_is_blocked be fulfilled to rais...
Definition: CAbstractNavigator.h:210
mrpt::nav::CAbstractNavigator::SUSPENDED
@ SUSPENDED
Definition: CAbstractNavigator.h:176
CLoadableOptions.h
mrpt::nav::CAbstractNavigator::checkCollisionWithLatestObstacles
virtual bool checkCollisionWithLatestObstacles(const mrpt::math::TPose2D &relative_robot_pose) const
Checks whether the robot shape, when placed at the given pose (relative to the current pose),...
Definition: CAbstractNavigator.cpp:663
mrpt::nav::CAbstractNavigator::TNavigationParamsBase::isEqual
virtual bool isEqual(const TNavigationParamsBase &o) const =0
mrpt::nav::CAbstractNavigator::m_frame_tf
std::weak_ptr< mrpt::poses::FrameTransformer< 2 > > m_frame_tf
Optional, user-provided frame transformer.
Definition: CAbstractNavigator.h:313
CTimeLogger.h
mrpt::nav::CAbstractNavigator::m_last_curPoseVelUpdate_pose_frame_id
std::string m_last_curPoseVelUpdate_pose_frame_id
Definition: CAbstractNavigator.h:334
mrpt::nav::CAbstractNavigator::cancel
virtual void cancel()
Cancel current navegation.
Definition: CAbstractNavigator.cpp:113
void
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
mrpt::nav::CAbstractNavigator::CAbstractNavigator
CAbstractNavigator(CRobot2NavInterface &robot_interface_impl)
ctor
Definition: CAbstractNavigator.cpp:92
mrpt::nav::CAbstractNavigator::navigate
virtual void navigate(const TNavigationParams *params)
Navigation request to a single target location.
Definition: CAbstractNavigator.cpp:314
mrpt::nav::CAbstractNavigator::IDLE
@ IDLE
Definition: CAbstractNavigator.h:174
MRPT_MAKE_ALIGNED_OPERATOR_NEW
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
Put this macro inside any class with members that require {16,32,64}-byte memory alignment (e....
Definition: aligned_allocator.h:90
mrpt::nav::CAbstractNavigator::m_counter_check_target_is_blocked
int m_counter_check_target_is_blocked
Definition: CAbstractNavigator.h:236
mrpt::nav::CAbstractNavigator::getCurrentState
TState getCurrentState() const
Returns the current navigator state.
Definition: CAbstractNavigator.h:181
mrpt::nav::CAbstractNavigator::m_timlog_delays
mrpt::system::CTimeLogger m_timlog_delays
Time logger to collect delay-related stats.
Definition: CAbstractNavigator.h:339
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::nav::CAbstractNavigator::TargetInfo::operator==
bool operator==(const TargetInfo &o) const
Definition: CAbstractNavigator.cpp:52
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::alarm_seems_not_approaching_target_timeout
double alarm_seems_not_approaching_target_timeout
navigator timeout (seconds) [Default=30 sec]
Definition: CAbstractNavigator.h:204
mrpt::nav::CAbstractNavigator::TRobotPoseVel::velGlobal
mrpt::math::TTwist2D velGlobal
Definition: CAbstractNavigator.h:321
mrpt::kinematics::CVehicleVelCmd
Virtual base for velocity commands of different kinematic models of planar mobile robot.
Definition: CVehicleVelCmd.h:22
mrpt::nav::CAbstractNavigator::TargetInfo::targetIsIntermediaryWaypoint
bool targetIsIntermediaryWaypoint
Definition: CAbstractNavigator.h:90
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::dist_check_target_is_blocked
double dist_check_target_is_blocked
(Default value=0.6) When closer than this distance, check if the target is blocked to abort navigatio...
Definition: CAbstractNavigator.h:207
mrpt::nav::CAbstractNavigator::saveConfigFile
virtual void saveConfigFile(mrpt::config::CConfigFileBase &c) const
Saves all current options to a config file.
Definition: CAbstractNavigator.cpp:176
mrpt::nav::CAbstractNavigator::m_latestPoses
mrpt::poses::CPose2DInterpolator m_latestPoses
Latest robot poses (updated in CAbstractNavigator::navigationStep() )
Definition: CAbstractNavigator.h:336
mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::loadFromConfigFile
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &c, const std::string &s) override
This method load the options from a ".ini"-like file or memory-stored string list.
Definition: CAbstractNavigator.cpp:432
mrpt::nav::CAbstractNavigator::m_badNavAlarm_lastMinDistTime
mrpt::system::TTimeStamp m_badNavAlarm_lastMinDistTime
Definition: CAbstractNavigator.h:344
mrpt::nav::CAbstractNavigator::TNavigationParamsBase
Base for all high-level navigation commands.
Definition: CAbstractNavigator.h:104
params
GLenum const GLfloat * params
Definition: glext.h:3534
mrpt::nav::CAbstractNavigator::TargetInfo::operator!=
bool operator!=(const TargetInfo &o) const
Definition: CAbstractNavigator.h:100
mrpt::math::TTwist2D
2D twist: 2D velocity vector (vx,vy) + planar angular velocity (omega)
Definition: lightweight_geom_data.h:2145
mrpt::nav::CAbstractNavigator::m_nav_cs
std::recursive_mutex m_nav_cs
mutex for all navigation methods
Definition: CAbstractNavigator.h:316
mrpt::nav::CAbstractNavigator::resume
virtual void resume()
Continues with suspended navigation.
Definition: CAbstractNavigator.cpp:122



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST