Go to the documentation of this file.
10 #ifndef CICPCRITERIANRD_IMPL_H
11 #define CICPCRITERIANRD_IMPL_H
22 template <
class GRAPH_T>
44 template <
class GRAPH_T>
49 template <
class GRAPH_T>
62 bool registered_new_node =
false;
70 std::dynamic_pointer_cast<CObservation2DRangeScan>(observation);
76 std::dynamic_pointer_cast<CObservation3DRangeScan>(observation);
84 std::dynamic_pointer_cast<CObservationOdometry>(observation);
96 if (action->getBestMovementEstimation())
101 action->getBestMovementEstimation();
104 increment_gaussian.
copyFrom(*increment);
124 return registered_new_node;
129 template <
class GRAPH_T>
134 bool registered_new_node =
false;
148 return registered_new_node;
152 template <
class GRAPH_T>
159 bool registered_new_node =
false;
170 MRPT_LOG_DEBUG(
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
172 "ICP Alignment operation:\tnIterations: %d\tgoodness: %.f\n",
175 "Current ICP constraint: \n\tEdge: %s\n\tNorm: %f",
176 rel_edge.getMeanVal().asString().c_str(), rel_edge.getMeanVal().norm());
178 "Corresponding Odometry constraint: \n\tEdge: %s\n\tNorm: %f",
184 double mahal_distance =
195 double mahal_distance_lim = 0.18;
202 if (mahal_distance < mahal_distance_lim ||
228 MRPT_LOG_DEBUG(
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
229 return registered_new_node;
233 template <
class GRAPH_T>
241 template <
class GRAPH_T>
248 template <
class GRAPH_T>
259 bool angle_crit =
false;
264 params.registration_max_angle;
266 bool distance_crit =
false;
270 params.registration_max_distance;
274 bool registered =
false;
275 if (distance_crit || angle_crit)
284 template <
class GRAPH_T>
290 params.loadFromConfigFileName(
291 source_fname,
"NodeRegistrationDeciderParameters");
298 int min_verbosity_level =
source.read_int(
299 "NodeRegistrationDeciderParameters",
"class_verbosity", 1,
false);
305 template <
class GRAPH_T>
317 template <
class GRAPH_T>
328 stringstream class_props_ss;
329 class_props_ss <<
"ICP Goodness-based Registration Procedure Summary: "
341 *report_str += class_props_ss.str();
345 *report_str += time_res;
348 *report_str += output_res;
356 template <
class GRAPH_T>
360 template <
class GRAPH_T>
364 template <
class GRAPH_T>
366 std::ostream& out)
const
373 "------------------[ ICP Fixed Intervals Node Registration "
374 "]------------------\n");
376 "Max distance for registration = %.2f m\n", registration_max_distance);
378 "Max Angle for registration = %.2f deg\n",
379 RAD2DEG(registration_max_angle));
381 decider.range_ops_t::params.dumpToTextStream(out);
385 template <
class GRAPH_T>
393 registration_max_distance =
source.read_double(
394 section,
"registration_max_distance", 0.5 ,
false);
395 registration_max_angle =
source.read_double(
396 section,
"registration_max_angle", 10 ,
false);
397 registration_max_angle =
DEG2RAD(registration_max_angle);
400 decider.range_ops_t::params.loadFromConfigFile(
source,
"ICP");
std::shared_ptr< CObservation > Ptr
void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
float goodness
A goodness measure for the alignment, it is a [0,1] range indicator of percentage of correspondences.
static const std::string header_sep
Separator string to be used in debugging messages.
bool checkRegistrationCondition()
Check whether a new node should be registered in the graph.
std::shared_ptr< CSensoryFrame > Ptr
std::shared_ptr< CObservationOdometry > Ptr
void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
bool checkRegistrationCondition2D()
Specialized checkRegistrationCondtion method used solely when dealing with 2DRangeScan information.
#define MRPT_LOG_DEBUG(_STRING)
Use: MRPT_LOG_DEBUG("message");
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
pose_t m_curr_odometry_only_pose
pose_t estimation using only odometry information.
bool m_use_angle_difference_node_reg
void copyFrom(const CPosePDF &o) override
Copy operator, translating if necesary (for example, between particles and gaussian representations)
typename GRAPH_T::constraint_t constraint_t
type of graph constraints
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
constraint_t m_since_prev_node_PDF
Tracking the PDF of the current position of the robot with regards to the <b previous registered node...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
virtual void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
void resetPDF(constraint_t *c)
Reset the given PDF method and assign a fixed high-certainty Covariance/Information matrix.
#define THROW_EXCEPTION(msg)
std::shared_ptr< CActionRobotMovement2D > Ptr
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
double RAD2DEG(const double x)
Radians to degrees.
void enter(const char *func_name)
Start of a named section.
#define MRPT_LOG_DEBUG_FMT(_FMT_STRING,...)
Use: MRPT_LOG_DEBUG_FMT("i=%u", i);
~CICPCriteriaNRD()
Class destructor.
This namespace contains representation of robot actions and observations.
bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation)
Update the decider state using the latest dataset measurements.
The ICP algorithm return information.
double leave(const char *func_name)
End of a named section.
GLsizei GLsizei GLchar * source
An observation of the current (cumulative) odometry for a wheeled robot.
virtual void initializeLoggers(const std::string &name)
Initialize the COutputLogger, CTimeLogger instances given the name of the decider/optimizer at hand.
int m_times_used_odom
How many times we used the Odometry Edge instead of the ICP edge.
std::string getLogAsString() const
Get the history of COutputLogger instance in a string representation.
void logFmt(const VerbosityLevel level, const char *fmt,...) const MRPT_printf_format_check(3
Alternative logging method, which mimics the printf behavior.
void dumpToTextStream(std::ostream &out) const
This method should clearly display all the contents of the structure in textual form,...
T wrapToPi(T a)
Modifies the given angle to translate it into the ]-pi,pi] range.
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement,...
VerbosityLevel
Enumeration of available verbosity levels.
This class allows loading and storing values and vectors of different types from a configuration text...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
mrpt::obs::CObservation2DRangeScan::Ptr m_last_laser_scan2D
handy laser scans to use in the class methods
bool checkRegistrationCondition3D()
Specialized checkRegistrationCondition method used solely when dealing with 3DRangeScan information.
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::rtti::CObject) is of the give...
void setMinLoggingLevel(const VerbosityLevel level)
Set the minimum logging level for which the incoming logs are going to be taken into account.
A Probability Density function (PDF) of a 2D pose as a Gaussian with a mean and the inverse of the c...
void getICPEdge(const mrpt::obs::CObservation2DRangeScan &from, const mrpt::obs::CObservation2DRangeScan &to, constraint_t *rel_edge, const mrpt::poses::CPose2D *initial_pose=nullptr, mrpt::slam::CICP::TReturnInfo *icp_info=nullptr)
Align the 2D range scans provided and fill the potential edge that can transform the one into the oth...
bool updateState3D(mrpt::obs::CObservation3DRangeScan::Ptr observation)
Specialized updateState method used solely when dealing with 3DRangeScan information.
void loadParams(const std::string &source_fname)
Load the necessary for the decider/optimizer configuration parameters.
std::shared_ptr< CObservation2DRangeScan > Ptr
CICPCriteriaNRD()
Class constructor.
bool updateState2D(mrpt::obs::CObservation2DRangeScan::Ptr observation)
Specialized updateState method used solely when dealing with 2DRangeScan information.
virtual void loadParams(const std::string &source_fname)
Load the necessary for the decider/optimizer configuration parameters.
constraint_t m_latest_odometry_PDF
Odometry rigid-body transformation since the last accepted LaserScan.
virtual void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
std::shared_ptr< CObservation3DRangeScan > Ptr
This class allows loading and storing values and vectors of different types from "....
mrpt::obs::CObservation2DRangeScan::Ptr m_curr_laser_scan2D
Current LaserScan.
static const std::string report_sep
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion)
This method load the options from a ".ini"-like file or memory-stored string list.
bool m_use_distance_node_reg
This base provides a set of functions for maths stuff.
bool registerNewNodeAtEnd()
Same goal as the previous method - uses the m_since_prev_node_PDF as the constraint at the end.
mrpt::system::CTimeLogger m_time_logger
Time logger instance.
GLsizei const GLchar ** string
unsigned short nIterations
The number of executed iterations until convergence.
ICP-based Fixed Intervals Node Registration.
pose_t m_last_odometry_only_pose
pose_t estimation using only odometry information.
std::string getStatsAsText(const size_t column_width=80) const
Dump all stats to a multi-line text string.
std::shared_ptr< CActionCollection > Ptr
std::shared_ptr< CPosePDF > Ptr
int m_times_used_ICP
How many times we used the ICP Edge instead of Odometry edge.
GLenum const GLfloat * params
double DEG2RAD(const double x)
Degrees to radians.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |