Giter VIP home page Giter VIP logo

ros2swarm's Introduction

Manual ROS2swarm Version 1.2.0

ROS2swarm is a ROS 2 (Dashing, Foxy) package that provides swarm behavior patterns. The project started at the Institute of Computer Engineering with support from the Institute of Robotics and the Institute for Electrical Engineering in Medicine of the University of Lübeck, Germany. Currently, it is mainly developed by the Cyber-Physical Systems Group of the University Konstanz, Germany.

A list of all project contributors can be found here

The current ROS2swarm version is 1.2.0.

The ICRA 2022 paper "ROS2swarm - A ROS 2 Package for Swarm Robot Behaviors" refers to version 1.0.0 (Dashing), which can be found here.

About ROS2swarm

ROS2swarm is available for the ROS 2 Versions Dashing (dashing-dev), Foxy (foxy-dev), and Galactic (galactic-dev).

The included swarm behavior patterns consist of movement and voting based patterns. Basic patterns can be used by combined patterns to create more complex behaviors out of basic components. The behaviors are available for simulation and out of the box for several supported robot platforms. We provide launch scripts and shell scripts to start ROS2swarm.

Installation guide

To see a full installation guide for the ROS2swarm package please see the installation guide.

How to use ROS2swarm

ROS2swarm provides launch scripts to start the patterns in a simulation or on real robots. The parameters of the launch scripts, such as the robot type, can be set by editing the parameter sections of the following scripts.

Script Function
start_simulation.sh Start the Gazebo simulation with the desired number of specified robots. To start behavior execution, run start_command.sh script.
start_robot.sh Start one physical robot. To start behavior execution, run the start_command.sh script.
start_command.sh Starts behavior execution on all robots in the network.
ros2 topic pub --once /swarm_command communication_interfaces/msg/Int8Message "{data: 1}"
scripts/add_robots_to_simulation.sh Adds additional robots to the running Gazebo simulation. These can be of a different robot type providing an easy way to simulate heterogeneous swarms.

Supported robot platforms

ROS2swarm currently supports the following robot platforms out of the box:

  • TurtleBot3 Waffle Pi (robot:=waffle_pi; sensor_type:=lidar)
  • TurtleBot3 Burger (robot:=burger; sensor_type:=lidar)
  • Jackal UGV (robot:=jackal; sensor_type:=lidar)
  • Thymio II (robot:=waffle_pi; sensor_type:=ir)

Existing patterns

The following table gives an overview the current implemented patterns. The patterns are separated into movement and voting patterns. Every pattern can either be a basic pattern or a combined one, which make use of one or more other patterns to create more complex behaviors.

Pattern Domain Type Simulation Robot Sensor Requirements
aggregation Movement Basic ✔️ ✔️ LiDAR or IR
attraction Movement Basic ✔️ ✔️ LiDAR or IR
attraction 2 Movement Basic ✔️ ✔️ LiDAR or IR
dispersion Movement Basic ✔️ ✔️ LiDAR or IR
drive Movement Basic ✔️ ✔️
magnetometer Movement Basic ✔️
minimalist flocking Movement Basic ✔️ ✔️ LiDAR or IR
random walk Movement Basic ✔️ ✔️
discussed dispersion pattern Movement Combined ✔️ ✔️ LiDAR or IR
voter model Voting Basic ✔️ ✔️
majority rule Voting Basic ✔️ ✔️

In addition, a hardware protection layer is started to prevent collisions.

Sensor Layer

ROS2swarm provides several sensor layers to enable the use of robots with different sensor setups:

  • lidar_layer
  • ir_layer
  • ir_tf_layer

The sensor layer receives the sensor data from the respective sensors and transforms it to a RangeData message.

std_msgs/Header header
float32[] ranges
float64[] angles

The RangeData message contains two arrays: (i) the measured distances or ranges and (ii) the angle of the measurement (e.g., position of IR sensor). The parameters of the sensor layer can be specified in the config file sensor_specification.yaml. New sensor layers can be easily integrated.

Architecture

We give a short overview of the pattern components, the launch scripts and the packages of ROS2swarm.

Components of a pattern

A pattern consists of the behavior implementation itself, as well as configuration and launch files.

File Function
ros2swarm/pattern_domain/pattern_type/pattern_name.py The behavior logic of the pattern.
config/robot_type/pattern_domain/pattern_type/pattern_name.yaml The parameter configuration for the pattern. There is one file for each robot type.
launch/pattern_domain/pattern_type/pattern_name.launch.py The launch file starting the ROS node with the parameters specified in pattern_name.yaml.

To add a new pattern, copy the files from any existing pattern, e.g., the drive pattern, and implement the desired behavior. Also remember to add the files of the new pattern to the setup.py and to register the main function of the new pattern there. The new pattern can be started via the start_*.sh scripts with the name defined in the setup.py.

Launch script overview

The provided launch scripts help the user to start ROS2swarm and to execute the desired behaviors. There are several scripts which are chained. In this section we explain their purpose and internal call order. We provide scripts both for starting desired swarm behaviors in simulation and on the real robots.

Simulation

For robot types Thymio, TurtleBot3 Waffle Pi and TurtleBot3 Burger:

  • start_simulation.sh - shell script to start up the Gazebo simulator and ROS2swarm

    • launch_gazebo/launch/create_environment.launch.py - central simulation launch script which calls the other launch scripts
      • launch_gazebo/launch/start_gazebo.launch.py - start the Gazebo simulator
      • launch_gazebo/launch_gazebo/add_bot_node.py - adds a Gazebo robot node for each robot
      • ros2swarm/launch/bringup_patterns.launch.py - manage the start of the pattern for each robot with its own namespace
        • ros2swarm/hardware_protection_layer.py - hardware protection layer node
        • ros2swarm/pattern_domain/pattern_type/pattern_name.launch.py - launch script for the pattern node
        • robot_state_publisher package - robot_state_publisher node
  • scripts/add_robots_to_simulation.sh - shell script to add more robots to simulation

    • launch_gazebo/launch/add_robot.launch.py - allows adding additional robots to a simulation started by the create environment script (see above)
      • launch_gazebo/launch_gazebo/add_bot_node.py - adds a Gazebo robot node for each robot
      • ros2swarm/launch/bringup_patterns.launch.py - manage the start of the pattern for each robot with its own namespace
        • etc. as above

For robot type Jackal UGV:

Real Robots

For robot types TurtleBot3 Waffle Pi and TurtleBot3 Burger:

  • start_robot.sh - shell script to start up ROS2swarm on a single robot
    • ros2swarm/bringup_robot.launch.py - central robot launch script which adds the other launch scripts to the launch description
    • ros2swarm/turtlebot3_bringup.launch.py - starts the TurtleBot3 robot nodes and launch files

For robot type Jackal:

  • start_robot.sh - shell script to start up ROS2swarm on a single robot with robot:=jackal
    • does not start the jackal counterpart, only provides subscribers and publishers of the behavior pattern

Package Structure

ROS2swarm consists of three ROS packages:

  • ros2swarm
    • The main package containing the behavior patterns and their configuration and launch files.
  • launch_gazebo
    • Scripts to start the Gazebo simulation
  • communication_interfaces
    • Interfaces for special ROS messages used by the patterns

Required software

Dashing Version

  • Ubuntu 18.04 LTS
  • ROS 2 Dashing Diademata
  • ROS 2 TurtleBot3 package
  • Python 3.6
  • Gazebo 9 for simulation

Foxy Version

  • Ubuntu 20.04 LTS
  • ROS 2 Foxy Fitzroy
  • ROS 2 TurtleBot3 package
  • ROS 2 Thymio package
  • Python 3.8.10
  • Gazebo 11 for simulation

Using the Thymio model and the modified TurtleBot3 models

