ifm / ifm3d-ros

ifm pmd-based 3D ToF Camera ROS Package
Apache License 2.0
40 stars 40 forks source link

Remove added substring from point cloud frame_id #41

Open marip8 opened 3 years ago

marip8 commented 3 years ago

Currently the driver sets the frame_id of the published point cloud equal to the specified frame_id_base parameter plus the substring _link. The nodelet.launch file then creates a static transform publisher from this link to the optical frame. This is problematic when using the IFM in the context of an existing URDF (i.e. IFM mounted to a robot):

These issues result in both visualization errors in Rviz and transformation errors when using TF to transform the cloud.

This PR changes the driver and launch file to use the specified frame_id_base parameter directly as the frame_id of the point cloud itself. This change resolves the two issues described above and maintains the current functionality in the case that the IFM is launched by itself.

graugans commented 3 years ago

Hey @marip8 thanks for your contribution, @desengph will take care of this.

desengph commented 3 years ago

Hi @marip8, we can't easily change this naming of the frame_id_base due to legacy reasons, as there is existing code that relies on the link suffix.

We would suggest that you might use a no-op transformation to the frame you need, to integrate the camera into your URDF (if you can't change it). E. g.:

rosrun tf static_transform_publisher 0 0 0 0 0 0 YOUR_CAMERA_FRAME ifm3d/camera_link 100