Ros2JointStateMessage#

Fully qualified name: isaacsim::ros2::bridge::Ros2JointStateMessage

class Ros2JointStateMessage : public isaacsim::ros2::bridge::Ros2Message#

Class implementing a sensor_msgs/msg/JointState message.

Public Functions

virtual void writeData(
const double &timeStamp,
omni::physics::tensors::IArticulationView *articulation,
pxr::UsdStageWeakPtr stage,
std::vector<float> &jointPositions,
std::vector<float> &jointVelocities,
std::vector<float> &jointEfforts,
std::vector<uint8_t> &dofTypes,
const double &stageUnits,
) = 0#

Write the message field values from the given arguments.

Parameters:
  • timeStamp – Time (seconds).

  • articulation – Articulation handler.

  • stage – USD stage.

  • jointPositions – Joint positions.

  • jointVelocities – Joint velocities.

  • jointEfforts – Joint efforts.

  • dofTypes – Articulation DOF types.

  • stageUnits – Unit scale of the stage.

virtual void readData(
std::vector<char*> &jointNames,
double *jointPositions,
double *jointVelocities,
double *jointEfforts,
double &timeStamp,
) = 0#

Read the message field values.

The size of the arrays to store the joint positions, velocities, and efforts must be equal to the number of joints (see Ros2JointStateMessage::getNumJoints) of the message before calling this method.

Parameters:
  • jointNames – Joint names.

  • jointPositions – Joint positions.

  • jointVelocities – Joint velocities.

  • jointEfforts – Joint efforts.

  • timeStamp – Time (seconds).

virtual size_t getNumJoints() = 0#

Get the number of joints in the message.

The size of the name field array is used as the number of joints.

Returns:

Number of joints.

virtual bool checkValid() = 0#

Check that the message field arrays (joint names, positions, velocities, and efforts) have the same size.

Returns:

Whether the message field arrays have the same size.

inline void *getPtr()#

Get the message pointer.

Returns:

The pointer to the message if it has been created and initialized properly, otherwise nullptr.

virtual const void *getTypeSupportHandle() = 0#

Get the pointer to the struct that contains the ROS IDL message type support data.

The pointer points to a ROS IDL struct if the message if founded.

Message type

ROS IDL struct

Topic (Message)

rosidl_message_type_support_t

Service

rosidl_service_type_support_t

Action

rosidl_action_type_support_t

Returns:

The pointer to the struct, otherwise nullptr.

Protected Attributes

void *m_msg = nullptr#

Message pointer.