25 CReactiveNavigationSystem3D::CReactiveNavigationSystem3D(
    27     bool enableLogToFile, 
const std::string& logFileDirectory)
    29           react_iterf_impl, enableConsoleOutput, enableLogToFile,
    50     for (
unsigned int i = 0; i < robotShape.
size(); i++)
    62     const std::string s = 
"CReactiveNavigationSystem3D";
    66         HEIGHT_LEVELS, 
"Number of robot vertical sections");
    80     const std::string s = 
"CReactiveNavigationSystem3D";
    82     unsigned int num_levels;
    83     vector<float> xaux, yaux;
    86     num_levels = c.
read_int(s, 
"HEIGHT_LEVELS", 1, 
true);
    88     for (
unsigned int i = 1; i <= num_levels; i++)
    95             s, 
format(
"LEVEL%d_VECTORX", i), vector<float>(0), xaux, 
false);
    97             s, 
format(
"LEVEL%d_VECTORY", i), vector<float>(0), yaux, 
false);
    98         ASSERT_(xaux.size() == yaux.size());
    99         for (
unsigned int j = 0; j < xaux.size(); j++)
   107     unsigned int num_ptgs = c.
read_int(s, 
"PTG_COUNT", 1, 
true);
   113     for (
unsigned int j = 1; j <= num_ptgs; j++)
   118                 "[loadConfigFile] Generating PTG#%u at level %u...", j, i);
   119             const std::string sPTGName =
   122                 sPTGName, c, s, 
format(
"PTG%d_", j));
   128         " Robot height sections = %u\n",
   153                     "[loadConfigFile] Initializing PTG#%u.%u... (`%s`)", j, i,
   174                         "%s/ReacNavGrid_%03u_L%02u.dat.gz",
   213     const float *xs, *ys, *zs;
   217     for (
size_t j = 0; j < nPts; j++)
   220         for (
size_t idxH = 0; idxH < nSlices; ++idxH)
   222             if (zs[j] < 0.01) 
break;  
   231                 if (xs[j] > -OBS_MAX_XY && xs[j] < OBS_MAX_XY &&
   232                     ys[j] > -OBS_MAX_XY && ys[j] < OBS_MAX_XY)
   234                         xs[j], ys[j], zs[j]);
   249     const size_t ptg_idx, std::vector<double>& out_TPObstacles,
   252     const bool eval_clearance)
   260         rel_pose_PTG_origin_wrt_sense_);
   265         const float *xs, *ys, *zs;
   268         for (
size_t obs = 0; obs < nObs; obs++)
   271             rel_pose_PTG_origin_wrt_sense.composePoint(
   272                 xs[obs], ys[obs], ox, oy);
   274                 ox, oy, out_TPObstacles);
   278                     ox, oy, out_clearance);
   298             &m_WS_Obstacles_inlevel, 
CPose3D(0, 0, 0));
   339             "checkCollisionWithLatestObstacles() skipped: no previous "   345         MRPT_LOG_WARN(
"checkCollisionWithLatestObstacles() skipped: no PTGs.");
   349     for (
size_t idxH = 0; idxH < nSlices; ++idxH)
   352         const float *xs, *ys, *zs;
   362             const double R = ptg->getMaxRobotRadius();
   363             for (
size_t obs = 0; obs < nObs; obs++)
   365                 const double gox = xs[obs], goy = ys[obs];
   370                 if (lo.
x >= -
R && lo.
x <= 
R && lo.
y >= -
R && lo.
y <= 
R &&
   371                     ptg->isPointInsideRobotShape(lo.
x, lo.
y))
 void clear()
Erase all the contents of the map. 
 
void setHeight(size_t level, double h)
 
void insertAnotherMap(const CPointsMap *otherMap, const mrpt::poses::CPose3D &otherPose)
Insert the contents of another map into this one with some geometric transformation, without fusing close points. 
 
bool checkCollisionWithLatestObstacles(const mrpt::math::TPose2D &relative_robot_pose) const override
Checks whether the robot shape, when placed at the given pose (relative to the current pose)...
 
virtual bool senseObstacles(mrpt::maps::CSimplePointsMap &obstacles, mrpt::system::TTimeStamp ×tamp)=0
Return the current set of obstacle points, as seen from the local coordinate frame of the robot...
 
void resize(size_t num_levels)
 
mrpt::system::CTimeLogger m_timlog_delays
Time logger to collect delay-related stats. 
 
size_t verticesCount() const
Returns the vertices count in the polygon: 
 
std::string read_string(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
 
mrpt::maps::CSimplePointsMap m_WS_Obstacles_unsorted
The unsorted set of obstacles from the sensors. 
 
mrpt::math::CVectorFloat robotShape_y
 
#define THROW_EXCEPTION(msg)
 
A safe way to call enter() and leave() of a mrpt::system::CTimeLogger upon construction and destructi...
 
std::string std::string format(std::string_view fmt, ARGS &&... args)
 
Base class for all PTGs using a 2D circular robot shape model. 
 
A 3D robot shape stored as a "sliced" stack of 2D polygons, used for CReactiveNavigationSystem3D Depe...
 
void STEP1_InitPTGs() override
 
void saveConfigFile(mrpt::config::CConfigFileBase &c) const override
Saves all current options to a config file. 
 
void loggingGetWSObstaclesAndShape(CLogFileRecord &out_log) override
Generates a pointcloud of obstacles, and the robot shape, to be saved in the logging record for the c...
 
double getHeight(size_t level) const
 
TRobotShape m_robotShape
The robot 3D shape model. 
 
size_type size() const
Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x)) 
 
