ros kinetic, ubuntu 16.04, gazebo 7, intera 5.2 (for sawyer robot), kinect camera in simulation.
trying to transform pointcloud from kinect frame to base from of a sawyer robot. i've coded for this inside another void function that estimates the normals for each point in a point cloud.
trying to use `transformPointCloud` from `/tf`. code compiles properly, but i get the error in the title of the question.
This is the code i'm using.
tf::TransformListener listener;
tf::StampedTransform transform;
// Perform point cloud transformation
listener.lookupTransform("/right_arm_base_link", "/depth_link", ros::Time(0), transform); // based on line 129 /tf/tf.h
pcl::PointCloud::Ptr trans_cloud (new pcl::PointCloud);
pcl_ros::transformPointCloud("/right_arm_base_link", *cloud_with_normals, *trans_cloud, listener); // based on line 131 /pcl_ros/transforms.h
// Publish transformed point cloud
sensor_msgs::PointCloud2 ros_trans_out;
pcl::toROSMsg( *trans_cloud, ros_trans_out);
tf_pub.publish (ros_trans_out);
`*cloud_with_normals` is of type `PointCloud2` and is my point cloud in. `*trans_cloud` is my point cloud out, also `PointCloud2`. the goal is to be able to publish the transformed point cloud to a rostopic (publisher has been omitted from the question). my concern is that `right_arm_base_link` is not being recognised, but it appears in the transformation tree when i used `$ rostopic echo /tf`.
I can also use the following to determine the actual transformation between `right_arm_base_link` and `depth_link`:
$ rosrun tf tf_echo right_arm_base_link depth_link
and it will yield:
At time 2358.846
- Translation: [0.547, 0.183, 0.017]
- Rotation: in Quaternion [-0.081, 0.701, 0.080, 0.704]
in RPY (radian) [-0.336, 1.567, -0.108]
in RPY (degree) [-19.257, 89.763, -6.202]
At time 2359.846
- Translation: [0.547, 0.183, 0.017]
- Rotation: in Quaternion [-0.081, 0.701, 0.080, 0.704]
in RPY (radian) [-0.335, 1.567, -0.107]
in RPY (degree) [-19.206, 89.763, -6.146]
can anyone suggest what i'm doing wrong or how to fix this issue? i will provide more detail if and when needed.
Thanks in advance!
~ Luke
↧