class mrpt::nav::CHolonomicND

Overview

An implementation of the holonomic reactive navigation method “Nearness-Diagram”.

The algorithm “Nearness-Diagram” was proposed in:

Nearness diagram (ND) navigation: collision avoidance in troublesome scenarios, IEEE Transactions on Robotics and Automation, Minguez, J. and Montano, L., vol. 20, no. 1, pp. 45-59, 2004.

These are the optional parameters of the method which can be set by means of a configuration file passed to the constructor or to CHolonomicND::initialize() or directly in CHolonomicND::options

# Section name can be changed via setConfigFileSectionName()
[CHolonomicND]
factorWeights=1.0 0.5 2.0 0.4
// 1: Free space
// 2: Dist. in sectors
// 3: Closer to target (euclidean)
// 4: Hysteresis
WIDE_GAP_SIZE_PERCENT            = 0.25
MAX_SECTOR_DIST_FOR_D2_PERCENT   = 0.25
RISK_EVALUATION_SECTORS_PERCENT  = 0.25
RISK_EVALUATION_DISTANCE         = 0.15  // In normalized ps-meters [0,1]
TARGET_SLOW_APPROACHING_DISTANCE = 0.60  // For stopping gradually
TOO_CLOSE_OBSTACLE               = 0.02  // In normalized ps-meters

See also:

CAbstractHolonomicReactiveMethod, CReactiveNavigationSystem

#include <mrpt/nav/holonomic/CHolonomicND.h>

class CHolonomicND: public mrpt::nav::CAbstractHolonomicReactiveMethod
{
public:
    // typedefs

    typedef std::shared_ptr<mrpt::nav ::CHolonomicND> Ptr;
    typedef std::shared_ptr<const mrpt::nav ::CHolonomicND> ConstPtr;
    typedef std::unique_ptr<mrpt::nav ::CHolonomicND> UniquePtr;
    typedef std::unique_ptr<const mrpt::nav ::CHolonomicND> ConstUniquePtr;
    typedef std::vector<TGap> TGapArray;

    // enums

    enum TSituations;

    // structs

    struct TGap;
    struct TOptions;

    // fields

    static constexpr const char* className = "mrpt::nav" "::" "CHolonomicND";
    TOptions options;

    // construction

    CHolonomicND(const mrpt::config::CConfigFileBase* INI_FILE = nullptr);

    // methods

    static constexpr auto getClassName();
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    static std::shared_ptr<CObject> CreateObject();

    template <typename... Args>
    static Ptr Create(Args&&... args);

    template <typename Alloc, typename... Args>
    static Ptr CreateAlloc(
        const Alloc& alloc,
        Args&&... args
        );

    template <typename... Args>
    static UniquePtr CreateUnique(Args&&... args);

    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual mrpt::rtti::CObject* clone() const;
    virtual NavOutput navigate(const NavInput& ni);
    virtual void initialize(const mrpt::config::CConfigFileBase& INI_FILE);
    virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const;
    virtual double getTargetApproachSlowDownDistance() const;
    virtual void setTargetApproachSlowDownDistance(const double dist);
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<CObject> Ptr;
    typedef std::shared_ptr<const CObject> ConstPtr;
    typedef std::shared_ptr<CSerializable> Ptr;
    typedef std::shared_ptr<const CSerializable> ConstPtr;
    typedef std::shared_ptr<CAbstractHolonomicReactiveMethod> Ptr;
    typedef std::shared_ptr<const CAbstractHolonomicReactiveMethod> ConstPtr;

    // structs

    struct NavInput;
    struct NavOutput;

    // methods

    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    mrpt::rtti::CObject::Ptr duplicateGetSmartPtr() const;
    virtual NavOutput navigate(const NavInput& ni) = 0;
    virtual void initialize(const mrpt::config::CConfigFileBase& c) = 0;
    virtual void saveConfigFile(mrpt::config::CConfigFileBase& c) const = 0;
    void setConfigFileSectionName(const std::string& sectName);
    std::string getConfigFileSectionName() const;
    virtual double getTargetApproachSlowDownDistance() const = 0;
    virtual void setTargetApproachSlowDownDistance(const double dist) = 0;
    void setAssociatedPTG(mrpt::nav::CParameterizedTrajectoryGenerator* ptg);
    mrpt::nav::CParameterizedTrajectoryGenerator* getAssociatedPTG() const;
    virtual CObject* clone() const = 0;
    static CAbstractHolonomicReactiveMethod* Create(const std::string& className);

Typedefs

typedef std::shared_ptr<mrpt::nav ::CHolonomicND> Ptr

A type for the associated smart pointer.

Fields

TOptions options

Parameters of the algorithm (can be set manually or loaded from CHolonomicND::initialize or options.loadFromConfigFile(), etc.)

Construction

CHolonomicND(const mrpt::config::CConfigFileBase* INI_FILE = nullptr)

Initialize the parameters of the navigator, from some configuration file, or default values if set to nullptr.

Initialize the parameters of the navigator, from some configuration file, or default values if filename is set to NULL.

Methods

virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const

Returns information about the class of an object in runtime.

virtual mrpt::rtti::CObject* clone() const

Returns a deep copy (clone) of the object, indepently of its class.

virtual NavOutput navigate(const NavInput& ni)

Invokes the holonomic navigation algorithm itself.

See the description of the input/output structures for details on each parameter.

virtual void initialize(const mrpt::config::CConfigFileBase& INI_FILE)

Initialize the parameters of the navigator.

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

saves all available parameters, in a forma loadable by initialize()

virtual double getTargetApproachSlowDownDistance() const

Returns the actual value of this parameter [m], as set via the children class options structure.

See also:

setTargetApproachSlowDownDistance()

virtual void setTargetApproachSlowDownDistance(const double dist)

Sets the actual value of this parameter [m].

See also:

getTargetApproachSlowDownDistance()