ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
There are four things you'll need to change. The creation of the listener will need to be this:
tf2_ros::Buffer tfBuffer(ros::Duration(10));
tf2_ros::TransformListener tfListener(tfBuffer);
You'll have to pass the tfBuffer
object to the transformPoint
function instead of the listener object.
The transform point operation can be done using the transform method of the buffer object:
tfBuffer.transform("base_link", laser_point, base_point);
Finally the type of the exception object will need to be changed to:
catch (tf2::TransformException &ex)
...
Hope this helps.
2 | No.2 Revision |
There are four things you'll need to change. The creation of the listener will need to be this:
tf2_ros::Buffer tfBuffer(ros::Duration(10));
tf2_ros::TransformListener tfListener(tfBuffer);
You'll have to pass the tfBuffer
object to the transformPoint
function instead of the listener object.
The transform point operation can be done using the transform method of the buffer object:
tfBuffer.transform("base_link", laser_point, base_point);
Finally the type of the exception object will need to be changed to:
catch (tf2::TransformException &ex)
...
Hope this helps.
UPDATE :
3 things, if you look carefully there are a few differences between your new code and what I suggested.
TransformException
should be tf2
not tf2_ros
transform
not transformPoint
.