Robotics StackExchange | Archived questions

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

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.

Asked by Vignesh_93 on 2021-07-01 16:18:24 UTC

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.

Asked by mgruhler on 2021-07-05 02:26:09 UTC

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

Asked by Vignesh_93 on 2021-07-05 05:46:55 UTC

Answers