Ros2LaserScanMessageImpl#
Fully qualified name: isaacsim::ros2::bridge::Ros2LaserScanMessageImpl
-
class Ros2LaserScanMessageImpl : public isaacsim::ros2::bridge::Ros2LaserScanMessage, private isaacsim::ros2::bridge::Ros2MessageInterfaceImpl#
Implementation of ROS 2 Laser Scan message.
Handles the creation and manipulation of sensor_msgs/msg/LaserScan messages, which contain 2D laser range finder data.
Public Functions
-
Ros2LaserScanMessageImpl()#
-
virtual ~Ros2LaserScanMessageImpl()#
-
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 writeHeader(
- const double timeStamp,
- const std::string &frameId,
Write the message header.
Sets the header fields in a ROS 2 LaserScan message.
- Parameters:
timeStamp – [in] Time (seconds).
frameId – [in] Transform frame with which this data is associated.
-
virtual void generateBuffers(const size_t buffSize) override#
Generate the buffers according to the LaserScan metadata.
It allocates memory for the range and intensities data.
- Parameters:
buffSize – [in] buffer size.
- virtual void writeData(
- const pxr::GfVec2f &azimuthRange,
- const float &rotationRate,
- const pxr::GfVec2f &depthRange,
- float horizontalResolution,
- float horizontalFov,
Sets the laser scan data.
- Parameters:
azimuthRange – [in] Min and max angles in degrees
rotationRate – [in] Scan frequency in Hz
depthRange – [in] Min and max range values
horizontalResolution – [in] Angular resolution in degrees
horizontalFov – [in] Horizontal field of view in degrees
-
inline std::vector<float> &getRangeData()#
Get the buffer (range data).
Provides direct access to the underlying buffer containing the range data.
- Returns:
Buffer.
-
inline std::vector<float> &getIntensitiesData()#
Get the buffer (intensities data).
Provides direct access to the underlying buffer containing the intensities data.
- Returns:
Buffer.
-
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.
-
Ros2LaserScanMessageImpl()#