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

Gazebo: support Gazebo Harmonic and Garden #66

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

srmainwaring
Copy link
Collaborator

Add support for Gazebo Harmonic retaining the default support for Gazebo Garden. The version used is controlled by the environment variable GZ_VERSION which should be either garden or harmonic. If not set the default is to assume garden.

Details

  • Use the same approach for versioning used in ros_gz.
  • Update package.xml and CMakeLists.txt to handle either garden or harmonic.
  • Add missing gz-msg headers that cause compilation to fail in Harmonic.

Testing

Tested on macOS Ventura with Harmonic built from source and running the Iris quadcopter example.

@srmainwaring srmainwaring added the enhancement New feature or request label Dec 16, 2023
@srmainwaring srmainwaring self-assigned this Dec 16, 2023
@srmainwaring srmainwaring requested review from khancyr, Clouded and Ryanf55 and removed request for Clouded December 16, 2023 21:48
- Update package.xml and cmake to handle both versions.
- Add gz msg include dependencies.
- Update README.
- Fix CI - switch include order.

Signed-off-by: Rhys Mainwaring <[email protected]>
CMakeLists.txt Outdated Show resolved Hide resolved
- Remove duplicate code and report error for invalid GZ_VERSION.

Signed-off-by: Rhys Mainwaring <[email protected]>

<!-- Harmonic -->
<depend condition="$GZ_VERSION == harmonic">gz-cmake3</depend>
<depend condition="$GZ_VERSION == harmonic">gz-sim8</depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this known to not work?

rryan@B650-970:~/Dev/ros2_ws/src/ardupilot_gazebo$ rosdep install --from-paths . --ignore-src
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
ardupilot_gazebo: Cannot locate rosdep definition for [gz-sim8]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully they fix it at some point.

@Ryanf55
Copy link
Contributor

Ryanf55 commented Dec 18, 2023

I tried using harmonic in ardupilot_gz, but robot state publisher crashes.

https://github.com/ArduPilot/ardupilot_gz?tab=readme-ov-file#2-launch-the-simulation

[robot_state_publisher-6] [ERROR] [1702871715.500489068] [sdformat_urdf]: Failed to find sdf canonical link [base_link]
[robot_state_publisher-6] Failed to parse robot description using: sdformat_urdf_plugin/SDFormatURDFParser
[robot_state_publisher-6] terminate called after throwing an instance of 'std::runtime_error'
[robot_state_publisher-6]   what():  Unable to initialize urdf::model from robot description

@Ryanf55
Copy link
Contributor

Ryanf55 commented Dec 18, 2023

Also, when trying to build this with colcon in a fresh ros2 workspace, I get the following after building everything in ros2_gz.repos

ryan@B650-970:~/Dev/tmp_ws$ . install/setup.bash
not found: "/home/ryan/Dev/tmp_ws/install/ardupilot_gazebo/share/ardupilot_gazebo/local_setup.bash"

@srmainwaring
Copy link
Collaborator Author

I tried using harmonic in ardupilot_gz, but robot state publisher crashes.

Did not run into this issue when testing on macOS. I'll need to look at an Ubuntu VM install, but this doesn't look like a problem with this plugin?

@srmainwaring
Copy link
Collaborator Author

srmainwaring commented Dec 18, 2023

Also, when trying to build this with colcon in a fresh ros2 workspace, I get the following after building everything in ros2_gz.repos

ryan@B650-970:~/Dev/tmp_ws$ . install/setup.bash
not found: "/home/ryan/Dev/tmp_ws/install/ardupilot_gazebo/share/ardupilot_gazebo/local_setup.bash"

Cannot replicate in macOS:

% ls ./install/ardupilot_gazebo/share/ardupilot_gazebo
cmake			local_setup.sh		package.sh
config			local_setup.zsh		package.xml
environment		models			package.zsh
hook			package.bash		worlds
local_setup.bash	package.dsv
local_setup.dsv		package.ps1
% gz sim --version
Gazebo Sim, version 8.0.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

Edit - this is not expected to work - ros2_gz.repos is pulling in the ros2 branch - which has not been updated, This change is targeting main. We'll forward port to ros2 once this is merged.

  ardupilot_gazebo:
    type: git
    url: https://github.com/ArduPilot/ardupilot_gazebo.git
    version: ros2

@srmainwaring
Copy link
Collaborator Author

@Ryanf55 - there may be issues with the Harmonic dependencies and packaging on Ubuntu, can we deal with these in a follow up as I don't think they are driven by this change, which does not alter the default behaviour in any case.

The main check for this plugin is the standalone ArduPilot SITL / Gazebo iris quadcopter test, which does not depend on ROS at all. If that is working then I think the other issues should be followed up in the respective repos.

@Ryanf55
Copy link
Contributor

Ryanf55 commented Dec 18, 2023

Also, when trying to build this with colcon in a fresh ros2 workspace, I get the following after building everything in ros2_gz.repos

ryan@B650-970:~/Dev/tmp_ws$ . install/setup.bash
not found: "/home/ryan/Dev/tmp_ws/install/ardupilot_gazebo/share/ardupilot_gazebo/local_setup.bash"

Cannot replicate in macOS:

% ls ./install/ardupilot_gazebo/share/ardupilot_gazebo
cmake			local_setup.sh		package.sh
config			local_setup.zsh		package.xml
environment		models			package.zsh
hook			package.bash		worlds
local_setup.bash	package.dsv
local_setup.dsv		package.ps1
% gz sim --version
Gazebo Sim, version 8.0.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

Edit - this is not expected to work - ros2_gz.repos is pulling in the ros2 branch - which has not been updated, This change is targeting main. We'll forward port to ros2 once this is merged.

  ardupilot_gazebo:
    type: git
    url: https://github.com/ArduPilot/ardupilot_gazebo.git
    version: ros2

Yea, that was after checking out this PR branch in ardupilot_gazebo, leaving everything else the same.

@srmainwaring
Copy link
Collaborator Author

Thanks for the review @Ryanf55. There are a few follow up changes to AP repos to fully support Harmonic and some upstream:

@srmainwaring srmainwaring merged commit d03dca4 into ArduPilot:main Dec 18, 2023
3 checks passed
@srmainwaring srmainwaring deleted the prs/pr-harmonic branch December 18, 2023 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants