BB.Message.Sensor.Imu (bb v0.20.0)

Copy Markdown View Source

Inertial Measurement Unit data.

Fields

  • orientation - Orientation as BB.Math.Quaternion.t()
  • angular_velocity - Angular velocity as BB.Math.Vec3.t() in rad/s
  • linear_acceleration - Linear acceleration as BB.Math.Vec3.t() in m/s²

Optional uncertainty fields

Drivers with known noise characteristics may populate per-channel covariance matrices. Algorithms that consume them check for nil and either fall back to a configured default or refuse the reading. Mirrors the ROS sensor_msgs/Imu shape.

  • orientation_covariance - BB.Math.Covariance3.t() | nil

  • angular_velocity_covariance - BB.Math.Covariance3.t() | nil

  • linear_acceleration_covariance - BB.Math.Covariance3.t() | nil

Examples

alias BB.Message.Sensor.Imu
alias BB.Math.{Vec3, Quaternion}

{:ok, msg} = Imu.new(:imu_link,
  orientation: Quaternion.identity(),
  angular_velocity: Vec3.zero(),
  linear_acceleration: Vec3.new(0.0, 0.0, 9.81)
)

Summary

Types

t()

@type t() :: %BB.Message.Sensor.Imu{
  angular_velocity: BB.Math.Vec3.t(),
  angular_velocity_covariance: nil | BB.Math.Covariance3.t(),
  linear_acceleration: BB.Math.Vec3.t(),
  linear_acceleration_covariance: nil | BB.Math.Covariance3.t(),
  orientation: BB.Math.Quaternion.t(),
  orientation_covariance: nil | BB.Math.Covariance3.t()
}

Functions

new(frame_id, attrs)

@spec new(
  atom(),
  keyword()
) :: {:ok, BB.Message.t()} | {:error, term()}