bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::sensors::IMUMessage Struct Reference

Models a message from an inertial measurement unit with a three axis accelerometer and a three axis gyroscope: More...

#include <imu.h>

Inheritance diagram for bitsim::sensors::IMUMessage:
Collaboration diagram for bitsim::sensors::IMUMessage:

Static Public Member Functions

static std::optional< IMUMessage > parse (const std::string &msg)
Static Public Member Functions inherited from bitsim::sensors::MessageBase
static auto unix_seconds_since_epoch (std::chrono::system_clock::time_point point)
static auto unix_milliseconds_since_epoch (std::chrono::system_clock::time_point point)
static std::chrono::system_clock::time_point parse_utc_timestamp (const std::string &ts)

Public Attributes

std::array< real_t, 3 > accel {0.0, 0.0, 0.0}
std::array< real_t, 3 > gyro {0.0, 0.0, 0.0}
Public Attributes inherited from bitsim::sensors::MessageBase
std::chrono::system_clock::time_point source_timestamp
std::chrono::system_clock::time_point received_timestamp {std::chrono::system_clock::now()}

Detailed Description

Models a message from an inertial measurement unit with a three axis accelerometer and a three axis gyroscope:

{"accel": [0.12, -0.03, 9.79], "gyro": [0.001, -0.002, 0.35]}

accel is the specific force [m/s^2]: what the accelerometer measures, the acceleration minus gravity, so 9.81 up at rest. gyro is the angular velocity [rad/s]. Both are along the axes of the IMU. timestamp, in UTC, is optional.

Member Function Documentation

◆ parse()

std::optional< IMUMessage > bitsim::sensors::IMUMessage::parse ( const std::string & msg)
static
Returns
The message, or nothing if the text is not a valid message

Member Data Documentation

◆ accel

std::array<real_t, 3> bitsim::sensors::IMUMessage::accel {0.0, 0.0, 0.0}

◆ gyro

std::array<real_t, 3> bitsim::sensors::IMUMessage::gyro {0.0, 0.0, 0.0}

The documentation for this struct was generated from the following files: