Ros2CompressedImageMessage#

Fully qualified name: isaacsim::ros2::core::Ros2CompressedImageMessage

class Ros2CompressedImageMessage : public isaacsim::ros2::core::Ros2Message#

Class implementing a sensor_msgs/msg/CompressedImage message.

Provides functionality to write ROS 2 CompressedImage messages that contain compressed image data (e.g., H264, HEVC encoded bitstreams).

Subclassed by isaacsim::ros2::core::Ros2CompressedImageMessageImpl

Public Functions

virtual void writeHeader(
const double timeStamp,
const std::string &frameId,
) = 0#

Write the message header.

Sets the header fields in a ROS 2 CompressedImage message.

Parameters:
  • timeStamp – [in] Time (seconds).

  • frameId – [in] Transform frame with which this data is associated.

virtual void writeData(
const uint8_t *data,
size_t dataSize,
const std::string &format,
) = 0#

Write the compressed image data.

Sets the format and data fields in a ROS 2 CompressedImage message.

Parameters:
  • data – [in] Pointer to the compressed image data (e.g., H264 bitstream).

  • dataSize – [in] Size of the data in bytes.

  • format – [in] Compression format string (e.g., “h264”, “hevc”, “jpeg”).

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.

virtual const void *getTypeSupportHandle() = 0#

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.

Protected Attributes

void *m_msg = nullptr#

Message pointer.