Object.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <string>
21 #include <iostream>
22 #include <sstream>
23 #include "Pose.hpp"
24 #include <boost/shared_ptr.hpp>
25 #include <boost/filesystem.hpp>
26 #include "Serializable.hpp"
27 
28 namespace ISM {
29 
33 class Object: public Serializable
34 {
35  public:
36  //All information about an object that results from estimation through object localization.
38  std::string type;
39  std::string observedId;
40  //Path to the mesh, used to visualize the estimated object.
41  boost::filesystem::path ressourcePath;
42  //Unnormalized and normalized rating how well this object estimate matches the searched scene.
43  double weight;
44  double confidence;
45  std::string providedBy;
46 
48  {
49  this->pose = PosePtr(new Pose());
50  };
51 
52  Object(const Object& other) : type(other.type), observedId(other.observedId), ressourcePath(other.ressourcePath),
53  weight(other.weight), confidence(other.confidence), providedBy(other.providedBy)
54  {
55  this->pose = PosePtr(new Pose(*other.pose));
56  };
57 
58  Object(const std::string type, const std::string observedId = "", const std::string ressourcePath = "", std::string providedBy = "") : type(type), observedId(observedId), ressourcePath(ressourcePath), weight(1), confidence(1), providedBy(providedBy)
59  {
60  this->pose = ISM::PosePtr(new ISM::Pose());
61  };
62 
63  Object(const std::string type, PosePtr pose, const std::string observedId = "", const std::string ressourcePath = "", std::string providedBy = "") :
64  pose(pose), type(type), observedId(observedId), ressourcePath(ressourcePath),
65  weight(1), confidence(1), providedBy(providedBy)
66  {};
67 
68  Object(std::string type, Pose* pose, std::string observedId = "", const std::string ressourcePath = "", std::string providedBy = "") :
69  type(type), observedId(observedId), ressourcePath(ressourcePath),
70  weight(1), confidence(1), providedBy(providedBy)
71  {
72  this->pose = PosePtr(pose);
73  };
74 
75  void serialize(std::ostream& strm) const;
76 
77  inline bool operator<(const Object& rhs) const
78  {
79  return this->type < rhs.type && this->observedId < rhs.observedId;
80  }
81 };
82 typedef boost::shared_ptr<Object> ObjectPtr;
83 
84 std::ostream& operator<<(std::ostream &strm, const ISM::Object &o);
85 std::ostream& operator<<(std::ostream &strm, const ISM::ObjectPtr &o);
86 }
Object(const Object &other)
Definition: Object.hpp:52
std::string observedId
Definition: Object.hpp:39
PosePtr pose
Definition: Object.hpp:37
Object(const std::string type, const std::string observedId="", const std::string ressourcePath="", std::string providedBy="")
Definition: Object.hpp:58
void serialize(std::ostream &strm) const
Definition: Object.cpp:30
std::ostream & operator<<(std::ostream &strm, const ISM::ObjectRelation &r)
boost::filesystem::path ressourcePath
Definition: Object.hpp:41
Object(std::string type, Pose *pose, std::string observedId="", const std::string ressourcePath="", std::string providedBy="")
Definition: Object.hpp:68
std::string type
Definition: Object.hpp:38
std::string providedBy
Definition: Object.hpp:45
boost::shared_ptr< Pose > PosePtr
Definition: Pose.hpp:79
double confidence
Definition: Object.hpp:44
this namespace contains all generally usable classes.
Object(const std::string type, PosePtr pose, const std::string observedId="", const std::string ressourcePath="", std::string providedBy="")
Definition: Object.hpp:63
boost::shared_ptr< Object > ObjectPtr
Definition: Object.hpp:82
bool operator<(const Object &rhs) const
Definition: Object.hpp:77
double weight
Definition: Object.hpp:43


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40