MRPT  1.9.9
TNodeProps.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 #include <string>
13 
15 {
16 template <class GRAPH_T>
17 struct TNodeProps
18 {
19  typename GRAPH_T::global_pose_t pose;
21 
23  {
24  this->pose = other.pose;
25  this->scan = other.scan;
26  return *this;
27  }
28 
29  void getAsString(std::string* str) const
30  {
31  ASSERTDEB_(str);
32  str->clear();
33  *str += mrpt::format("Pose: %s|\t", this->pose.asString().c_str());
34  if (this->scan)
35  {
36  *str += mrpt::format("Scan #%lu", this->scan->getScanSize());
37  }
38  else
39  {
40  *str += "Scan: NONE";
41  }
42  *str += "\n";
43  }
45  {
46  std::string str;
47  this->getAsString(&str);
48  return str;
49  }
50 
51  friend std::ostream& operator<<(std::ostream& o, const TNodeProps& obj)
52  {
53  o << obj.getAsString() << std::endl;
54  return o;
55  }
56 };
57 } // namespace mrpt::graphslam::detail
mrpt::obs::CObservation2DRangeScan::Ptr scan
Definition: TNodeProps.h:20
GRAPH_T::global_pose_t pose
Definition: TNodeProps.h:19
std::string std::string format(std::string_view fmt, ARGS &&... args)
Definition: format.h:26
void getAsString(std::string *str) const
Definition: TNodeProps.h:29
friend std::ostream & operator<<(std::ostream &o, const TNodeProps &obj)
Definition: TNodeProps.h:51
GLsizei GLsizei GLuint * obj
Definition: glext.h:4085
std::string getAsString() const
Definition: TNodeProps.h:44
GLsizei const GLchar ** string
Definition: glext.h:4116
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
Definition: exceptions.h:190
TNodeProps operator=(const TNodeProps &other)
Definition: TNodeProps.h:22
Internal auxiliary classes.
Definition: levmarq_impl.h:19



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 6e6d28d09 Wed Nov 13 18:58:42 2019 +0100 at miƩ nov 13 19:00:09 CET 2019