PointCloudPublisher#
Fully qualified name: isaacsim::ros2::nodes::PointCloudPublisher
-
class PointCloudPublisher : public isaacsim::ros2::nodes::PublisherBase#
Standalone ROS 2 point cloud publisher that can be used from OmniGraph nodes or registered as a callback for SRTX frame delivery.
Lifecycle:
Construct
Call initialize() once
Call publishFromHost() / publishFromDevice() per frame
Call reset() or destroy
Public Functions
-
~PointCloudPublisher() override#
- bool prepareFromHost(
- const void *data,
- size_t dataSize,
- double timestamp,
- const PointCloudMetadata &metadata = {},
Fill the message from host (CPU) data without publishing.
- bool publishFromHost(
- const void *data,
- size_t dataSize,
- double timestamp,
- const PointCloudMetadata &metadata = {},
Convenience: prepareFromHost() + send().
- bool prepareFromDevice(
- const void *devicePtr,
- size_t bufferSize,
- double timestamp,
- int cudaDeviceIndex,
- const PointCloudMetadata &metadata = {},
Fill the message from CUDA device memory without publishing.
- bool publishFromDevice(
- const void *devicePtr,
- size_t bufferSize,
- double timestamp,
- int cudaDeviceIndex,
- const PointCloudMetadata &metadata = {},
Convenience: prepareFromDevice() + send().
-
virtual void reset() override#
Release ROS 2 resources and reset the publisher to an uninitialized state.
- inline isaacsim::ros2::core::Ros2PointCloudMessage *getPointCloudMessage(
Access to the underlying message for fill-from-host flows that need generateBuffer + fillPointCloudBufferHost. Used by OgnROS2PublishPointCloud.
-
inline const std::string &getFrameId() const#
Get the TF frame ID stamped into published messages.
- bool initialize(
- const std::string &nodeName,
- const std::string &namespaceName,
- const std::string &topicName,
- const std::string &frameId,
- uint64_t queueSize,
- const std::string &qosProfile,
- uint64_t context = 0,
One-time ROS 2 setup. Calls onCreateMessage() to create the message, then creates the publisher. Safe to call multiple times (no-op after first).
-
void send()#
Publish the message that was previously filled by a prepare() call. Thread-safe: can be called from a background task after prepare() completes.
-
inline bool isInitialized() const#
Return true if the publisher has been successfully initialized.
Protected Functions
-
virtual const void *onCreateMessage() override#
Override to create the ROS 2 message. Return the type-support handle pointer (from message->getTypeSupportHandle()). Store the typed message in a member of the derived class.
- inline virtual isaacsim::ros2::core::Ros2Message *getMessagePtr(
Override to return the concrete message pointer for send().
-
bool shouldPublish() const#
Returns false when there are no subscribers and publish_without_verification is off.
Protected Attributes
-
isaacsim::ros2::core::Ros2Bridge *m_ros2Bridge = nullptr#
Cached bridge singleton.
-
isaacsim::ros2::core::Ros2Factory *m_factory = nullptr#
Cached factory from the bridge.
-
std::shared_ptr<isaacsim::ros2::core::Ros2ContextHandle> *m_contextHandle = nullptr#
ROS 2 context handle.
-
std::shared_ptr<isaacsim::ros2::core::Ros2NodeHandle> m_nodeHandle#
ROS 2 node handle.
-
std::shared_ptr<isaacsim::ros2::core::Ros2Publisher> m_publisher#
Underlying ROS 2 publisher.
-
std::string m_frameId#
TF frame ID stamped into published messages.
-
bool m_publishWithoutVerification = false#
When true, publish even with no subscribers.