Ros2PointCloudMessageImpl#

Fully qualified name: isaacsim::ros2::core::Ros2PointCloudMessageImpl

class Ros2PointCloudMessageImpl : public isaacsim::ros2::core::Ros2PointCloudMessage, private isaacsim::ros2::core::Ros2MessageInterfaceImpl#

Implementation of ROS 2 Point Cloud message.

Handles the creation and manipulation of sensor_msgs/msg/PointCloud2 messages, which contain 3D point cloud data with customizable fields.

Public Functions

Ros2PointCloudMessageImpl()#
virtual ~Ros2PointCloudMessageImpl()#
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 generateBuffer(
const double &timeStamp,
const std::string &frameId,
const size_t &bufferSize,
float *intensityPtr,
uint64_t *timestampPtr,
uint32_t *emitterIdPtr,
uint32_t *channelIdPtr,
uint32_t *materialIdPtr,
uint32_t *tickIdPtr,
pxr::GfVec3f *hitNormalPtr,
pxr::GfVec3f *velocityPtr,
uint32_t *objectIdPtr,
uint8_t *echoIdPtr,
uint8_t *tickStatePtr,
float *radialVelocityMSPtr,
)#

Allocates and initializes the point cloud message buffer.

Parameters:
  • timeStamp – [in] Time in seconds

  • frameId – [in] Frame ID for the point cloud

  • bufferSize – [in] Size of the point cloud data buffer in bytes

  • intensityPtr – [in] Pointer to the intensity data

  • timestampPtr – [in] Pointer to the timestamp data

  • emitterIdPtr – [in] Pointer to the emitter ID data

  • channelIdPtr – [in] Pointer to the channel ID data

  • materialIdPtr – [in] Pointer to the material ID data

  • tickIdPtr – [in] Pointer to the tick ID data

  • hitNormalPtr – [in] Pointer to the normal data

  • velocityPtr – [in] Pointer to the velocity data

  • objectIdPtr – [in] Pointer to the object ID data

  • echoIdPtr – [in] Pointer to the echo ID data

  • tickStatePtr – [in] Pointer to the tick states data

  • radialVelocityMSPtr – [in] Pointer to the radial velocity data

inline void *getBufferPtr()#

Get the pointer to the buffer (data).

Provides direct access to the underlying buffer containing the point cloud data.

Returns:

Pointer to the buffer.

inline size_t getTotalBytes() const#

Get the total size (width * point_step) of the buffer, in bytes.

Returns the total size of the point cloud buffer in bytes.

Returns:

Buffer size.

inline size_t getNumPoints() const#

Get the number of points.

Returns the number of points in the point cloud.

Returns:

Number of points.

inline size_t getPointStep() const#

Get the point step.

Returns the point step in the point cloud.

Returns:

Point step.

inline const std::vector<std::tuple<void*, size_t, size_t>> &getOrderedFields(
) const#

Get the ordered list of metadata pointers and corresponding offsets.

Returns the ordered list of metadata pointers, size of their type in bytes, and corresponding offsets.

Returns:

Ordered list of metadata pointers, size of their type in bytes, and corresponding offsets.

inline void setUsePinnedBuffer(bool usePinnedBuffer)#

Set whether to use the pinned buffer for the message data.

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.

Public Static Attributes

static constexpr std::array<size_t, 9> s_kPointFieldTypeSizes = {0, sizeof(int8_t), sizeof(uint8_t), sizeof(int16_t), sizeof(uint16_t), sizeof(int32_t), sizeof(uint32_t), sizeof(float), sizeof(double)}#

PointField type sizes.

Maps from anonymous enums in sensor_msgs/msg/PointField to the actual size of the type.

Protected Attributes

isaacsim::core::includes::GenericBuffer m_bufferPinned#

Buffer (data) in pinned host memory.

std::vector<uint8_t> m_buffer#

Buffer (data) in unpinned host memory.

size_t m_totalBytes = {0}#

Buffer size.

size_t m_pointStep = {0}#

Point step.

size_t m_numPoints = {0}#

Number of points.

std::vector<std::tuple<void*, size_t, size_t>> m_orderedFields#

Ordered list of metadata pointers, size of their type in bytes, and corresponding offsets.

bool m_usePinnedBuffer = {false}#

Whether to use the pinned buffer for the message data.

void *m_msg = nullptr#

Message pointer.