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-2017, 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  ASSERT_(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::obs::CObservation2DRangeScan::Ptr scan
Definition: TNodeProps.h:25
GRAPH_T::global_pose_t pose
Definition: TNodeProps.h:24
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void getAsString(std::string *str) const
Definition: TNodeProps.h:34
friend std::ostream & operator<<(std::ostream &o, const TNodeProps &obj)
Definition: TNodeProps.h:56
std::shared_ptr< CObservation2DRangeScan > Ptr
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
std::string getAsString() const
Definition: TNodeProps.h:49
GLsizei const GLchar ** string
Definition: glext.h:4101
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TNodeProps operator=(const TNodeProps &other)
Definition: TNodeProps.h:27
#define ASSERT_(f)



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019