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



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020