ArduPilot / ardupilot_gazebo

Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers
GNU Lesser General Public License v3.0
81 stars 76 forks source link

Gazebo: support Gazebo Harmonic and Garden #66

Closed srmainwaring closed 8 months ago

srmainwaring commented 8 months ago

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

Testing

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

Ryanf55 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

@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 commented 8 months ago

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 commented 8 months ago

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