Class ImuMsg
ROS sensor_msgs/Imu message.
Implements
Inherited Members
Namespace: Unity.SimulationPro.Foundation.SensorMessages
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
[Serializable]
public class ImuMsg : IMessage
Constructors
ImuMsg()
Initializes a new instance with default values.
Declaration
public ImuMsg()
ImuMsg(HeaderMsg, QuaternionMsg, double[], Vector3Msg, double[], Vector3Msg, double[])
Initializes a new instance with the specified values.
Declaration
public ImuMsg(HeaderMsg header, QuaternionMsg orientation, double[] orientation_covariance, Vector3Msg angular_velocity, double[] angular_velocity_covariance, Vector3Msg linear_acceleration, double[] linear_acceleration_covariance)
Parameters
| Type | Name | Description |
|---|---|---|
| HeaderMsg | header | ROS message header containing timestamp and coordinate frame identifier. |
| QuaternionMsg | orientation | Orientation expressed as a quaternion. |
| double[] | orientation_covariance | Row-major 3×3 covariance matrix for orientation uncertainty. |
| Vector3Msg | angular_velocity | Angular velocity measured by the IMU. |
| double[] | angular_velocity_covariance | Row-major 3×3 covariance matrix for angular velocity. |
| Vector3Msg | linear_acceleration | Linear acceleration measured by the IMU. |
| double[] | linear_acceleration_covariance | Row-major 3×3 covariance matrix for linear acceleration. |
Fields
angular_velocity
Row major about x, y, z axes
Declaration
public Vector3Msg angular_velocity
Field Value
| Type | Description |
|---|---|
| Vector3Msg |
angular_velocity_covariance
Angular velocity covariance field.
Declaration
public double[] angular_velocity_covariance
Field Value
| Type | Description |
|---|---|
| double[] |
header
This is a message to hold data from an IMU (Inertial Measurement Unit) Accelerations should be in m/s^2 (not in g's), and rotational velocity should be in rad/sec If the covariance of the measurement is known, it should be filled in (if all you know is the variance of each measurement, e.g. from the datasheet, just put those along the diagonal) A covariance matrix of all zeros will be interpreted as "covariance unknown", and to use the data a covariance will have to be assumed or gotten from some other source If you have no estimate for one of the data elements (e.g. your IMU doesn't produce an orientation estimate), please set element 0 of the associated covariance matrix to -1 If you are interpreting this message, please check for a value of -1 in the first element of each covariance matrix, and disregard the associated estimate.
Declaration
public HeaderMsg header
Field Value
| Type | Description |
|---|---|
| HeaderMsg |
k_MessageTypeId
Identifier for this message type.
Declaration
public static readonly MessageTypeId k_MessageTypeId
Field Value
| Type | Description |
|---|---|
| MessageTypeId |
k_MessageTypeName
The ROS message type name string used for serialization and topic matching.
Declaration
public const string k_MessageTypeName = "sensor_msgs/Imu"
Field Value
| Type | Description |
|---|---|
| string |
linear_acceleration
Row major about x, y, z axes
Declaration
public Vector3Msg linear_acceleration
Field Value
| Type | Description |
|---|---|
| Vector3Msg |
linear_acceleration_covariance
Linear acceleration covariance field.
Declaration
public double[] linear_acceleration_covariance
Field Value
| Type | Description |
|---|---|
| double[] |
orientation
Orientation field.
Declaration
public QuaternionMsg orientation
Field Value
| Type | Description |
|---|---|
| QuaternionMsg |
orientation_covariance
Orientation covariance field.
Declaration
public double[] orientation_covariance
Field Value
| Type | Description |
|---|---|
| double[] |
Properties
MessageTypeId
Gets the unique runtime identifier for this message type.
Declaration
public MessageTypeId MessageTypeId { get; }
Property Value
| Type | Description |
|---|---|
| MessageTypeId |
MessageTypeName
Gets the ROS message type name for this message.
Declaration
public string MessageTypeName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Deserialize(IMessageDeserializer)
Deserializes a ImuMsg from the given deserializer.
Declaration
public static ImuMsg Deserialize(IMessageDeserializer deserializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageDeserializer | deserializer | The deserializer. |
Returns
| Type | Description |
|---|---|
| ImuMsg | A new ImuMsg instance. |
Register()
Registers this message type with the MessageTypeRegistry.
Declaration
[InitializeOnLoadMethod]
public static void Register()
ToString()
Returns a human-readable string representation of this message.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of this instance. |
Overrides
WriteTo(IMessageSerializer)
Serializes this message to the given serializer.
Declaration
public void WriteTo(IMessageSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageSerializer | serializer | The serializer. |