const mrpt::math::CPolygon & polygon(size_t level) const
 
float read_float(const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const
 
bool m_enableConsoleOutput
Enables / disables the console debug output. 
 
Clearance information for one particular PTG and one set of obstacles. 
 
static CParameterizedTrajectoryGenerator::Ptr CreatePTG(const std::string &ptgClassName, const mrpt::config::CConfigFileBase &cfg, const std::string &sSection, const std::string &sKeyPrefix)
The class factory for creating a PTG from a list of parameters in a section of a given config file (p...
 
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
 
void setRadius(size_t level, double r)
 
mrpt::math::CVectorFloat robotShape_x
The robot shape in WS. 
 
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
 
#define ASSERT_(f)
Defines an assertion mechanism. 
 
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
 
This class allows loading and storing values and vectors of different types from a configuration text...
 
This base provides a set of functions for maths stuff. 
 
double getRadius(size_t level) const
 
void loadConfigFile(const mrpt::config::CConfigFileBase &c) override
Loads all params from a file. 
 
#define MRPT_LOG_DEBUG_FMT(_FMT_STRING,...)
Use: MRPT_LOG_DEBUG_FMT("i=%u", i); 
 
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure. 
 
void loadConfigFile(const mrpt::config::CConfigFileBase &c) override
Loads all params from a file. 
 
std::vector< TPTGmultilevel > m_ptgmultilevel
The set of PTG-transformations to be used: indices are [ptg_index][height_index]. ...
 
Base class for all PTGs using a 2D polygonal robot shape model. 
 
Base class for reactive navigator systems based on TP-Space, with an arbitrary holonomic reactive met...
 
void setRobotShapeRadius(const double robot_radius)
Robot shape must be set before initialization, either from ctor params or via this method...
 
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
 
std::string ptg_cache_files_directory
(Default: ".") 
 
bool implementSenseObstacles(mrpt::system::TTimeStamp &obs_timestamp) override
Return false on any fatal error. 
 
void enter(const std::string_view &func_name) noexcept
Start of a named section. 
 
void setRobotShape(const mrpt::math::CPolygon &robotShape)
Robot shape must be set before initialization, either from ctor params or via this method...
 
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries. 
 
std::vector< mrpt::maps::CSimplePointsMap > m_WS_Obstacles_inlevels
One point cloud per 2.5D robot-shape-slice, coordinates relative to the robot local frame...
 
void getPointsBuffer(size_t &outPointsCount, const float *&xs, const float *&ys, const float *&zs) const
Provides a direct access to points buffer, or nullptr if there is no points in the map...
 
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
 
A class used to store a 3D pose (a 3D translation + a rotation in 3D). 
 
TAbstractPTGNavigatorParams params_abstract_ptg_navigator
 
CRobot2NavInterface & m_robot
The navigator-robot interface. 
 
void changeRobotShape(TRobotShape robotShape)
Change the robot shape, which is taken into account for collision grid building. 
 
double leave(const std::string_view &func_name) noexcept
End of a named section. 
 
~CReactiveNavigationSystem3D() override
Destructor. 
 
double ref_distance
Maximum distance up to obstacles will be considered (D_{max} in papers). 
 
#define MRPT_SAVE_CONFIG_VAR_COMMENT(variableName, __comment)
 
#define MRPT_LOG_WARN(_STRING)
 
mrpt::math::TPoint2D inverseComposePoint(const TPoint2D g) const
 
void STEP3_WSpaceToTPSpace(const size_t ptg_idx, std::vector< double > &out_TPObstacles, mrpt::nav::ClearanceDiagram &out_clearance, const mrpt::math::TPose2D &rel_pose_PTG_origin_wrt_sense, const bool eval_clearance) override
Transform the obstacle into TP-Obstacles in TP-Spaces. 
 
void resize(std::size_t N, bool zeroNewElements=false)
 
mrpt::maps::CSimplePointsMap WS_Obstacles
The WS-Obstacles. 
 
The pure virtual interface between a real or simulated robot and any CAbstractNavigator-derived class...
 
void AddVertex(double x, double y)
Add a new vertex to polygon. 
 
bool m_PTGsMustBeReInitialized
 
void clear()
Clear the contents of this container. 
 
#define MRPT_LOG_INFO_FMT(_FMT_STRING,...)
 
mrpt::system::CTimeLogger m_timelogger
A complete time logger. 
 
void read_vector(const std::string §ion, const std::string &name, const VECTOR_TYPE &defaultValue, VECTOR_TYPE &outValues, bool failIfNotFound=false) const
Reads a configuration parameter of type vector, stored in the file as a string: "[v1 v2 v3 ...
 
void preDestructor()
To be called during children destructors to assure thread-safe destruction, and free of shared object...
 
#define MRPT_LOG_INFO(_STRING)
 
double robotShape_radius
The circular robot radius.