MRPT  2.0.1
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-2020, 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  }
44  std::string getAsString() const
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
std::string getAsString() const
Definition: TNodeProps.h:44
#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 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020