CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
imu.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 23
11 * Author: Robbert-Jan de Jager
12 *
13 * Implementation of the imu message.
14 ****************************************************************************/
15#pragma once
16
17#include <array>
18#include <creos/enum.hpp>
19#include <creos/robot_clock.hpp>
20#include <nlohmann/json.hpp>
21
22#include "generic.hpp"
23
24namespace creos_messages {
25
29struct Imu {
30
34 creos::RobotClock::time_point timestamp;
35
39 std::string frame_id;
40
44 Quaternionf orientation = {0, 0, 0, 1};
45
50
55
60
65
70
74 auto operator<=>(const Imu& other) const = default;
75};
76
77NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Imu, timestamp, orientation, orientation_covariance, angular_velocity,
78 angular_velocity_covariance, linear_acceleration, linear_acceleration_covariance);
79
83enum class ImuId {
84 kBody,
85};
86
87} // namespace creos_messages
88
89DEFINE_ENUM_STRING_CONVERSIONS(creos_messages::ImuId, {{creos_messages::ImuId::kBody, "body"}})
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
ImuId
IMU sensor id.
Definition imu.hpp:83
@ kBody
IMU sensor on the body of the robot.
IMU message containing the orientation, angular velocity and linear acceleration.
Definition imu.hpp:29
Matrixf< 3, 3 > linear_acceleration_covariance
the covariance matrix of the linear acceleration. Row major about x, y, z
Definition imu.hpp:69
Matrixf< 3, 3 > angular_velocity_covariance
the covariance matrix of the angular velocity. Row major about x, y, z
Definition imu.hpp:59
Vector3f linear_acceleration
Linear acceleration in the order (x, y, z) [m/s^2].
Definition imu.hpp:64
std::string frame_id
Frame id of the IMU message.
Definition imu.hpp:39
Vector3f angular_velocity
Angular velocity in the order (x, y, z) [rad/s].
Definition imu.hpp:54
Quaternionf orientation
Orientation quaternion in the order (x, y, z, w)
Definition imu.hpp:44
creos::RobotClock::time_point timestamp
Timestamp of the IMU message.
Definition imu.hpp:34
auto operator<=>(const Imu &other) const =default
Compare two IMU messages.
Matrixf< 3, 3 > orientation_covariance
the covariance matrix of the orientation. Row major about x, y, z
Definition imu.hpp:49
Quaternion message containing the x, y, z and w components as floats.
Definition generic.hpp:97
Vector3f message containing a x, y and z of type float.
Definition generic.hpp:64