Git Product home page Git Product logo

bluerov2's Introduction

BlueROV2 MPC

This work implements a NMPC controller for BlueROV2 with ROS.

This repository contains the robot description and necessary launch files to simulate the BlueROV2 (unmanned underwater vehicle) on Unmanned Underwater Vehicle Simulator (UUV Simulator). Additional it's possible run BlueROV2 in SITL using mavros, joystick interaction and video streaming capture with opencv based on bluerov_ros_playground package from BlueRobotics.

This work is developed based on Ingeniarius, Lda. and Instituite of Systems and Robotics University of Coimbra within the scope of MS thesis "Localization of an unmanned underwater vehicle using multiple water surface robots, multilateration, and sensor data fusion".

Prerequisites

We also provide its docker image to save you some time.

Getting started

  1. Install python 3.7 and its dependencies

    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt update
    sudo apt install -y python3.7
    
    apt-get install -y python3-pip
    
    pip3 install numpy matplotlib scipy future-fstrings casadi>=3.5.1 setuptools
    sudo apt-get install -y python3.7-tk
    
  2. Install Acados

    git clone https://github.com/acados/acados.git
    cd acados
    git submodule update --recursive --init
    mkdir -p build
    cd build
    cmake -DACADOS_WITH_QPOASES=ON -DACADOS_WITH_OSQP=OFF/ON -DACADOS_INSTALL_DIR=<path_to_acados_installation_folder> ..
    make install -j4
    
    pip install -e ~/acados/interfaces/acados_template
    
    echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/root/acados/lib"' >> ~/.bashrc 
    echo 'export ACADOS_SOURCE_DIR="/root/acados"' >> ~/.bashrc
    source ~/.bashrc
    
  3. Install ros uuv-simulator packages

    sudo apt-get install -y ros-noetic-geodesy
    mkdir -p ~/catkin_ws/src && \
    cd ~/catkin_ws/src && \
    git clone --branch noetic https://github.com/arturmiller/uuv_simulator.git
    
  4. Install then compile this package

    cd ~/catkin_ws/src && \
    git clone https://github.com/HKPolyU-UAV/bluerov2.git
    

    Please edit CMakelists.txt here and here if you put your acados in otherwise directory. Modify the line set(acados_include "~/acados/include") and set(acados_lib "~/acados/lib")

    Then do

    cd ~/catkin_ws/src/bluerov2/bluerov2_dobmpc/scripts && \
    yes | python3 generate_c_code.py
    

    and

    cd ~/catkin_ws/src/bluerov2/bluerov2_mpc/scripts && \
    yes | python3 generate_c_code.py
    

    The last commands basically run generate_c_code.py at here and here.

    Finally, do

    cd ~/catkin_ws && catkin_make
    

Start simulation without controller

Ocean_waves in uuv simulator is set as default world.

Quick start to initialize the Gazebo world and add blueROV2 vehicle

roslaunch bluerov2_gazebo quick_start.launch

Or start with thruster manager

roslaunch bluerov2_gazebo start_with_thruster_manager.launch

With thruster manager, forces and moments can be published to topic /bluerov2/thruster_manager/input.

Start simulation with PID controller

Start PID controller with teleop (using joystick)

roslaunch bluerov2_gazebo start_pid_demo_with_teleop.launch

Or start PID Controller without teleop

roslaunch bluerov2_gazebo start_pid_demo.launch

Further trajectory tracking tasks can be done with uuv_control_utils package, such as following linear trajectory

roslaunch uuv_control_utils send_waypoints_file.launch uuv_name:=bluerov2 interpolator:=linear

Or following helical trajectory

roslaunch uuv_control_utils start_helical_trajectory.launch uuv_name:=bluerov2 n_turns:=2

Start simulation with MPC controller

A demonstration of starting MPC controler to follow circular trajectory can be launched by

roslaunch bluerov2_gazebo start_mpc_demo.launch

The bluerov2_mpc package also includes more trajectory following tasks such as following leminscate path and self defined waypoints.

Start simulation with disturbance observer-based MPC controller

A demonstration of starting MPC controler to follow circular trajectory can be launched by

roslaunch bluerov2_dobmpc start_dobmpc_demo.launch 

The generated disturbances can be adjusted at here or here.

Citation

This repository contains the research code for our paper: https://doi.org/10.3390/jmse12010094.

bluerov2's People

Contributors

pattylo avatar yahu3198 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

Watchers

 avatar  avatar  avatar

bluerov2's Issues

Clarifications on PID Controller

Hello,

I installed the bluerov2 simulator as you suggested in the installation guide but I'm confused on how to launch the PID Controller.
My goal is to give the robot a XYZ coordinate + orientation and it will go to the coordinates with the given orientation.
I want to use either gazebo standalone or a combination with SITL so both options are acceptable. Please let me know how to make it work.

Thanks in advance.

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.