Struct ImuPacket

Inheritance Relationships

Base Type

Struct Documentation

struct ImuPacket : public ouster::sdk::core::Packet

Encapsulate an imu packet buffer and attributes associated with it.

Public Functions

ImuPacket()

Construct a new empty Imu Packet.

Deprecated:

Use ImuPacket(std::shared_ptr<PacketFormat>) instead. The last supported version for this will be 1.0.0 .

ImuPacket(int size)

Construct a new Imu packet with a pre-allocated size.

Deprecated:

Use ImuPacket(std::shared_ptr<PacketFormat>) instead. The last supported version for this will be 1.0.0 .

Parameters:

size[in] size in bytes to allocate

ImuPacket(std::shared_ptr<PacketFormat> format)

Construct a new Imu packet with a known format.

Parameters:

format[in] the packet format to use for parsing this packet.

inline auto sys_ts() const

Read system timestamp from the packet.

Only available in PROFILE_IMU_LEGACY, otherwise returns 0.

Returns:

system timestamp

inline auto accel_ts() const

Read accelerometer timestamp from the packet.

Only available in PROFILE_IMU_LEGACY, otherwise returns 0.

Returns:

accelerometer timestamp

inline auto gyro_ts() const

Read gyroscope timestamp from the packet.

Only available in PROFILE_IMU_LEGACY, otherwise returns 0.

Returns:

gyroscope timestamp

inline std::string nmea_sentence() const

Read NMEA sentence from an IMU buffer.

Only available in PROFILE_ACCEL32_GYRO32_NMEA.

Returns:

nmea sentence string

inline uint64_t nmea_ts() const

Read nmea timestamp from the packet.

Only available in PROFILE_ACCEL32_GYRO32_NMEA, otherwise returns 0.

Returns:

nmea timestamp

Eigen::Array<float, Eigen::Dynamic, 3> accel() const

Get acceleration reads from imu packet.

Returns:

2d array of accel readings in m/s^2

Eigen::Array<float, Eigen::Dynamic, 3> gyro() const

Get angular velocity reads from imu packet.

Returns:

2d array of angular velocity readings in rad/sec

Eigen::Array<uint16_t, Eigen::Dynamic, 1> status() const

Get status of reads from imu packet.

0x1 for valid. Always returns (1,1) array of 0x1 with UDPProfileIMU::LEGACY.

Returns:

1d array of statuses

Eigen::Array<uint64_t, Eigen::Dynamic, 1> timestamp() const

Get read timestamps from imu packet.

For UDPProfileIMU::LEGACY a (1,1) array representing gyro_ts is returned.

Returns:

1d array of timestamps

Eigen::Array<uint16_t, Eigen::Dynamic, 1> measurement_id() const

Get correlated measurement ids from imu packet.

For UDPProfileIMU::LEGACY a (1,1) array of 0 is returned.

Returns:

1d array of measurement ids

Public Static Attributes

static const PacketType MY_TYPE = PacketType::Imu

PacketType enum for this packet type.