Transform PointCloud2 doesn't work as expected
I tried to transform my pointcloud2 in python like stated here.
But somehow the result is not correct. I am not able to visualize the pointcloud I get as a result in rviz. This is why I tried to just use an empty transformation on my pointcloud and I get some different cloud as a result. Does anyone know what I am doing wrong?
Thanks!
from tf2_sensor_msgs.tf2_sensor_msgs import do_transform_cloud def transform_pointcloud(self, pointcloud): trans = TransformStamped() trans.header.stamp = pointcloud.header.stamp trans.header.frame_id = pointcloud.header.frame_id trans.header.seq = pointcloud.header.seq trans.child_frame_id = "corner" trans.transform.translation.x = 0 trans.transform.translation.y = 0 trans.transform.translation.z = 0 trans.transform.rotation.x = 0 trans.transform.rotation.y = 0 trans.transform.rotation.z = 0 trans.transform.rotation.w = 0 newpointcloud = do_transform_cloud(pointcloud, trans) return newpointcloud