Main MRPT website > C++ reference for MRPT 1.9.9
TNodeProps.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef TNODEPROPS_H
10 #define TNODEPROPS_H
11 
13 #include <string>
14 
15 namespace mrpt
16 {
17 namespace graphslam
18 {
19 namespace detail
20 {
21 template <class GRAPH_T>
22 struct TNodeProps
23 {
24  typename GRAPH_T::global_pose_t pose;
26 
28  {
29  this->pose = other.pose;
30  this->scan = other.scan;
31  return *this;
32  }
33 
34  void getAsString(std::string* str) const
35  {
36  ASSERTDEB_(str);
37  str->clear();
38  *str += mrpt::format("Pose: %s|\t", this->pose.asString().c_str());
39  if (this->scan)
40  {
41  *str += mrpt::format("Scan #%lu", this->scan->getScanSize());
42  }
43  else
44  {
45  *str += "Scan: NONE";
46  }
47  *str += "\n";
48  }
50  {
51  std::string str;
52  this->getAsString(&str);
53  return str;
54  }
55 
56  friend std::ostream& operator<<(std::ostream& o, const TNodeProps& obj)
57  {
58  o << obj.getAsString() << endl;
59  return o;
60  }
61 };
62 }
63 }
64 } // end of namespaces
65 
66 #endif /* end of include guard: TNODEPROPS_H */
mrpt::graphslam::detail::TNodeProps::getAsString
std::string getAsString() const
Definition: TNodeProps.h:49
mrpt::graphslam::detail::TNodeProps::pose
GRAPH_T::global_pose_t pose
Definition: TNodeProps.h:24
obj
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
mrpt::graphslam::detail::TNodeProps::getAsString
void getAsString(std::string *str) const
Definition: TNodeProps.h:34
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::graphslam::detail::TNodeProps::scan
mrpt::obs::CObservation2DRangeScan::Ptr scan
Definition: TNodeProps.h:25
mrpt::format
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:16
mrpt::graphslam::detail::TNodeProps::operator<<
friend std::ostream & operator<<(std::ostream &o, const TNodeProps &obj)
Definition: TNodeProps.h:56
mrpt::obs::CObservation2DRangeScan::Ptr
std::shared_ptr< CObservation2DRangeScan > Ptr
Definition: CObservation2DRangeScan.h:58
mrpt::graphslam::detail::TNodeProps::operator=
TNodeProps operator=(const TNodeProps &other)
Definition: TNodeProps.h:27
ASSERTDEB_
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
Definition: exceptions.h:205
string
GLsizei const GLchar ** string
Definition: glext.h:4101
CObservation2DRangeScan.h
mrpt::graphslam::detail::TNodeProps
Definition: TNodeProps.h:22



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