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

Support launching gazebo sim to visualize vehicle #2

Closed
5 of 6 tasks
Ryanf55 opened this issue Mar 22, 2023 · 4 comments
Closed
5 of 6 tasks

Support launching gazebo sim to visualize vehicle #2

Ryanf55 opened this issue Mar 22, 2023 · 4 comments
Assignees

Comments

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Mar 22, 2023

  • Works with ROS2 Humble
  • Works with Gazebo Garden
  • If you launch sitl with copter, a copter shows up in gazebo
  • If you launch sitl with a plane, a plane shows up in gazebo
  • If you move the vehicle in sitl, it moves in gazebo
  • Each vehicle has an attached camera output with a corresponding ros2 camera topic
@Ryanf55 Ryanf55 moved this to 🆕 New in DDS/ROS2 Mar 22, 2023
@Ryanf55 Ryanf55 added this to DDS/ROS2 Mar 22, 2023
@Ryanf55 Ryanf55 moved this from 🆕 New to 📋 Backlog in DDS/ROS2 Apr 5, 2023
@srmainwaring
Copy link
Collaborator

There is an initial version of a bring-up package for an ArduPilot / microROS DDS / ROS 2 / Gazebo system here:

The system can be brought up by a single launch file:

ros2 launch ardupilot_gz_bringup bringup_iris.launch.py

Run a interactive MAVProxy session:

mavproxy.py --console --map

The topics published by ArduPilot may be inspected with:

ros2 topic list
/ROS2_BatteryState0
/ROS2_NavSatFix0
/ROS2_Time
/clicked_point
/clock
/goal_pose
/initialpose
/iris/odometry
/joint_states
/parameter_events
/robot_description
/rosout
/tf
/tf_static

@srmainwaring
Copy link
Collaborator

srmainwaring commented Apr 16, 2023

Moved code to new repo: srmainwaring#1

Docker image

Notes for running the ardupilot_gz packages on the docker image Dockerfile_dev-ros.

The image is configured for CI and requires additional packages to be used with Gazebo (in server only mode).

Summary

  • Install Gazebo Garden.
  • Install libsdformat12-dev.
  • Install rapidjson-dev.
  • Install libgflags-dev, ros-humble-ament-cmake-mypy, ros-humble-image-transport, ros-humble-image-transport-plugins.

Details

Install gz-garden and libsdformat12-dev

sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null

sudo apt-get update
sudo apt-get install gz-garden
sudo apt install libsdformat12-dev

Install dependencies for ardupilot_gazebo

sudo apt install rapidjson-dev

Install dependencies for ros_gz

sudo apt install libgflags-dev
sudo apt install ros-humble-ament-cmake-mypy
sudo apt install ros-humble-image-transport
sudo apt install ros-humble-image-transport-plugins

Since ROS 2 Humble and Gazebo Garden is not an officially supported combination, rosdep is not able to resolve all the required dependencies:

rosdep check --from-paths src
System dependencies have not been satisfied:
apt	ros-humble-ros-gz-bridge
apt	ros-humble-ros-gz-sim
apt	ros-humble-ros-gz-sim-demos
apt	ros-humble-ros-gz-image
apt	libgflags-dev
apt	ros-humble-ament-cmake-mypy
apt	ros-humble-ament-cmake-pclint
apt	ros-humble-ament-cmake-pycodestyle
apt	ros-humble-image-transport
apt	ros-humble-image-transport-plugins
apt	ros-humble-rqt-image-view
apt	ros-humble-rqt-plot
apt	ros-humble-rqt-topic
apt	ros-humble-rviz2
apt	ros-humble-sdformat-urdf
apt	ros-humble-xacro
apt	ros-humble-sdformat-test-files
apt	ros-humble-gps-msgs
apt	ros-humble-ros-gz-interfaces
ERROR[ros_gz_sim]: Cannot locate rosdep definition for [gz-math7]
	rosdep key : gz-math7
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>
ERROR[ros_gz_image]: Cannot locate rosdep definition for [gz-transport12]
	rosdep key : gz-transport12
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>
ERROR[ros_gz_sim_demos]: Cannot locate rosdep definition for [gz-sim7]
	rosdep key : gz-sim7
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>
ERROR[ros_gz_bridge]: Cannot locate rosdep definition for [gz-transport12]
	rosdep key : gz-transport12
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>

