Giter Club home page Giter Club logo

smart_diffbot's Introduction

SMART diffbot

Generic diff drive robot simulated in Gazebo for testing outdoor GNSS based navigation using Nav2.

It supports namespacing and multiple robots in one simulation. Tested for ROS 2 Humble and Gazebo Fortress.

Developed by the Smart Mechatronics And RoboTics (SMART) Research Group of Saxion University of Applied Sciences. Supported by Regiorgaan SIA project RAAK-MKB Autonomous Agricultural Navigation (RAAK.MKB16.016).

screenshot

Install

Dependencies from binaries

Robot modeling

sudo apt install ros-humble-xacro
sudo apt install ros-humble-joint-state-publisher
sudo apt install ros-humble-joint-state-publisher-gui

Gazebo Fortress

sudo apt install ignition-fortress
sudo apt install ros-humble-ros-gz

ros2_control

sudo apt install ros-humble-ros2-control
sudo apt install ros-humble-ros2-controllers

Aruco detection

pip3 install transforms3d opencv-contrib-python==4.6.0.66
sudo apt-get install ros-humble-tf-transformations

Localization

sudo apt install ros-humble-robot-localization

Navigation

sudo apt install ros-humble-navigation2

The SMART diffbot packages

Clone the smart_diffbot repository to the src folder of your ROS 2 workspace.

Some dependencies are not available as binary installs for ROS 2 Humble. These are included as submodules to this package. These include:

They are available as submodules to this package and they can be added by running inside of the smart_diffbot folder:

git submodule init
git submodule update

Now navigate back to your ROS 2 workspace folder and colcon build.

source /opt/ros/humble/setup.bash
colcon build --symlink-install 
source install/setup.bash

Examples

Example launch files are provided which start a Gazebo world with the simulated SMART diffbot(s).

Launch example simulation of a single robot

An example world is included which contains a docking station and a line on the floor. The following command starts this world, including one SMART diffbot with camera and without using namespacing:

ros2 launch smart_diffbot_bringup single_robot_sim_example.launch.py

Visualization

RViz can be used to give this robot a goal position to navigate to and to localize it on a map:

ros2 launch smart_diffbot_navigation rviz.launch.py

To view the map, switch on the AerialMapDisplay in the Displays window of RViz.

To set a goal pose, click the "2D Goal Pose" button in the upper bar and select a location on the map where you want the robot to go.

Example clients

Two example clients have been included to send a goal request to the navigation stack.

To send a docking command, use:

ros2 run smart_diffbot_clients docking_client

To send a line following command, use:

ros2 run smart_diffbot_clients line_follow_client

Simulation example with multiple robots

Another example launches an empty world with two robots, including namespacing:

ros2 launch smart_diffbot_bringup multi_robot_sim_example.launch.py

Basic use

The robot can be used in any Gazebo world that includes spherical coordinates (such that GNSS data is available) and a bridged clock from Gazebo to ROS 2. The included worlds can be used as examples.

With a world running, the robot can be spawned and started using:

ros2 launch smart_diffbot_bringup main.launch.py

Although there is no actual hardware of the SMART diffbot, a dummy hardware interface has also been included in this package to demonstrate how a similar package could be set up for an actual robot with simple switching between simulation and hardware control. It would be a matter of setting a sim argument to false for the main robot launch file.

Using use_namespace:=true, namespacing is activated. The namespace is equal to the robot name, which can be altered by adding a robot_name argument. The camera can be disabled by adding the camera:=false argument. Currently, the simulation only supports a maximum of one robot with a camera in the same world. In case of multiple robots in one simulation, make sure to disable the camera on the others. Furthermore, spawn positions and robot colors can be altered using arguments to this launch file. See the multi_robot_example launch file as an example.

Development use - seperation of control, localization and navigation

For development purposes it is convenient to (instead of using the main launch file) spawn the robot and launch its control, localization and navigation software in seperate terminals. In the main launch file, these are all combined. This way, if you are developing one of the components, you only have to restart that component after a change in software instead of restarting the whole simulation.

Test the robot simulation

Start a Gazebo world, by default the empty world:

ros2 launch smart_diffbot_bringup gazebo_world.launch.py

Spawn the robot:

ros2 launch smart_diffbot_bringup simulation.launch.py

Test the controllers

Start the controllers:

ros2 launch smart_diffbot_control control.launch.py

You can use a keyboard teleop node to move the robot around using keyboard:

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/diff_drive_controller/cmd_vel_unstamped

You can open RViz and check control and check the base_link => odom transform:

ros2 launch smart_diffbot_control rviz.launch.py

Test localization

On top of control, run localization:

ros2 launch smart_diffbot_localization localization.launch.py

You can again use a keyboard teleop node to move the robot around using keyboard:

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/diff_drive_controller/cmd_vel_unstamped

You can open RViz and check the base_link => odom => map transform:

ros2 launch smart_diffbot_localization rviz.launch.py

To view the satellite map, switch on the AerialMapDisplay in the Displays window of RViz.

Test navigation

On top of control and localization, run navigation:

ros2 launch smart_diffbot_navigation navigation.launch.py

Open RViz and check the navigation behaviour by setting a 2D Goal Pose on the map:

ros2 launch smart_diffbot_navigation rviz.launch.py

To view the satellite map, switch on the AerialMapDisplay in the Displays window of RViz.

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.