Go to the documentation of this file.
125 virtual std::unique_ptr<TNavigationParams>
clone()
const
127 return std::make_unique<TNavigationParams>(*
this);
191 std::weak_ptr<mrpt::poses::FrameTransformer<2>>
getFrameTF()
const
274 bool call_virtual_nav_method =
true);
288 virtual bool stop(
bool isEmergencyStop);
TState m_navigationState
Current internal state of navigator:
virtual bool changeSpeeds(const mrpt::kinematics::CVehicleVelCmd &vel_cmd)
Default: forward call to m_robot.changeSpeed().
virtual void onNavigateCommandReceived()
Called after each call to CAbstractNavigator::navigate()
mrpt::system::TTimeStamp timestamp
virtual void initialize()=0
Must be called before any other navigation command.
#define MRPT_ENUM_TYPE_END()
virtual void performNavigationStep()=0
To be implemented in derived classes.
double dist_to_target_for_sending_event
Default value=0, means use the "targetAllowedDistance" passed by the user in the navigation request.
Individual target info in CAbstractNavigator::TNavigationParamsBase and derived classes.
void dispatchPendingNavEvents()
friend bool operator==(const TNavigationParamsBase &, const TNavigationParamsBase &)
virtual bool checkHasReachedTarget(const double targetDist) const
Default implementation: check if target_dist is below the accepted distance.
TState
The different states for the navigation system.
double m_last_curPoseVelUpdate_robot_time
double m_badNavAlarm_minDistTarget
For sending an alarm (error event) when it seems that we are not approaching toward the target in a w...
std::string pose_frame_id
map frame ID for pose
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...
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
mrpt::math::TTwist2D velLocal
void internal_onStartNewNavigation()
Called before starting a new navigation.
virtual void navigationStep()
This method must be called periodically in order to effectively run the navigation.
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...
std::unique_ptr< TNavigationParams > m_navigationParams
Current navigation parameters.
void updateCurrentPoseAndSpeeds()
Call to the robot getCurrentPoseAndSpeeds() and updates members m_curPoseVel accordingly.
void processNavigateCommand(const TNavigationParams *params)
Does the job of navigate(), except the call to onNavigateCommandReceived()
TargetInfo target
Navigation target.
std::weak_ptr< mrpt::poses::FrameTransformer< 2 > > getFrameTF() const
Get the current frame tf object (defaults to nullptr)
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.
float targetAllowedDistance
(Default=0.5 meters) Allowed distance to target in order to end the navigation.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
This is the base class for any reactive/planned navigation system.
MRPT_FILL_ENUM_MEMBER(CAbstractNavigator, IDLE)
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...
bool targetIsRelative
(Default=false) Whether the target coordinates are in global coordinates (false) or are relative to t...
virtual std::string getAsText() const =0
Gets navigation params as a human-readable format.
#define MRPT_ENUM_TYPE_BEGIN(_ENUM_TYPE_WITH_NS)
TAbstractNavigatorParams()
virtual ~TNavigationParamsBase()
virtual ~CAbstractNavigator()
dtor
virtual bool isEqual(const TNavigationParamsBase &o) const override
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
TAbstractNavigatorParams params_abstract_navigator
virtual void onStartNewNavigation()=0
Called whenever a new navigation has been started.
virtual void loadConfigFile(const mrpt::config::CConfigFileBase &c)
Loads all params from a file.
The struct for configuring navigation requests.
bool operator==(const CAbstractNavigator::TNavigationParamsBase &, const CAbstractNavigator::TNavigationParamsBase &)
TState m_lastNavigationState
Last internal state of navigator:
virtual void performNavigationStepNavigating(bool call_virtual_nav_method=true)
Factorization of the part inside navigationStep(), for the case of state being NAVIGATING.
double targetDesiredRelSpeed
(Default=.05) Desired relative speed (wrt maximum speed), in range [0,1], of the vehicle at target.
std::string target_frame_id
(Default="map") Frame ID in which target is given.
virtual std::unique_ptr< TNavigationParams > clone() const
mrpt::math::TPose2D rawOdometry
raw odometry (frame does not match to "pose", but is expected to be smoother in the short term).
This class allows loading and storing values and vectors of different types from a configuration text...
void doEmergencyStop(const std::string &msg)
Stops the robot and set navigation state to error.
mrpt::math::TPose2D target_coords
Coordinates of desired target location.
mrpt::poses::CPose2DInterpolator m_latestOdomPoses
const mrpt::system::CTimeLogger & getDelaysTimeLogger() const
Gives access to a const-ref to the internal time logger used to estimate delays.
CRobot2NavInterface & m_robot
The navigator-robot interface.
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
virtual std::string getAsText() const override
Gets navigation params as a human-readable format.
std::string getAsText() const
Gets navigation params as a human-readable format.
virtual bool stop(bool isEmergencyStop)
Default: forward call to m_robot.stop().
This class stores a time-stamped trajectory in SE(2) (mrpt::math::TPose2D poses).
TRobotPoseVel m_curPoseVel
Current robot pose (updated in CAbstractNavigator::navigationStep() )
virtual void suspend()
Suspend current navegation.
Versatile class for consistent logging and management of output messages.
virtual void resetNavError()
Resets a NAV_ERROR state back to IDLE
virtual bool changeSpeedsNOP()
Default: forward call to m_robot.changeSpeedsNOP().
int hysteresis_check_target_is_blocked
(Default=3) How many steps should the condition for dist_check_target_is_blocked be fulfilled to rais...
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),...
virtual bool isEqual(const TNavigationParamsBase &o) const =0
std::weak_ptr< mrpt::poses::FrameTransformer< 2 > > m_frame_tf
Optional, user-provided frame transformer.
std::string m_last_curPoseVelUpdate_pose_frame_id
virtual void cancel()
Cancel current navegation.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
CAbstractNavigator(CRobot2NavInterface &robot_interface_impl)
ctor
virtual void navigate(const TNavigationParams *params)
Navigation request to a single target location.
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
Put this macro inside any class with members that require {16,32,64}-byte memory alignment (e....
int m_counter_check_target_is_blocked
TState getCurrentState() const
Returns the current navigator state.
mrpt::system::CTimeLogger m_timlog_delays
Time logger to collect delay-related stats.
GLsizei const GLchar ** string
bool operator==(const TargetInfo &o) const
double alarm_seems_not_approaching_target_timeout
navigator timeout (seconds) [Default=30 sec]
mrpt::math::TTwist2D velGlobal
Virtual base for velocity commands of different kinematic models of planar mobile robot.
bool targetIsIntermediaryWaypoint
double dist_check_target_is_blocked
(Default value=0.6) When closer than this distance, check if the target is blocked to abort navigatio...
virtual void saveConfigFile(mrpt::config::CConfigFileBase &c) const
Saves all current options to a config file.
mrpt::poses::CPose2DInterpolator m_latestPoses
Latest robot poses (updated in CAbstractNavigator::navigationStep() )
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.
mrpt::system::TTimeStamp m_badNavAlarm_lastMinDistTime
Base for all high-level navigation commands.
GLenum const GLfloat * params
bool operator!=(const TargetInfo &o) const
2D twist: 2D velocity vector (vx,vy) + planar angular velocity (omega)
std::recursive_mutex m_nav_cs
mutex for all navigation methods
virtual void resume()
Continues with suspended navigation.
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 | |