A Gazebo model for the Thymio~II robot is provided by us here: https://github.com/ROS2swarm/thymio_description

In addition, ROS2swarm includes meshes for modified Turtlebot3 models.

In the following the steps to use the models in Gazebo are described.

Thymio~II in Gazebo

  1. download the thymio_description package to
colcon_ws/src/
  1. build colcon_ws
cd ~/colcon_ws && colcon build --symlink-install
  1. use robot selection parameter in start_*.sh
robots:=thymio
sensor_type:=ir
source ~/colcon_ws/install/setup.bash

Modified TurtleBot3 in Gazebo

To use the modified TurtleBot3 models, the models have to be copied to the workspace of the turtlebot3 package as described in the following. To select the standard Turtlebot3 Waffle Pi robot, use "waffle_pi" in the start scripts. To select a modified Turtlebot3 Waffle Pi version, use "waffle_pi_name_of_modification" in the start scripts. The mesh for Gazebo is then automatically selected when using the provided launch scripts. The same applies for the TurtleBot3 "burger" model.

To use the TurtleBot3 Burger, replace "waffle_pi" with "burger" in the following.

  1. copy
models/turtlebot3_waffle_pi_name_of_modification

to

turtlebot3_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models
  1. copy
models/turtlebot3_waffle_pi_invisible_sensors.urdf

to

turtlebot3_ws/src/turtlebot3/turtlebot3_description
  1. build turtlebot3_ws
cd ~/turtlebot3_ws && colcon build --symlink-install
  1. use robot selection parameter in start_*.sh
robots:=waffle_pi_name_of_modification
source ~/turtlebot3_ws/install/setup.bash

ros2swarm's People

Contributors

msminirobot avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

ros2swarm's Issues

For robot type Jackal UGV:

麻烦打扰你,我是一名来自**的ros初学者,我的英语很差,所以只能借助网上翻译器来给您写信。我最近学习您在github上发布的项目做仿真的时候(https://github.com/ROS2swarm/ROS2swarm).我没有使用过gitlab,一部分代码似乎只向有关人员开放(start the jackal simulation: https://gitlab.iti.uni-luebeck.de/plattenteich/jackal-swarm-addition),不知道现在这部分代码可以开放吗?如果可以的话,这部分代码能否通过邮箱发给我?这是我的邮箱

Excuse me, I'm a beginner of ROS from China. My English is very poor, so I can only write to you with the help of an online translator. I recently learned how to simulate the project you published on github( https://github.com/ROS2swarm/ROS2swarm ). I have never used gitlab, and it seems that part of the code is only open to relevant personnel (start the jack simulation: https://gitlab.iti.uni-luebeck.de/plattenteich/jackal-swarm-addition ), I wonder if this part of the code can be opened now? If possible, can I have this code sent to me via email? This is my email

[email protected]

Missing tf_exchange dir

Hi,

I have downloaded the ROS2Swarm code from the main branch to launch some experiments on ROS2 Foxy. However, when I run the start_simulation.sh file, I get the following error which wasn't occurring last time I used it:

Screenshot 2023-07-08 at 7 57 36 PM

I see that you have added more features in past couple of months, however I think that in the ~/ROS2swarm/src/launch_gazebo/launch/create_environment.launch.py , the following package is needed:
tf_exchange_dir = get_package_share_directory('tf_exchange')

but is not there...is it a part of ROS2 and I have to download it as a dependency?

Local Communication

Realize strategy for local communication between robots (so far only global communication possible)
First attempt: ad-hoc network and sorting by signal strength

  1. Create an adhoc network with the Turtlebot3 Waffle Pi basic setup and if necessary an additional wifi adapter.
  2. Send a StringMessage from one Turtle to another via the adhoc network
  3. Use the adhoc network with the voter model with limiter pattern and improve the code if necessary

Hint: Try to use slowest communication available.

If not possible at all: use xbees for communication

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.