Giter Site home page Giter Site logo

rotors_simulator's Introduction

RotorS

RotorS is a MAV gazebo simulator. It provides some multirotor models such as the AscTec Hummingbird, the AscTec Pelican, the AscTec Firefly, but the simulator is not limited for the use with these multicopters.

There are simulated sensors coming with the simulator such as an IMU, a generic odometry sensor, and the VI-Sensor, which can be mounted on the multirotor.

This packages also contains some example controllers, basic worlds, a joystick interface, and example launch files.

Installation Instructions

  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
$ 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 at http://docs.ros.org/independent/api/rosinstall/html/ by replacing rosws by wstool.

  1. Get the simulator and additional dependencies
$ cd ~/catkin_ws/src
$ git clone [email protected]:ethz-asl/rotors_simulator.git
$ git clone [email protected]:ethz-asl/mav_comm.git

Note if you want to use wstool you can replace the above commands with wstool set --git local_repo_name [email protected]:organization/repo_name.git

  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
  1. Add sourcing to your .bashrc file
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

Basic Usage

Launch the simulator with a hex-rotor helicopter model, in our case, the AscTec Firefly.

$ roslaunch rotors_gazebo mav_empty_world.launch mav_name:=firefly

Note The first run of gazebo might take considerably long, as it will download some models from an online database.

The simulator starts by default in paused mode. To start it you can either

  • use the Gazebo GUI and press the play button

  • or you can send the following service call.

    $ rosservice call gazebo/unpause_physics
    

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/rotors_simulator/rotors_gazebo/launch.

Getting the multicopter to fly

To let the multicopter fly you need to generate thrust with the rotors, this is achieved by sending commands to the multicopter, which make the rotors spin. There are currently a few ways to send commands to the multicopter, we will show one of them here. The rest is documented here in our Wiki. We will here also show how to write a stabilizing controller and how you can control the multicopter with a joystick.

Send direct motor commands

We will for now just send some constant motor velocities to the multicopter.

$ rostopic pub /firefly/command/motor_speed mav_msgs/Actuators '{angular_velocities: [100, 100, 100, 100, 100, 100]}'

Note The size of the motor_speed array should be equal to the number of motors you have in your model of choice (e.g. 6 in the Firefly model).

You should see (if you unpaused the simulator and you have a multicopter in it), that the rotors start spinning. The thrust generated by these motor velocities is not enough though to let the multicopter take off.

You can play with the numbers and will realize that the Firefly will take off with motor speeds of about 545 on each rotor. The multicopter is unstable though, since there is no controller running, if you just set the motor speeds.

Let the helicopter hover with ground truth odometry

You can let the helicopter hover with ground truth odometry (perfect state estimation), by launching:

$ roslaunch rotors_gazebo mav_hovering_example.launch mav_name:=firefly

Create an attitude controller

TODO(ff): Write something here.

Usage with a joystick

TODO(ff): Write something here.

rotors_simulator's People

Contributors

birchera avatar burrimi avatar ffurrer avatar fmina avatar helenol avatar hitszchen avatar pascalgohl avatar thomasgubler avatar

Watchers

 avatar  avatar

Forkers

yvaine

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.