transform pose in tf2
Ubuntu 18.04
ROS2 Eloquent (installed by binaries)
I am trying to transform a PoseStamped
in the target frame in python.
Below would how my code look like:
import tf2_geometry_msgs
from geometry_msgs.msg import PoseStamped
.
.
.
target_pose_s = self.tf_buffer.transform(self.pose_s, target_frame)
In this case, I get module not found error:
ModuleNotFoundError: No module named 'tf2_geometry_msgs'
I think it is looking for the tf2_geometry_msgs.py
file, which is not installed for ROS2 on my system. But I can see this for melodic.
/opt/ros/melodic/lib/python2.7/dist-packages/tf2_geometry_msgs/tf2_geometry_msgs.py
(it exists in the eloquent branch though)
In this issue, which was addressed in this PR the setup.py
was said to be "unused". Also here is marked that Python support doesn't exist yet, though catkin_python_setup()
shouldn't be needed for ROS2 anymore?
If I comment out tf2_geometry_msgs
, I get the error
tf2_ros.buffer_interface.TypeException: Type <class 'geometry_msgs.msg._pose_stamped.PoseStamped'> if not loaded or supported
What am I missing here? Or is it that transform(PoseStamped, "target_frame")
function not supported yet in Python?