struct MinimalWaypointsNav

Overview

struct MinimalWaypointsNav: public mrpt::nav::CWaypointsNavigator
{
    // methods

    virtual bool impl_waypoint_is_reachable(const mrpt::math::TPoint2D& wp_local_wrt_robot) const;
    virtual void performNavigationStep();
    virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c);
    virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const;
    virtual void initialize();
};

Inherited Members

public:
    // enums

    enum TErrorCode;
    enum TState;

    // structs

    struct TMsg;
    struct TAbstractNavigatorParams;
    struct TErrorReason;
    struct TNavigationParams;
    struct TNavigationParamsBase;
    struct TRobotPoseVel;
    struct TargetInfo;
    struct TNavigationParamsWaypoints;
    struct TWaypointsNavigatorParams;

    // classes

    class WaypointsAccessGuard;

    // fields

    bool logging_enable_console_output {true};
    bool logging_enable_keep_record {false};
    TAbstractNavigatorParams params_abstract_navigator;
    mrpt::system::CTimeLogger m_navProfiler {false, "mrpt::nav::CAbstractNavigator"};
    TWaypointsNavigatorParams params_waypoints_navigator;

    // methods

    void logStr(const VerbosityLevel level, std::string_view msg_str) const;
    void logFmt(const VerbosityLevel level, const char* fmt, ...) const;
    void void logCond(const VerbosityLevel level, bool cond, const std::string& msg_str) const;
    void setLoggerName(const std::string& name);
    std::string getLoggerName() const;
    void setVerbosityLevel(const VerbosityLevel level);
    void setVerbosityLevelForCallbacks(const VerbosityLevel level);
    void setMinLoggingLevel(const VerbosityLevel level);
    VerbosityLevel getMinLoggingLevel() const;
    VerbosityLevel getMinLoggingLevelForCallbacks() const;
    bool isLoggingLevelVisible(VerbosityLevel level) const;
    void getLogAsString(std::string& log_contents) const;
    std::string getLogAsString() const;
    void writeLogToFile(const std::optional<std::string>& fname_in = std::nullopt) const;
    void dumpLogToConsole() const;
    std::string getLoggerLastMsg() const;
    void getLoggerLastMsg(std::string& msg_str) const;
    void loggerReset();
    void logRegisterCallback(output_logger_callback_t userFunc);
    bool logDeregisterCallback(output_logger_callback_t userFunc);
    COutputLogger& operator = (const COutputLogger&);
    COutputLogger& operator = (COutputLogger&&);
    static std::array<mrpt::system::ConsoleForegroundColor, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_colors();
    static const std::array<const char*, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_names();
    virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c);
    virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const;
    virtual void initialize() = 0;
    virtual void navigationStep();
    virtual void navigate(const TNavigationParams* params);
    virtual void cancel();
    virtual void resume();
    virtual void suspend();
    virtual void resetNavError();
    TState getCurrentState() const;
    const TErrorReason& getErrorReason() const;
    void setFrameTF(const std::weak_ptr<mrpt::poses::FrameTransformer<2>>& frame_tf);
    std::weak_ptr<mrpt::poses::FrameTransformer<2>> getFrameTF() const;
    void enableRethrowNavExceptions(const bool enable);
    bool isRethrowNavExceptionsEnabled() const;
    const mrpt::system::CTimeLogger& getDelaysTimeLogger() const;
    virtual void navigateWaypoints(const TWaypointSequence& nav_request);
    virtual void getWaypointNavStatus(TWaypointStatusSequence& out_nav_status) const;
    TWaypointStatusSequence getWaypointNavStatus() const;
    WaypointsAccessGuard getWaypointsAccessGuard();
    virtual void navigationStep();
    virtual void cancel();
    bool isRelativePointReachable(const mrpt::math::TPoint2D& wp_local_wrt_robot) const;
    virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c);
    virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const;

Methods

virtual bool impl_waypoint_is_reachable(const mrpt::math::TPoint2D& wp_local_wrt_robot) const

Implements the way to waypoint is free function in children classes: true must be returned if, according to the information gathered at the last navigation step, there is a free path to the given point; false otherwise: if way is blocked or there is missing information, the point is out of range, etc.

virtual void performNavigationStep()

To be implemented in derived classes.

virtual void loadConfigFile(const mrpt::config::CConfigFileBase& c)

Loads all navigator parameters from a config file.

Must be called before initialize(). Derived classes must call the parent implementation after loading their own parameters.

Parameters:

c

The configuration source to read from.

virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const

Saves all current navigator parameters to a config file.

Derived classes must call the parent implementation after saving their own parameters.

Parameters:

c

The configuration file to write to.

virtual void initialize()

Initializes the navigator.

Must be called before any navigation command.