Go to the documentation of this file.
125 virtual std::unique_ptr<TNavigationParams>
clone()
const
127 return std::make_unique<TNavigationParams>(*
this);
218 std::weak_ptr<mrpt::poses::FrameTransformer<2>>
getFrameTF()
const
251 const std::string& s)
override;
254 const std::string& s)
const override;
269 "mrpt::nav::CAbstractNavigator"};
317 bool call_virtual_nav_method =
true);
331 virtual bool stop(
bool isEmergencyStop);
383 true,
"CAbstractNavigator::m_timlog_delays"};
TState m_navigationState
Current internal state of navigator:
virtual bool changeSpeeds(const mrpt::kinematics::CVehicleVelCmd &vel_cmd)
Default: forward call to m_robot.changeSpeed().
const TErrorReason & getErrorReason() const
In case of state=NAV_ERROR, this returns the reason for the error.
virtual void onNavigateCommandReceived()
Called after each call to CAbstractNavigator::navigate()
mrpt::system::TTimeStamp timestamp
void enableRethrowNavExceptions(const bool enable)
By default, error exceptions on navigationStep() will dump an error message to the output logger inte...
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
TErrorReason m_navErrorReason
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...
bool m_rethrow_exceptions
std::unique_ptr< TNavigationParams > m_navigationParams
Current navigation parameters.
virtual void updateCurrentPoseAndSpeeds()
Call to the robot getCurrentPoseAndSpeeds() and updates members m_curPoseVel accordingly.
virtual 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)
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.
bool isRethrowNavExceptionsEnabled() const
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...
@ ERR_CANNOT_REACH_TARGET
virtual std::string getAsText() const =0
Gets navigation params as a human-readable format.
#define MRPT_ENUM_TYPE_BEGIN(_ENUM_TYPE_WITH_NS)
TAbstractNavigatorParams()
bool isEqual(const TNavigationParamsBase &o) const override
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...
virtual 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...
std::string getAsText() const override
Gets navigation params as a human-readable format.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
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).
TErrorCode
Explains the reason for the navigation error.
mrpt::vision::TStereoCalibParams params
TRobotPoseVel m_curPoseVel
Current robot pose (updated in CAbstractNavigator::navigationStep() )
~CAbstractNavigator() override
dtor
virtual void suspend()
Suspend current navegation.
Versatile class for consistent logging and management of output messages.
mrpt::system::CTimeLogger m_navProfiler
Publicly available time profiling object.
virtual void resetNavError()
Resets a NAV_ERROR state back to IDLE
virtual bool changeSpeedsNOP()
Default: forward call to m_robot.changeSpeedsNOP().
virtual ~TNavigationParamsBase()=default
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.
CAbstractNavigator(CRobot2NavInterface &robot_interface_impl)
ctor
virtual void navigate(const TNavigationParams *params)
Navigation request to a single target location.
int m_counter_check_target_is_blocked
std::list< std::function< void(void)> > m_pending_events
Events generated during navigationStep(), enqueued to be called at the end of the method execution to...
TState getCurrentState() const
Returns the current navigator state.
mrpt::system::CTimeLogger m_timlog_delays
Time logger to collect delay-related stats.
std::string error_msg
Human friendly description of the error.
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() )
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.
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.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |