Skip to content

Conversation

@bastinat0r
Copy link

I reintroduced the tf2_geometry_msgs python package to be installed, as it seems to work now.

@clalancette
Copy link
Contributor

Are you sure that this works now? As far as I know, PyKDL hasn't been ported to ament/ROS 2, so I don't think this will work out-of-the-box.

@bastinat0r
Copy link
Author

Well I did not test in depth, but I needed the functionality and I figured it would at least be useful to create a pull request for other people with the same problem.
I wanted to convert a PoseStamped into the right coordinate frame and did not find out how to work around the missing package. At least in my use case the tf2_geometry_msgs provides the functionality to do it directly. However, I really just did the one thing until now.

@clalancette
Copy link
Contributor

Well I did not test in depth, but I needed the functionality and I figured it would at least be useful to create a pull request for other people with the same problem.

Right, but as far as I can tell, the script would immediately fail to import PyKDL (https://github.com/ros2/geometry2/blob/ros2/tf2_geometry_msgs/scripts/test.py#L5). So I'm not quite sure what functionality you are currently depending on. Can you give more information about your environment and what you are doing?

@bastinat0r
Copy link
Author

I am currently working on this planning code. Interestingly I can import PyKDL, the following snippet shows how I convert the pose (self.goal is of type PoseStamped)

        goal = Pose2D()
        try:
            x = self.tfBuffer.transform(self.goal, self.reference_frame)
            goal.x = x.pose.position.x
            goal.y = x.pose.position.y
            goal.theta = yaw_from_orientation(x.pose.orientation)

            self.get_logger().debug(f"got the following for goal position: {goal}")
        except Exception as e: 
            self.get_logger().info(f"Exception in goal transformation {e}")

@clalancette
Copy link
Contributor

Interestingly I can import PyKDL

Are you using a mixed ROS 1/ROS 2 environment? Can you run your python interpreter, and then run:

import PyKDL
print(PyKDL.__file__)

@bastinat0r
Copy link
Author

Interestingly I can import PyKDL

Are you using a mixed ROS 1/ROS 2 environment? Can you run your python interpreter, and then run:

import PyKDL
print(PyKDL.__file__)

/usr/lib/python3/dist-packages/PyKDL.cpython-38-x86_64-linux-gnu.so
I installed a fresh ubuntu and I have installed python3-pykdl with apt.

@clalancette
Copy link
Contributor

I installed a fresh ubuntu and I have installed python3-pykdl with apt.

Oh, that's interesting. I didn't know that package was available in the upstream Ubuntu apt repositories.

The trouble here is that mixing the system installed version of PyKDL with our vendored copy of orocos_kdl is dangerous. If the ABI changes, then it will start crashing and will be tough to debug. That leaves us with two options:

  1. Stick with our vendored copy of orocos_kdl, and re-enable python_orocos_kdl (here). This guarantees that they match, and continues to work on all platforms (including Windows).
  2. Use the apt version of both orocos_kdl and python_orocos_kdl. This also guarantees they match, and doesn't require us to build it anymore. But if we go this route, we need to figure out how to continue to make this work on Windows, which generally involves building a "choco" package for it.

Both options have their pluses and minuses. The first option is probably the easiest for now, but the second one is attractive because it reduces our maintenance burden.

@MikeHallettUK
Copy link

Can anyone get python tf2_geometry_msgs (+ PyKDL) working on Intel WINDOWS 10 please ? for NOETIC (and eventually ROS2).

I have it working on WINDOWS 10 in MELODIC... and on Ubuntu with NOETIC... but it currently crashes with PyKDL message in WINDOWS 10 for NOETIC.

Thanks

@dawsonc
Copy link

dawsonc commented Jun 3, 2022

Hi!

Has there been any progress towards enabling the tf2_geometry_msgs python package? #509 appears to have been merged; would that allow installing tf2_geometry_msgs without the PyKDL dependency?

Thanks!

@clalancette
Copy link
Contributor

Has there been any progress towards enabling the tf2_geometry_msgs python package? #509 appears to have been merged; would that allow installing tf2_geometry_msgs without the PyKDL dependency?

Actually, yes. With #509 in, we actually no longer need this one, so I'll close this out.

@clalancette clalancette closed this Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants