Does transforming a pointcloud message from one frame to another result in the change of frame id of the transformed message?

asked 2021-07-01 16:18:24 -0500

Vignesh_93 gravatar image

updated 2021-07-01 16:21:10 -0500

ROS Enthusiasts

While working with transforming different pointcloud data from one frame to another I observed that the frame id of the final transformed message remains the same as that of the parent message. It just fomented my curious as the final frame id should have been changed to the frame id of the transformed frame. Is my understanding correct about the transformations ?

The way I am observing the transformed message is by publishing the new message as a pointcloud data. When we echo the topic, the metadata related to the frame id is still the same.

edit retag flag offensive close merge delete

Comments

I think you need to tell us exactly "how" you do the transformation... In general, I'd agree that when transforming data from one frame to the other, the frame_id should be changed.

mgruhler gravatar image mgruhler  ( 2021-07-05 02:26:09 -0500 )edit

The way I am doing is listening to the transform with the help of a tf::TransformListener object and then transform the pointcloud using the pcl_ros library. In short the code is given below:

try{
        transform_listener.lookupTransform("base_link", "base_radar_link", ros::Time(0), transform);
    }
    catch (tf::TransformException ex){
        ROS_ERROR("%s",ex.what());
    }

"base_link" is my target frame and "base_radar_link" is the sensor frame. and then

pcl_ros::transformPointCloud(*temp_cloud, *cloud_transformed, transform);

where temp_cloud is the source of the type point cloud and cloud_transformed is the final transformed data of the type point cloud. I will be transforming cloud_transformed message to pointcloud2 sensor data type as that is what I am interested in. Hope it is clear

Vignesh_93 gravatar image Vignesh_93  ( 2021-07-05 05:46:55 -0500 )edit