Location.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <optional>
5 #include <string>
6 
7 #include <SimoxUtility/shapes/OrientedBox.h>
8 
11 
13 {
14  enum class LocationType
15  {
18  };
19 
20  struct LocationId
21  {
22  std::string source;
23  std::string name;
24 
25  LocationId(const std::string& s, const std::string& n) : source(s), name(n)
26  {
27  }
28 
29  std::string toString() const;
30  };
31 
32  struct Location
33  {
36  std::optional<Names> names;
37 
38  Location(const LocationId& i,
39  const LocationType t,
40  const std::optional<Names>& names = std::nullopt) :
41  id(i), type(t), names(names)
42  {
43  }
44 
45  virtual ~Location() = default;
46  };
47 
48  struct FramedLocation : public Location
49  {
50  std::string frame;
51  std::string agent;
53 
55  const LocationType type,
56  const std::string& frame,
57  const std::string& agent,
58  const Eigen::Matrix4f& pose,
59  const std::optional<Names>& names = std::nullopt) :
61  {
62  }
63 
64  virtual ~FramedLocation() = default;
65 
67  };
68 
70  {
71  Eigen::Vector3f extents;
72 
74  const LocationType type,
75  const std::string& frame,
76  const std::string& agent,
77  const Eigen::Matrix4f& pose,
78  const Eigen::Vector3f& extents,
79  const std::optional<Names>& names = std::nullopt) :
81  {
82  }
83 
84  virtual ~FramedBoxedLocation() = default;
85 
87  };
88 
89  using FramedBoxedLocationPtr = std::unique_ptr<FramedBoxedLocation>;
90  using FramedLocationPtr = std::unique_ptr<FramedLocation>;
91  using LocationPtr = std::unique_ptr<Location>;
92 
93 } // namespace armarx::priorknowledge::util
armarx::priorknowledge::util::LocationType
LocationType
Definition: Location.h:14
armarx::priorknowledge::util::FramedBoxedLocationPtr
std::unique_ptr< FramedBoxedLocation > FramedBoxedLocationPtr
Definition: Location.h:89
armarx::priorknowledge::util::LocationId
Definition: Location.h:20
armarx::FramedPose
The FramedPose class.
Definition: FramedPose.h:258
armarx::priorknowledge::util::FramedLocation::frame
std::string frame
Definition: Location.h:50
armarx::priorknowledge::util::FramedLocation::pose
Eigen::Matrix4f pose
Definition: Location.h:52
armarx::priorknowledge::util::LocationId::toString
std::string toString() const
Definition: Location.cpp:10
armarx::priorknowledge::util::FramedBoxedLocation
Definition: Location.h:69
armarx::priorknowledge::util::FramedLocation::agent
std::string agent
Definition: Location.h:51
armarx::priorknowledge::util::Location::Location
Location(const LocationId &i, const LocationType t, const std::optional< Names > &names=std::nullopt)
Definition: Location.h:38
armarx::priorknowledge::util::FramedLocationPtr
std::unique_ptr< FramedLocation > FramedLocationPtr
Definition: Location.h:90
armarx::priorknowledge::util::FramedBoxedLocation::FramedBoxedLocation
FramedBoxedLocation(const LocationId &id, const LocationType type, const std::string &frame, const std::string &agent, const Eigen::Matrix4f &pose, const Eigen::Vector3f &extents, const std::optional< Names > &names=std::nullopt)
Definition: Location.h:73
armarx::priorknowledge::util::LocationType::FRAMED_BOXED_LOCATION
@ FRAMED_BOXED_LOCATION
armarx::priorknowledge::util::FramedLocation::FramedLocation
FramedLocation(const LocationId &id, const LocationType type, const std::string &frame, const std::string &agent, const Eigen::Matrix4f &pose, const std::optional< Names > &names=std::nullopt)
Definition: Location.h:54
armarx::priorknowledge::util::FramedLocation::toFramedPose
armarx::FramedPose toFramedPose()
FramedPose.h
armarx::priorknowledge::util::Location::names
std::optional< Names > names
Definition: Location.h:36
armarx::priorknowledge::util::FramedBoxedLocation::~FramedBoxedLocation
virtual ~FramedBoxedLocation()=default
armarx::priorknowledge::util::FramedLocation::~FramedLocation
virtual ~FramedLocation()=default
armarx::priorknowledge::util::Location::type
LocationType type
Definition: Location.h:35
armarx::priorknowledge::util::FramedLocation
Definition: Location.h:48
armarx::priorknowledge::util::Location::~Location
virtual ~Location()=default
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::priorknowledge::util::LocationPtr
std::unique_ptr< Location > LocationPtr
Definition: Location.h:91
armarx::priorknowledge::util::LocationId::name
std::string name
Definition: Location.h:23
simox::OrientedBox
Definition: ice_conversions.h:18
armarx::priorknowledge::util::LocationId::LocationId
LocationId(const std::string &s, const std::string &n)
Definition: Location.h:25
armarx::priorknowledge::util::Location
Definition: Location.h:32
armarx::priorknowledge::util::FramedBoxedLocation::extents
Eigen::Vector3f extents
Definition: Location.h:71
Names.h
armarx::priorknowledge::util::LocationType::FRAMED_LOCATION
@ FRAMED_LOCATION
armarx::priorknowledge::util
Definition: AffordanceLoader.cpp:6
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::priorknowledge::util::FramedBoxedLocation::toOrientedBox
simox::OrientedBox< float > toOrientedBox()
armarx::priorknowledge::util::LocationId::source
std::string source
Definition: Location.h:22
armarx::priorknowledge::util::Location::id
LocationId id
Definition: Location.h:34