srmainwaring added a commit that referenced this issue May 7, 2023
- Merge gimbal and camera peripheral into model.
- Update iris launch file to set SDF_PATH before running the sdformat_urdf converter.
- Update bring up launch file to use the iris with gimbal params.
- Add bridge entry for the camera and camera info.
- Add image display and TF to rviz config.
- Add ros2_gz.repos containing dependencies
- Update README

Signed-off-by: Rhys Mainwaring <[email protected]>
@srmainwaring srmainwaring moved this from 📋 Backlog to 🏗 In progress in DDS/ROS2 May 10, 2023
@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Sep 4, 2023

Moved code to new repo: srmainwaring#1

Docker image

Notes for running the ardupilot_gz packages on the docker image Dockerfile_dev-ros.

The image is configured for CI and requires additional packages to be used with Gazebo (in server only mode).

Summary

  • Install Gazebo Garden.
  • Install libsdformat12-dev.
  • Install rapidjson-dev.
  • Install libgflags-dev, ros-humble-ament-cmake-mypy, ros-humble-image-transport, ros-humble-image-transport-plugins.

Details

Install gz-garden and libsdformat12-dev

sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null

sudo apt-get update
sudo apt-get install gz-garden
sudo apt install libsdformat12-dev

Install dependencies for ardupilot_gazebo

sudo apt install rapidjson-dev

Install dependencies for ros_gz

sudo apt install libgflags-dev
sudo apt install ros-humble-ament-cmake-mypy
sudo apt install ros-humble-image-transport
sudo apt install ros-humble-image-transport-plugins

Since ROS 2 Humble and Gazebo Garden is not an officially supported combination, rosdep is not able to resolve all the required dependencies:

rosdep check --from-paths src
System dependencies have not been satisfied:
apt	ros-humble-ros-gz-bridge
apt	ros-humble-ros-gz-sim
apt	ros-humble-ros-gz-sim-demos
apt	ros-humble-ros-gz-image
apt	libgflags-dev
apt	ros-humble-ament-cmake-mypy
apt	ros-humble-ament-cmake-pclint
apt	ros-humble-ament-cmake-pycodestyle
apt	ros-humble-image-transport
apt	ros-humble-image-transport-plugins
apt	ros-humble-rqt-image-view
apt	ros-humble-rqt-plot
apt	ros-humble-rqt-topic
apt	ros-humble-rviz2
apt	ros-humble-sdformat-urdf
apt	ros-humble-xacro
apt	ros-humble-sdformat-test-files
apt	ros-humble-gps-msgs
apt	ros-humble-ros-gz-interfaces
ERROR[ros_gz_sim]: Cannot locate rosdep definition for [gz-math7]
	rosdep key : gz-math7
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>
ERROR[ros_gz_image]: Cannot locate rosdep definition for [gz-transport12]
	rosdep key : gz-transport12
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>
ERROR[ros_gz_sim_demos]: Cannot locate rosdep definition for [gz-sim7]
	rosdep key : gz-sim7
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>
ERROR[ros_gz_bridge]: Cannot locate rosdep definition for [gz-transport12]
	rosdep key : gz-transport12
	OS name    : ubuntu
	OS version : jammy
	Data:
<no data>

The fact that the GZ rosdep keys will never resolve is actually pretty annoying. If we want to run this in CI, we could add the --skip-keys arguments, and then remove -r to enfoce our package.xml's work here.

@srmainwaring
Copy link
Collaborator

Closing: we have not added a plane, but the two copter examples demonstrate the procedure for adding further vehicles.

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in DDS/ROS2 Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants