knowL: Knowledge Libraries
Loading...
Searching...
No Matches
GeoPose.h
1#pragma once
2
3#include <knowGIS/GeoPoint.h>
4
5#include "Pose.h"
6
7namespace knowGIS
8{
9 class GeoPose
10 {
11 public:
12 static GeoPose zero()
13 {
14 GeoPose p;
15 p.m_set = true;
16 return p;
17 }
18 GeoPose() : m_set(false) {}
19 GeoPose(const knowGIS::GeoPoint& _position, const Quaternion& _orientation)
20 : m_set(true), m_position(_position), m_orientation(_orientation)
21 {
22 }
23 ~GeoPose() {}
24 private:
25 GeoPose(const Pose& _pose)
26 : m_set(true), m_position(knowGIS::GeoPoint::from(_pose.position())),
27 m_orientation(_pose.orientation())
28 {
29 }
30 public:
31 static GeoPose from(const Pose& _pose) { return _pose; }
32 knowGIS::GeoPoint position() const { return m_position; }
33 Quaternion orientation() const { return m_orientation; }
34 bool operator==(const GeoPose& _rhs) const
35 {
36 return m_position == _rhs.m_position and m_orientation == _rhs.m_orientation;
37 }
38 Pose transform(const Cartography::CoordinateSystem& _coordinateSystem) const;
39 operator Pose() const;
43 bool isSet() const { return m_set; }
44 private:
45 bool m_set;
46 knowGIS::GeoPoint m_position;
47 Quaternion m_orientation;
48 };
49} // namespace knowGIS
50
51#include <knowCore/Formatter.h>
52clog_format_declare_formatter(knowGIS::GeoPose)
53{
54 return format_to(ctx.out(), "(pos: {} quat: {})", p.position(), p.orientation());
55}
56
57#include <knowCore/MetaType.h>
58KNOWCORE_DECLARE_FULL_METATYPE(knowGIS, GeoPose);
Definition GeoPoint.h:14
Definition GeoPose.h:10
bool isSet() const
Definition GeoPose.h:43
Definition Pose.h:10
Definition Quaternion.h:13