GithubHelp home page GithubHelp logo

pulak-gautam / rotors_simulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aerialrobotics-iitk/rotors_simulator

0.0 0.0 0.0 63.34 MB

Experimental project to port rotors_simulator to ROS2

Shell 0.14% C++ 76.84% Python 15.49% C 0.29% CMake 7.24%

rotors_simulator's Introduction

RotorS

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

This is the fork of the original repo, we (Team Aerial Robotics IITK) have been customising this according to our usage.

Installation Instructions

  • Install and initialize ROS noetic 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-noetic-desktop-full ros-noetic-joy ros-noetic-octomap-ros ros-noetic-mavlink python-wstool python-catkin-tools protobuf-compiler libgoogle-glog-dev ros-noetic-control-toolbox ros-noetic-mavros
sudo rosdep init
rosdep update
source /opt/ros/noetic/setup.bash
  • If you don't have ROS workspace yet you can do so by
mkdir -p ./rotors_ariitk_ws/src
cd ./rotors_ariitk_ws/
catkin init  # initialize your catkin workspace
cd src/
wstool init
wget https://raw.githubusercontent.com/AerialRobotics-IITK/rotors_simulator/base_2022/rotors_hil.rosinstall
wstool merge rotors_hil.rosinstall
wstool update
  • Now install rotorS with dependencies
# assuming you're still at your workspace src/
git clone [email protected]:AerialRobotics-IITK/rotors_simulator.git
git clone [email protected]:ethz-asl/mav_comm.git
  • Build your workspace with python_catkin_tools (therefore you need python_catkin_tools)
catkin build
source ../devel/setup.bash # source this everytime you need it

Basic Usage

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

roslaunch rotors_gazebo mav_hovering_example.launch mav_name:=firefly world_name:=basic

Note The first run of gazebo might take considerably long, as it will download some models from an online database. Should you receive a timeout error, try running gazebo by itself (e.g. roslaunch gazebo_ros empty_world.launch ) so it has sufficient time to actually download all of the models.

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.

The world_name argument looks for a .world file with a corresponding name in ~/catkin_ws/src/rotors_simulator/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.

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 world_name:=basic

ARIITK Changes

  • Added camera to firefly here
  • Added depth_camera to firefly here

rotors_simulator's People

Contributors

gbmhunter avatar ffurrer avatar burrimi avatar pvechersky avatar michaelpantic avatar thomasgubler avatar fmina avatar karenbodie avatar helenol avatar hitimo avatar devbharat avatar zacharytaylor avatar hitszchen avatar ba-13 avatar jaeyoung-lim avatar ptrkfry avatar lorenzmeier avatar maxb91 avatar timethy avatar pulak-gautam avatar enricgalceran avatar jgoppert avatar scpeters avatar orangelynx avatar rikba avatar andreasantener avatar cwitting avatar mfehr avatar tkazik avatar raghavkhanna avatar

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.