class mrpt::nav::ClearanceDiagram

Clearance information for one particular PTG and one set of obstacles.

Usage:

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

class ClearanceDiagram
{
public:
    // typedefs

    typedef std::map<double, double> dist2clearance_t;

    //
methods

    void clear();
    void resize(size_t actual_num_paths, size_t decimated_num_paths);
    bool empty() const;
    size_t get_actual_num_paths() const;
    size_t get_decimated_num_paths() const;
    double getClearance(uint16_t k, double TPS_query_distance, bool integrate_over_path) const;

    void renderAs3DObject(
        mrpt::opengl::CMesh& mesh,
        double min_x,
        double max_x,
        double min_y,
        double max_y,
        double cell_res,
        bool integrate_over_path
        ) const;

    void readFromStream(mrpt::serialization::CArchive& in);
    void writeToStream(mrpt::serialization::CArchive& out) const;
    dist2clearance_t& get_path_clearance(size_t actual_k);
    const dist2clearance_t& get_path_clearance(size_t actual_k) const;
    dist2clearance_t& get_path_clearance_decimated(size_t decim_k);
    const dist2clearance_t& get_path_clearance_decimated(size_t decim_k) const;
    size_t real_k_to_decimated_k(size_t k) const;
    size_t decimated_k_to_real_k(size_t k) const;
};

Typedefs

typedef std::map<double, double> dist2clearance_t

[TPS_distance] => normalized_clearance_for_exactly_that_robot_pose

Methods

void clear()

Reset to default, empty state.

void resize(size_t actual_num_paths, size_t decimated_num_paths)

Initializes the container to allocate decimated_num_paths entries, as a decimated subset of a total of actual_num_paths paths.

double getClearance(
    uint16_t k,
    double TPS_query_distance,
    bool integrate_over_path
    ) const

Gets the clearance for path k and distance TPS_query_distance in one of two modes:

  • [integrate_over_path=false] clearance from that specific spot, or

  • [integrate_over_path=true] average clearance over the path from the origin to that specific spot.