Ros2JointStateMessageImpl#

Fully qualified name: isaacsim::ros2::core::Ros2JointStateMessageImpl

class Ros2JointStateMessageImpl : public isaacsim::ros2::core::Ros2JointStateMessage, private isaacsim::ros2::core::Ros2MessageInterfaceImpl#

Implementation of ROS 2 Joint State message.

Handles the creation and manipulation of sensor_msgs/msg/JointState messages, which contain robot joint positions, velocities, and efforts.

Public Functions

Ros2JointStateMessageImpl()#
virtual ~Ros2JointStateMessageImpl()#
virtual const void *getTypeSupportHandle()#

Gets the type support handle for the message.

Returns a pointer to the ROS IDL message type support data structure. The actual type depends on the message category:

  • Topic: rosidl_message_type_support_t

  • Service: rosidl_service_type_support_t

  • Action: rosidl_action_type_support_t

Returns:

Pointer to the type support structure or nullptr.

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,
)#

Sets the joint state data.

Parameters:
  • timeStamp – [in] Time in seconds

  • articulation – [in] Pointer to articulation view

  • stage – [in] USD stage pointer

  • jointPositions – [in] Vector of joint positions

  • jointVelocities – [in] Vector of joint velocities

  • jointEfforts – [in] Vector of joint efforts

  • dofTypes – [in] Vector of DOF types

  • stageUnits – [in] Stage unit scale factor

virtual void writeData(
const double &timeStamp,
const std::vector<std::string> &jointNames,
const std::vector<double> &jointPositions,
const std::vector<double> &jointVelocities,
const std::vector<double> &jointEfforts,
const std::vector<uint8_t> &dofTypes,
double stageMetersPerUnit,
)#

Sets the joint state data from arrays (no articulation/stage).

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

Reads the joint state data.

Parameters:
  • jointNames – [out] Vector of joint names

  • jointPositions – [out] Array of joint positions

  • jointVelocities – [out] Array of joint velocities

  • jointEfforts – [out] Array of joint efforts

  • timeStamp – [out] Time in seconds

virtual size_t getNumJoints()#

Gets the number of joints in the message.

Returns:

size_t Number of joints

virtual bool checkValid()#

Validates the joint state message.

Returns:

bool True if the message is valid

inline void *getPtr()#

Retrieves the message pointer.

Returns the pointer to the underlying ROS 2 message if it has been properly created and initialized.

Note

This method does not perform type checking - the caller is responsible for proper casting to the appropriate message type.

Returns:

Pointer to the message or nullptr if not initialized.

Protected Attributes

void *m_msg = nullptr#

Message pointer.