CrazyS is an extension of the ROS package RotorS, aimed to modeling, developing and integrating the Crazyflie 2.0
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
rotors_comm
rotors_control
rotors_description
rotors_evaluation
rotors_gazebo
rotors_gazebo_plugins
rotors_hil_interface
rotors_joy_interface
rotors_simulator
rqt_rotors
.gitignore
.travis.yml
LICENSE
README.md

README.md

Build Status License

CrazyS

CrazyS is an extension of the ROS package RotorS, aimed to modeling, developing and integrating the Crazyflie 2.0 nano-quadcopter in the physics based simulation environment Gazebo.

Such simulation platform allows to understand quickly the behavior of the flight control system by comparing and evaluating different indoor and outdoor scenarios, with a details level quite close to reality. The proposed extension expands RotorS capabilities by considering the Crazyflie 2.0 physical model and its flight control system, as well.

A simple case study is considered (crazyflie2_hovering_example.launch) in order to show how the package works and the validity of the employed dynamical model together the control architecture of the quadcopter.

The code is released under Apache license, thus making it available for scientific and educational activities.

The platform has been developed by using Ubuntu 16.04 and the Kinetic Kame version of ROS, but it is fully compatible with Indigo Igloo and Ubuntu 14.04 (it is not recommended, the support will be until the April, 2019).

Below we provide the instructions necessary for getting started. See CrazyS' wiki for more instructions and examples .

If you are using this simulator within the research for your publication, please cite:

@INPROCEEDINGS{Silano2018,
author = {G. Silano and E. Aucone and L. Iannelli},
booktitle = {2018 26th Mediterranean Conference on Control and Automation (MED)}, 
title = {CrazyS: a software-in-the-loop platform for the Crazyflie 2.0 nano-quadcopter},
year = {2018}, 
volume = {}, 
number = {}, 
pages={352-357}, 
month = {June},
keywords={}, 
doi={10.1109/MED.2018.8442759}, 
ISSN={2473-3504}, 
month={June},
}

Installation Instructions - Ubuntu 16.04 with ROS Kinetic

  1. Install and initialize ROS kinetic desktop full, additional ROS packages, catkin-tools, and wstool:
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install ros-kinetic-desktop-full ros-kinetic-joy ros-kinetic-octomap-ros ros-kinetic-mavlink python-wstool python-catkin-tools protobuf-compiler libgoogle-glog-dev ros-kinetic-control-toolbox
$ sudo rosdep init
$ rosdep update
$ source /opt/ros/kinetic/setup.bash
  1. If you don't have ROS workspace yet you can do so by
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace  # initialize your catkin workspace
$ wstool init
$ git clone https://github.com/gsilano/CrazyS.git
$ git clone https://github.com/gsilano/mav_comm.git

Note On OS X you need to install yaml-cpp using Homebrew brew install yaml-cpp.

  1. Build your workspace with python_catkin_tools (therefore you need python_catkin_tools)
$ cd ~/catkin_ws/
$ catkin build
  1. Add sourcing to your .bashrc file
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

Installation Instructions - Ubuntu 14.04 with ROS Indigo

  1. Install and initialize ROS indigo desktop full, additional ROS packages, catkin-tools, and wstool:
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install ros-indigo-desktop-full ros-indigo-joy ros-indigo-octomap-ros python-wstool python-catkin-tools protobuf-compiler libgoogle-glog-dev
$ sudo rosdep init
$ rosdep update
$ source /opt/ros/indigo/setup.bash
  1. If you don't have ROS workspace yet you can do so by
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace  # initialize your catkin workspace
$ wstool init

Note for setups with multiple workspaces please refer to the official documentation by replacing rosws by wstool.

  1. Get the simulator and additional dependencies
$ cd ~/catkin_ws/src
$ git clone https://github.com/gsilano/CrazyS.git
$ git clone https://github.com/gsilano/mav_comm.git

Note On OS X you need to install yaml-cpp using Homebrew brew install yaml-cpp.

Note if you want to use wstool you can replace the above commands with wstool set --git local_repo_name git@github.com:organization/repo_name.git Note if you want to build and use the gazebo_mavlink_interface plugin you have to get MAVROS as an additional dependency from link below. Follow the installation instructions provided there and build all of its packages prior to building the rest of your workspace. https://github.com/mavlink/mavros

  1. Build your workspace with python_catkin_tools (therefore you need python_catkin_tools)
$ cd ~/catkin_ws/
$ catkin init  # If you haven't done this before.
$ catkin build

Note if you are getting errors related to "future" package, you may need python future: sudo apt-get install python-pip pip install --upgrade pip pip install future

  1. Add sourcing to your .bashrc file
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

Basic Usage

Launch the simulator with the Crazyflie 2.0 model in a basic world. By changing the value of the enable_state_estimator variable (true or false), you can enable or disable the state estimator. In other words, it is possible to simulate the behavior of the drone when the real or ideal sensors are in the loop, respectively.

$ roslaunch rotors_gazebo crazyflie2_hovering_example.launch enable_state_estimator:=true

Note The first run of gazebo might take considerably long, as it will download some models from an online database. You can decided to enable or not the state estimator, thus to use the virtual (with noise and bias) or the real sensors. The default value of enable_state_estimator is false.

The whole process is the following: the desired trajectory coordinates (x_r, y_r, z_r and \psi_r) are published by the hovering example node on the topic command/trajectory, to whom the position controller node (i.e., the Crazyflie controller) is subscribed. The drone state (odometry_sensor1/odometry topic) and the references are used to run the control strategy designed for the path tracking. The outputs of the control algorithm consists into the actuation commands (\omega_1, \omega_2, \omega_3 and \omega_4) sent to Gazebo (command/motor_speed) for the virtual rendering, so to update the aircraft position and orientation.

There are some basic launch files where you can load the different multicopters with additional sensors. They can all be found in ~/catkin_ws/src/CrazyS/rotors_gazebo/launch. Suche scenarios are better explained in the RotorS repository.

The world_name argument looks for a .world file with a corresponding name in ~/catkin_ws/src/CrazyS/rotors_gazebo/worlds. By default, all launch files, with the exception of those that have the world name explicitly included in the file name, use the empty world described in basic.world.

Gazebo Version

At a minimum, Gazebo v2.x is required (which is installed by default with ROS Indigo). However, it is recommended to install at least Gazebo v5.x for full functionlity, as there are the following limitations:

  1. iris.sdf can only be generated with Gazebo >= v3.0, as it requires use of the gz sdf ... tool. If this requirement is not met, you will not be able to use the Iris MAV in any of the simulations.
  2. The Gazebo plugins GazeboGeotaggedImagesPlugin, LidarPlugin and the LiftDragPlugin all require Gazebo >= v5.0, and will not be built if this requirement is not met.

YouTube videos

In such section a video proving the effectiveness of the platform is reported. Further videos can be found in the related YouTube channel. Have fun! :)

CrazyS, an exntension of the ROS pakcage RotrS aimed to modeling, developing and integrating the Crazyflie 2.0 nano-quadcopter

Bugs & Feature Requests

Please report bugs and request features using the Issue Tracker.