Class JointStateMsg
ROS sensor_msgs/JointState message.
Implements
Inherited Members
Namespace: Unity.SimulationPro.Foundation.SensorMessages
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
[Serializable]
public class JointStateMsg : IMessage
Constructors
JointStateMsg()
Initializes a new instance with default values.
Declaration
public JointStateMsg()
JointStateMsg(HeaderMsg, string[], double[], double[], double[])
Initializes a new instance with default values.
Declaration
public JointStateMsg(HeaderMsg header, string[] name, double[] position, double[] velocity, double[] effort)
Parameters
| Type | Name | Description |
|---|---|---|
| HeaderMsg | header | ROS message header containing timestamp and coordinate frame identifier. |
| string[] | name | Identifying name or label. |
| double[] | position | Position in 3D space. |
| double[] | velocity | The velocity. |
| double[] | effort | Array of torque or force values applied at each joint. |
Fields
effort
Effort field.
Declaration
public double[] effort
Field Value
| Type | Description |
|---|---|
| double[] |
header
This is a message that holds data to describe the state of a set of torque controlled joints. The state of each joint (revolute or prismatic) is defined by:
- the position of the joint (rad or m),
- the velocity of the joint (rad/s or m/s) and
- the effort that is applied in the joint (Nm or N). Each joint is uniquely identified by its name The header specifies the time at which the joint states were recorded. All the joint states in one message have to be recorded at the same time. This message consists of a multiple arrays, one for each part of the joint state. The goal is to make each of the fields optional. When e.g. your joints have no effort associated with them, you can leave the effort array empty. All arrays in this message should have the same size, or be empty. This is the only way to uniquely associate the joint name with the correct states.
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/JointState"
Field Value
| Type | Description |
|---|---|
| string |
name
Name field.
Declaration
public string[] name
Field Value
| Type | Description |
|---|---|
| string[] |
position
Position field.
Declaration
public double[] position
Field Value
| Type | Description |
|---|---|
| double[] |
velocity
Velocity field.
Declaration
public double[] velocity
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 JointStateMsg from the given deserializer.
Declaration
public static JointStateMsg Deserialize(IMessageDeserializer deserializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageDeserializer | deserializer | The deserializer. |
Returns
| Type | Description |
|---|---|
| JointStateMsg | A new JointStateMsg 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. |