CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
pose.hpp
1// Copyright (C) 2024 Avular Holding B.V. - All Rights Reserved
2// You may use this code under the terms of the Avular
3// Software End-User License Agreement.
4//
5// You should have received a copy of the Avular
6// Software End-User License Agreement license with
7// this file, or download it from: avular.com/eula
8//
9/*****************************************************************************
10 * Created on: 2024 July 17
11 * Author: Robbert-Jan de Jager
12 *
13 * @file The pose contains a position and orientation.
14 ****************************************************************************/
15#pragma once
16
17#include <array>
18#include <creos/messages/generic.hpp>
19#include <creos/robot_clock.hpp>
20#include <nlohmann/json.hpp>
21
22namespace creos_messages {
23
27struct Pose {
31 Point position = {0, 0, 0};
32
36 Quaterniond orientation = {0, 0, 0, 1};
37
41 auto operator<=>(const Pose& other) const = default;
42};
43
44NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Pose, position, orientation)
45
46
49struct PoseWithCovariance : public Pose {
56
60 auto operator<=>(const PoseWithCovariance& other) const = default;
61};
62
63NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(PoseWithCovariance, position, orientation, covariance)
64
65
72 creos::RobotClock::time_point timestamp;
73
77 std::string frame_id;
78
82 auto operator<=>(const PoseWithCovarianceStamped& other) const = default;
83};
84
85NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(PoseWithCovarianceStamped, timestamp, position, orientation, covariance)
86
87
90struct PoseStamped : public Pose {
94 creos::RobotClock::time_point timestamp;
95
99 std::string frame_id;
100
104 auto operator<=>(const PoseStamped& other) const = default;
105};
106
107NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(PoseStamped, timestamp, position, orientation)
108
109} // namespace creos_messages
Matrix template for a 2D array of type T.
Definition generic.hpp:115
The messages that are used in the communication between the agent and the client.
Definition accel.hpp:22
Point message containing a x, y and z of type double.
Definition generic.hpp:32
The Pose message contains a position and orientation.
Definition pose.hpp:27
Quaterniond orientation
Orientation of the robot in the world frame.
Definition pose.hpp:36
Point position
Position of the robot in the world frame.
Definition pose.hpp:31
auto operator<=>(const Pose &other) const =default
Compare two Pose messages.
The PoseStamped message contains a position and orientation with a timestamp.
Definition pose.hpp:90
auto operator<=>(const PoseStamped &other) const =default
Compare two PoseStamped messages.
creos::RobotClock::time_point timestamp
Timestamp of the estimated position and orientation.
Definition pose.hpp:94
std::string frame_id
Frame id of the estimated position and orientation.
Definition pose.hpp:99
The PoseWithCovariance message contains a position and orientation with a covariance matrix.
Definition pose.hpp:49
Matrixd< 6, 6 > covariance
Covariance matrix of the pose The covariance matrix is a 6x6 matrix with the following order: [x,...
Definition pose.hpp:55
auto operator<=>(const PoseWithCovariance &other) const =default
Compare two PoseWithCovariance messages.
The PoseWithCovarianceStamped message contains a position and orientation with a covariance matrix an...
Definition pose.hpp:68
auto operator<=>(const PoseWithCovarianceStamped &other) const =default
Compare two PoseWithCovarianceStamped messages.
std::string frame_id
Frame id of the estimated position and orientation.
Definition pose.hpp:77
creos::RobotClock::time_point timestamp
Timestamp of the estimated position and orientation.
Definition pose.hpp:72
Quaternion message containing the x, y, z and w components as doubles.
Definition generic.hpp:80