Giter Club home page Giter Club logo

uav_simulator's Introduction

Python - Gazebo Simulation Environment for a UAV with Geometric Control

This repository include Python codes for the position control a UAV in a Gazebo simulation environment, using geometric controllers.

Features

  • Developed using Python
  • Uses a geometric controller that works great with aggressive maneuvers
  • Uses Gazebo as the physics engine
  • Uses only minimal Gazebo/ROS codes so that if something breaks on ROS end in the future, it is easier to fix
  • Has a nice GUI for controlling the UAV
  • Can run your experiments, log data, and plot at the end of the trajectory at a click of a button
  • Estimator, controller, and trajectory generators are in their own Python classes, if you need to test your own estimator, controller, or a trajectory, you only need to modify the respective class

Landing

Why Python?

  • Python makes developing/debugging easier and shorter (no compiling)
  • Can easily find modules or libraries for different tasks

Which controller is used for the UAV control?

  • A geometric controller with decouppled-yaw attitude control is used
  • The controller is published in:
    @InProceedings{Gamagedara2019b,
        title={Geometric controls of a quadrotor uav with decoupled yaw control},
        author={Gamagedara, Kanishke and Bisheban, Mahdis and Kaufman, Evan and Lee, Taeyoung},
        booktitle={2019 American Control Conference (ACC)},
        pages={3285--3290},
        year={2019},
        organization={IEEE}
    }
  • Implementation of the same controller in C++ and Matlab can be found at https://github.com/fdcl-gwu/uav_geometric_control

How to test my own controller?

  • Make sure the desired trajectory generates the desired states required by your controller.
  • Simply update the Controller class with your controller.
  • Make sure your modified controller class outputs the variable force-moment vector (fM).

Which estimator is used for the state estimation?

  • The estimator defined in the following paper is implemented here (except the sensor bias estimation terms):
    @InProceedings{Gamagedara2019a,
        author    = {Kanishke Gamagedara and Taeyoung Lee and Murray R. Snyder},
        title     = {Real-time Kinematics {GPS} Based Telemetry System for Airborne Measurements of Ship Air Wake},
        booktitle = {{AIAA} Scitech 2019 Forum},
        year      = {2019},
        month     = {jan},
        publisher = {American Institute of Aeronautics and Astronautics},
        doi       = {10.2514/6.2019-2377}
    }
  • Matlab implementation of the above controller can be found at https://github.com/fdcl-gwu/dkf-comparison.
  • Note that the Matlab implementation has a delayed Kalman filter that has not been implemented here. Only the non-delayed parts inside DelayedKalmanFilter.m is utilized here.

How to test my own estimator?

  • Make sure your estimator provides the states for the UAV control, or if not create a separate estimator using the current estimator as the base class.
  • Update the Estimator class with your estimator.

How to test my own trajectory?

  • Add your trajectory generation function in Trajectory class.
  • Replace that with an unused mode in the calculate_desired function inside the Trajectory class.

Setting-up

Dependencies

  1. ROS: this repository has been developed using ROS Melodic, on Ubuntu 18.04.
  2. Python GTK libraries for GUI (not required if you opt to not to use the GUI)
    sudo apt-get install python-gtk2-dev
  3. Python modules: these libraries must be installed in the system
    1. NumPy
    2. Pandas
    3. Matplotlib

Setting-up the repository

  1. Clone the repositroy.
    git clone https://github.com/fdcl-gwu/uav_simulator.git
  2. Update the submodules.
    cd uav_simulator
    git submodule update --init --recursive

Setting-up the plugins and Gazebo

You only need to do the followings once (unless you change the Gazebo plugins)

  1. Make the pluging.
    cd uav_simulator
    catkin_make
  2. Source the relevant directories (NOTE: you need to do this on every new terminal).
    cd uav_simulator
    cd devel && source setup.bash && cd ../

Runing the simulation environment

  1. In the current terminal window, launch the Gazebo environment:
    roslaunch uav_gazebo simple_world.launch 
  2. Once the Gazebo is launched, run the rover code from a different rover terminal (if you already don't know, you may find tmux a life-saver):
    python main.py
    If you change the Python code, simply re-run the Python code

Terminal

Tips

  1. Everytime you change the simulation environment, you have to kill the program, catkin_make and re-run it.
  2. If you do not make any changes to the simulation environment, you only need to kill the Python program.
  3. The UAV will re-spawn at the position and orientation defined in reset_uav() in rover.py when you run the Python code.

uav_simulator's People

Contributors

kanishkegb avatar

Watchers

James Cloos 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.