CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
twist.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 twist contains a linear and angular velocity.
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 Twist {
31 Vector3d linear = {0, 0, 0};
32
36 Vector3d angular = {0, 0, 0};
37
41 auto operator<=>(const Twist& other) const = default;
42};
43
44NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Twist, linear, angular)
45
46
49struct TwistWithCovariance : public Twist {
56
60 auto operator<=>(const TwistWithCovariance& other) const = default;
61};
62
63NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(TwistWithCovariance, linear, angular, covariance)
64
65
68struct TwistStamped : public Twist {
72 creos::RobotClock::time_point timestamp;
73
77 std::string frame_id;
78
82 auto operator<=>(const TwistStamped& other) const = default;
83};
84
85NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(TwistStamped, linear, angular, timestamp, frame_id)
86
87
94 creos::RobotClock::time_point timestamp;
95
99 std::string frame_id;
100
104 auto operator<=>(const TwistWithCovarianceStamped& other) const = default;
105};
106
107NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(TwistWithCovarianceStamped, linear, angular, covariance, timestamp)
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
The Twist message contains the linear and angular velocity of the robot.
Definition twist.hpp:27
Vector3d linear
Linear velocity of the robot in the world frame [m/s].
Definition twist.hpp:31
Vector3d angular
Angular velocity of the robot in the world frame [rad/s].
Definition twist.hpp:36
auto operator<=>(const Twist &other) const =default
Compare two Twist messages.
The TwistStamped message contains the linear and angular velocity of the robot with a timestamp.
Definition twist.hpp:68
creos::RobotClock::time_point timestamp
Timestamp of the estimated linear and angular velocity.
Definition twist.hpp:72
std::string frame_id
Frame id of the twist.
Definition twist.hpp:77
auto operator<=>(const TwistStamped &other) const =default
Compare two TwistStamped messages.
The TwistWithCovariance message contains the linear and angular velocity of the robot with a covarian...
Definition twist.hpp:49
Matrixd< 6, 6 > covariance
Covariance matrix of the pose The covariance matrix is a 6x6 matrix with the following order: [x,...
Definition twist.hpp:55
auto operator<=>(const TwistWithCovariance &other) const =default
Compare two TwistWithCovariance messages.
The TwistWithCovarianceStamped message contains the linear and angular velocity of the robot with a c...
Definition twist.hpp:90
auto operator<=>(const TwistWithCovarianceStamped &other) const =default
Compare two TwistWithCovarianceStamped messages.
std::string frame_id
Frame id of the twist.
Definition twist.hpp:99
creos::RobotClock::time_point timestamp
Timestamp of the estimated linear and angular velocity.
Definition twist.hpp:94
Vector3d message containing a x, y and z of type double.
Definition generic.hpp:48