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 
16 {
17 template <class GRAPH_T>
18 struct TNodeProps
19 {
20  typename GRAPH_T::global_pose_t pose;
22 
24  {
25  this->pose = other.pose;
26  this->scan = other.scan;
27  return *this;
28  }
29 
30  void getAsString(std::string* str) const
31  {
32  ASSERTDEB_(str);
33  str->clear();
34  *str += mrpt::format("Pose: %s|\t", this->pose.asString().c_str());
35  if (this->scan)
36  {
37  *str += mrpt::format("Scan #%lu", this->scan->getScanSize());
38  }
39  else
40  {
41  *str += "Scan: NONE";
42  }
43  *str += "\n";
44  }
46  {
47  std::string str;
48  this->getAsString(&str);
49  return str;
50  }
51 
52  friend std::ostream& operator<<(std::ostream& o, const TNodeProps& obj)
53  {
54  o << obj.getAsString() << endl;
55  return o;
56  }
57 };
58 }
59 #endif /* end of include guard: TNODEPROPS_H */
60 
61 
mrpt::obs::CObservation2DRangeScan::Ptr scan
Definition: TNodeProps.h:21
GRAPH_T::global_pose_t pose
Definition: TNodeProps.h:20
void getAsString(std::string *str) const
Definition: TNodeProps.h:30
friend std::ostream & operator<<(std::ostream &o, const TNodeProps &obj)
Definition: TNodeProps.h:52
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
std::string getAsString() const
Definition: TNodeProps.h:45
GLsizei const GLchar ** string
Definition: glext.h:4101
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
Definition: exceptions.h:205
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:16
TNodeProps operator=(const TNodeProps &other)
Definition: TNodeProps.h:23
Internal auxiliary classes.
Definition: levmarq_impl.h:17



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020