Git Product home page Git Product logo

ros_gz_rover's Introduction

ros-gz-rover

This package contains an example demonstrating how to use the ROS2 - Gazebo bridge for a skid-steer rover controlled by ArduPilot. It assumes an advanced level of familiarity with the packages referred to below, most of the dependencies will need to be built from source.

ros_gz_rover_playpen_5

Quick start

The following instructions are for macOS (Monterey 12.5). They assume that ROS2 Humble (or Rolling) is available on the system (including rviz2), and that Gazebo Garden has been installed from source. An ArduPilot development environment must be installed including MAVProxy. The ArduPilot/ardupilot_gazebo plugins must be installed and the ArduPilot/SITL_Models repo available. Each terminal running a command will need to correctly source the appropriate environments and ensure the Gazebo environment variables specifying Gazebo resource and system plugins are exported.

Create workspace

# create workspace
$ mkdir -p ~/ros2-gz/src && cd ~/ros2-gz/src

# clone ros-gz (ros2 rolling branch)
$ git clone https://github.com/gazebosim/ros_gz.git -b ros2

# clone tf_transformations (ros2 humble may not include this)
https://github.com/DLu/tf_transformations.git


# clone dependencies for mavros (ROS2)
git clone https://github.com/ros/angles.git -b ros2
git clone https://github.com/ros/diagnostics.git -b humble
git clone https://github.com/ros/diagnostics.git -b humble
git clone https://github.com/ros-geographic-info/geographic_info.git -b ros2
git clone https://github.com/mavlink/mavlink-gbp-release.git
git clone https://github.com/srmainwaring/mavros.git -b srmainwaring/ros2-macos

# clone this repo
git clone https://github.com/srmainwaring/ros_gz_rover.git

Build

$ cd ~/ros2-gz
$ colcon build --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib -DCMAKE_CXX_STANDARD=17

Launch the ROS2 nodes, the Gazebo server, and RViz

$ cd ~/ros2-gz
$ source ./install/setup.zsh
$ ros2 launch ros_gz_rover rover.launch.py

Launch the mavros nodes including plugins from mavros_extras

$ cd ~/ros2-gz
$ source ./install/setup.zsh
$ ros2 launch ros_gz_rover mavros.launch.py

Launch SITL and provide output to additional GCS running on another machine

$ sim_vehicle.py -N -v Rover -f rover-skid --model JSON --mavproxy-args="--out=udp:192.168.1.83:14551"

Launch the Gazebo client

$ gz sim -v4 -g

ros_gz_rover's People

Contributors

srmainwaring avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ros_gz_rover's Issues

Getting weird frame errors when trying to run this simulation

Hi Rhys,

I am now trying to learn the interactions between Ardupilot, Gazebo, and ROS2. To do this I figured this package was a good place to start. When I try to run ros2 launch ros_gz_rover rover.launch.py I get an output saying:
[rviz2-5] Warning: Invalid frame ID "rear_right_wheel_link" passed to canTransform argument source_frame - frame does not exist
[rviz2-5] at line 93 in ./src/buffer_core.cpp
[rviz2-5] Warning: Invalid frame ID "front_left_wheel_link" passed to canTransform argument source_frame - frame does not exist
[rviz2-5] at line 93 in ./src/buffer_core.cpp

Then when I run ros2 launch ros_gz_rover mavros.launch.py I get these messages:
[mavros_node-1] at line 229 in /home/connor/colcon_ws/src/mavros/libmavconn/src/udp.cpp
[mavros_node-1] Error: mavconn: udp0: send: channel closed!

When I run the sim_vehicle.py command for the ArudPilot I get the message
No JSON sensor message received, resending message

Finally when running the gz sim command I get this message over and over:
[GUI] [Dbg] [Gui.cc:340] GUI requesting list of world names. The server may be busy downloading resources. Please be patient.

Sorry for bothering you once again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.