Main MRPT website > C++ reference for MRPT 1.5.6
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-2016, 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 { namespace graphslam { namespace detail {
16 
17 template<class GRAPH_T>
18 struct TNodeProps {
19  typename GRAPH_T::global_pose_t pose;
20  mrpt::obs::CObservation2DRangeScanPtr scan;
21 
23  this->pose = other.pose;
24  this->scan = other.scan;
25  return *this;
26  }
27 
28  void getAsString(std::string* str) const {
29  ASSERT_(str);
30  str->clear();
31  *str += mrpt::format("Pose: %s|\t", this->pose.asString().c_str());
32  if (this->scan.present()) {
33  *str += mrpt::format("Scan #%lu", this->scan->getScanSize());
34  }
35  else {
36  *str += "Scan: NONE";
37  }
38  *str += "\n";
39  }
41  std::string str;
42  this->getAsString(&str);
43  return str;
44  }
45 
46  friend std::ostream& operator<<(std::ostream& o, const TNodeProps& obj) {
47  o << obj.getAsString() << endl;
48  return o;
49  }
50 };
51 
52 } } } // end of namespaces
53 
54 #endif /* end of include guard: TNODEPROPS_H */
GRAPH_T::global_pose_t pose
Definition: TNodeProps.h:19
void getAsString(std::string *str) const
Definition: TNodeProps.h:28
friend std::ostream & operator<<(std::ostream &o, const TNodeProps &obj)
Definition: TNodeProps.h:46
GLsizei GLsizei GLuint * obj
Definition: glext.h:3902
std::string getAsString() const
Definition: TNodeProps.h:40
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
GLsizei const GLchar ** string
Definition: glext.h:3919
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TNodeProps operator=(const TNodeProps &other)
Definition: TNodeProps.h:22
#define ASSERT_(f)
mrpt::obs::CObservation2DRangeScanPtr scan
Definition: TNodeProps.h:20



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019