Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Add ros_gz package #72

Closed
wants to merge 4 commits into from

Conversation

mkarklins
Copy link

@mkarklins mkarklins commented Jun 7, 2023

This adds the ros_gz package.

Was able to successfully build locally on macOS. Still want to run some tests with it to ensure it actually works.

Closes: #68

@Tobias-Fischer
Copy link
Contributor

Thanks for testing! Could you please also add on the other two platforms?

@Tobias-Fischer
Copy link
Contributor

Great. Let me know once you had a chance testing, and I’ll be happy to merge when you are.

@mkarklins
Copy link
Author

mkarklins commented Jun 7, 2023

Actually I'm struggling a bit here, perhaps you can help out a bit.

  • There already are ros_gz packages/sub-packages available in the channel e.g. This is the metapackage https://anaconda.org/robostack-staging/ros-humble-ros-gz and this is the subpackagehttps://anaconda.org/robostack-humble/ros-humble-ros-gz-bridge. The 4 at the end of version denotes that it's built against Gazebo Fortress - as such those don't work with Garden.
    It looks like there has been some work done with ros-gz-bridge: 54e6f48#diff-01cf59d037f2918a67ec2266654d50f98a671bacaa49aeb1ff0a76dc5548a86c -
    Wanted to understand where/how did these packages originate from?

  • When I try to build the ros_gz metapackage I noticed that during boa build it downloads the source code and checks it out to tag release/humble/ros_gz/0.244.11-1 - where the latest commit is Trimmed the branch to only the ros_gz sub directory, looks like that comes from the release tool: https://github.com/ros-infrastructure/bloom and that tag only contains 4 files from here: https://github.com/gazebosim/ros_gz/tree/ros2/ros_gz - ros_gz is a meta package. So, boa build doesn't do anything useful - you can see the build log here: https://github.com/RoboStack/ros-humble/actions/runs/5199049780/jobs/9381639707?pr=72#step:17:2478
    I suppose the question is - is there an example of how do you build metapackages, like this one?

  • To re-iterate if we want to build against Gazebo Garden we need to set the GZ_VERSION env variable to garden during compile time. You mentioned: By the way, I can’t recall how exactly vinca parses the package.xml, and I’m not sure if it would respect the environment variables. In the past I’ve simply remapped within the robostack.yaml /conda.yaml to whichever gazebo version I want. - I suppose I'm not exactly sure how to do that?

Sorry, for all of the questions. I'm quite eager to understand how this works and contribute, but I'm a bit over my head here :)

@mkarklins
Copy link
Author

@Tobias-Fischer I hope I understand correctly - the issue is that to install a "metapackage" a custom configuration is needed. I can't seem to find a previous example of such a package.

@traversaro
Copy link
Member

@Tobias-Fischer I hope I understand correctly - the issue is that to install a "metapackage" a custom configuration is needed. I can't seem to find a previous example of such a package.

I guess there is nothing special about metapackages, they just install their package.xml and other metadata files, and then they just depend on the other packages that actually contains something. See https://github.com/ros-planning/moveit2/blob/main/moveit/CMakeLists.txt for an example of a metapackage that seems to be working fine: https://anaconda.org/robostack-staging/ros-humble-moveit/files .

@mkarklins
Copy link
Author

I guess there is nothing special about metapackages, they just install their package.xml and other metadata files, and then they just depend on the other packages that actually contains something. See https://github.com/ros-planning/moveit2/blob/main/moveit/CMakeLists.txt for an example of a metapackage that seems to be working fine: https://anaconda.org/robostack-staging/ros-humble-moveit/files .

Hmm - if I look at the build log here: https://github.com/RoboStack/ros-humble/actions/runs/5290691692/job/14323454264?pr=72#step:15:713 - I don't see any of the source files or sub-packages being built. Looks like it's just building the meta files and that's it. Could it be that the GH actions pipeline needs to be updated?

@Tobias-Fischer
Copy link
Contributor

Hi @mkarklins - apologies for the confusion.

Now, by default, these packages pull in Fortress (see e.g. https://github.com/gazebosim/ros_gz/blob/4a5972bc6c1bcd2797a023ce934e6ef4d8e08de9/ros_gz_image/package.xml#L22-L23). As far as I know, there is no (easy?) way to pass GZ_VERSION to our vinca tool (I don't think we ever implemented these conditions).

  • The proper way would be to expand vinca to digest these conditions.
  • The hacky way is to look at the mappings. In the above example, ros-gz-image requests ignition-msgs8 and ignition-transport11. Internally, this is being mapped from ROS packages to conda-forge packages here:

    ros-humble/robostack.yaml

    Lines 136 to 163 in 8ff5757

    ignition-common4:
    robostack: [libignition-common4]
    ignition-cmake2:
    robostack: [libignition-cmake2]
    ignition-gazebo3:
    robostack: [libignition-gazebo5]
    ignition-gazebo5:
    robostack: [libignition-gazebo5]
    ignition-gazebo6:
    robostack: [libignition-gazebo6]
    ignition-gui5:
    robostack: [libignition-gui5]
    ignition-math6:
    robostack: [libignition-math6]
    ignition-msgs5:
    robostack: [libignition-msgs5]
    ignition-msgs8:
    robostack: [libignition-msgs8]
    ignition-msgs7:
    robostack: [libignition-msgs7]
    ignition-rendering5:
    robostack: [libignition-rendering5]
    ignition-transport8:
    robostack: [libignition-transport8]
    ignition-transport10:
    robostack: [libignition-transport10]
    ignition-transport11:
    robostack: [libignition-transport11]
  • We could remap e.g.

    ros-humble/robostack.yaml

    Lines 152 to 153 in 8ff5757

    ignition-msgs8:
    robostack: [libignition-msgs8]
    to the Garden version: gz-msgs9 which also exists on conda-forge (see https://github.com/gazebosim/ros_gz/blob/4a5972bc6c1bcd2797a023ce934e6ef4d8e08de9/ros_gz_image/package.xml#L17 and https://anaconda.org/search?q=gz-msgs). This remapping is done by simply changing the value to gz-msgs9 for key ignition-msgs8 in the robostack.yaml (and so forth for the other packages).
  • Once that's done, we would need to modify vinca to set the correct GZ_VERSION environment variable. We would need to modify https://github.com/RoboStack/vinca/blob/master/vinca/templates/build_ament_cmake.sh.in to check if the ROS_DISTRO is set to humble and then export GZ_VERSION="garden" which is picked up by cmake (see e.g. https://github.com/gazebosim/ros_gz/blob/humble/ros_gz_image/CMakeLists.txt).
  • Finally, the package would be ready to be rebuilt ;).

I understand it's quite an involved process, but each individual step should be quite straightforward. Unfortunately I currently don't have the capacity to do these steps myself, but I'd be happy to help out if you get stuck @mkarklins.

@mkarklins
Copy link
Author

Very much appreciated for your reply!

Unfortunately I currently don't have the capacity to do these steps myself, but I'd be happy to help out if you get stuck @mkarklins.

All good! I should be able to do this myself, will report back with progress.

@Tobias-Fischer
Copy link
Contributor

Tobias-Fischer commented Feb 29, 2024

We have this for most platforms now, and Windows is tracked in #68

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.

Package request: ros-humble-ros-gz
3 participants