RTX Lidar ROS2 Publication Frequency with RtxLidarROS2PublishPointCloudBuffer

Good afternoon,

I am using Isaac Sim 2023.1.1 to simulate a robot with a lidar sensor.

At the end of this topic, Publishing rate of RTX lidar - #10 by marc2002, is mentioned that RtxLidarScanBuffer should “hold an up to date buffer at the Hz of the lidar”. Knowing that, I was expecting RtxLidarROS2PublishPointCloudBuffer publishing the full 360 degrees pointcloud at the Hz of the lidar, which in the Example_Rotary config file is 10 Hz.

However it publishes the data at each render step. For example if I have a physics dt of 1/60 and the same rendering dt, the pointcloud is published at 60 Hz. While if I have a physics dt of 1/60 and a rendering dt of 3/60, the pointcloud is published at 15 Hz.

So if I want to publish the pointcloud at 10 Hz, as a workaround, I can set the render dt to 6/60. That is a strong limitation for all the other sensors (e.g. cameras), since with that rendering dt is not possible to publish at 30 Hz.

Is there a way to force RtxLidarROS2PublishPointCloudBuffer to publish the pointcloud at the lidar frequency?

The code I am using is the following:

# create the rtx lidar sensor that generates data into "RtxSensorCpu"
_, rtx_lidar_sensor = omni_kit_commands.execute(
    translation = (0, 0, 0.0),
    orientation = Gf.Quatd(1, 0.0, 0.0, 0.0),  # Gf.Quatd is w,i,j,k

# RTX sensors are cameras and must be assigned to their own render product
rtx_lidar_hydra_texture = rep.create.render_product(rtx_lidar_sensor.GetPath(), [1, 1], name="Isaac")


# create pointcloud publisher pipeline in the post process graph
rtx_lidar_writer = rep.writers.get("RtxLidar" + "ROS2PublishPointCloudBuffer")
rtx_lidar_writer.initialize(frameId=frame_id, nodeNamespace=node_namespace, topicName=topic_name,)

Thank you in advance.

It published each render step. But it keeps the full buffer up to date by adding that frame into the buffer where it belongs.

We don’t have an option to only publish when the last of the buffer was filled, but you maybe be able to put an optional publish in python to just do every 3rd frame or whatever you know would be the publish rate for a full scan.

If you do that, watch out for pause/play issues, where things are paused and started again at non-frame boundaries. That should work for a scripted run though.

Thank you for the clarification.

Is there absolutly no possibility to publish only when the last of the buffer is filled? From my point of view, publishing at each render step or at a fixed frequency, different from the one of the lidar, is not interesting because of the redundancy of the data. Indeed, in these cases or you receive the exactly same pointcloud multiple times (when the dt is very low) or a pointcloud with only some parts changed.

Regarding the python publisher, where can I put it?