SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
101 stars 84 forks source link

Question: How to use add_transform_check_dynamic_updates #344

Closed Navsea closed 2 months ago

Navsea commented 3 months ago

Hi,

We would like to dynamically change the transformation that is applied by the sick multiscan lidar sensor.

As I understand it, by default, you cannot change the add_transform_xyz_rpy once it is set at launch. When you set the add_transform_check_dynamic_updates parameter to true, I believe that it would listen for parameter updates of the "add_transform_xyz_rpy" parameter.

In the comments of the launch file it states: Note: dynamical updates of parameter add_transform_xyz_rpy can decrease the performance and is therefor deactivated by default

What causes this performance impact really? I would think that using ROS parameters would not have a big impact on the processing time. What impact can we expect? We would only update it every second at max for example.

Best regards, Kenneth

rostest commented 3 months ago

Thanks for your feedback. Your understanding is correct. To dynamically transform the published point clouds, the parameter add_transform_check_dynamic_updates must be set to true. This causes the transformation given by the parameter add_transform_xyz_rpy to be tracked and to reinitialize the setting after parameter changes. It may impact the processing time. The processing time depends on the system and CPU; if in doubt you can just set a pose using parameter add_transform_xyz_rpy, activate add_transform_check_dynamic_updates and check the cpu usage.

In general, we recommend publishing transform (TF) messages to provide ROS with static or dynamic transforms. Alternatively, you can use e.g. pcl_ros::transformPointCloud to transform a point cloud to another coordinate system. This is often more CPU efficient.

Navsea commented 3 months ago

Thanks you for the fast reply.

The reason we would like to use the dynamic updates iso TF's, is that we can offload one transformation to the CPU of the lidar iso having to do it on our platform.

We will check if the performance hit is too much for the lidar. Thanks again for the fast support!

BR, Kenneth

rostest commented 3 months ago

Thanks for further information. Please note that transformations given by parameter add_transform_xyz_rpy are computed by the driver, i.e. computed on the CPU running the sick_scan_xd.

Navsea commented 3 months ago

Oh, that makes sense. Then we'll go for that tf approach then. Thanks again 👍