This package was developed to control a BlueROV2 to perform autonomous underwater docking. This package utilizes Model Predictive Control (MPC) to achieve optimal control of the vehicle.
This repository is a modified version of the bluerov_ros_playground repo authored by patrickelectric.
Installing ROS: Ubuntu 20.04 (See ROS wiki for other OS)
- Set up sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- Set up keys
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
- Installation
sudo apt update
- Pick how much ROS you want to install: must be either Desktop or Desktop-Full
- ROS Desktop (includes rqt and rviz)
sudo apt install ros-noetic-desktop
- Desktop-Full (includes Desktop and 2D/3D simulators)
sudo apt install ros-noetic-desktop-full
- ROS Desktop (includes rqt and rviz)
- Set up environment
- You must source this script in every bash terminal you use ROS in
source /opt/ros/noetic/setup.bash
- To automatically source this script every time a new shell is launched, run
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
- Check that source /opt/ros/noetic/setup.bash has been added to the end of .bashrc
- You must source this script in every bash terminal you use ROS in
- Install dependencies for building packages
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
- Initialize rosdep
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
- Create and build workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
- This will create a workspace with 'build', 'devel', and 'src' folders and a CMakeLists.txt in 'src'
- Source
source devel/setup.bash
- To automatically source this script every time a new shell is launched, run
echo "source /home/<username>/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
- Check that source /home/< username>/catkin_ws/devel/setup.bash has been added to the end of .bashrc
- Make sure the ROS_PACKAGE_PATH includes the directory
echo $ROS_PACKAGE_PATH
/home/youruser/catkin_ws/src:/opt/ros/noetic/share
pip install casadi
Please follow the instructions provided in the following two links:
sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras
sudo /opt/ros/noetic/lib/mavros/install_geographiclib_datasets.sh
pip install imutils
pip install pandas
- Make sure python-opencv is not installed
pip uninstall opencv-python
- Install opencv-contrib-python
pip install opencv-contrib-python
- Go to your ROS package source directory:
cd catkin_ws/src
- Clone this project
git clone https://github.com/rakeshv24/bluerov2_dock
- Go back to your workspace:
cd ../
- Build and install the project:
catkin_make --pkg bluerov2_dock
- Reload your ROS env.
source devel/setup.sh
- Before proceeding further, make sure that all the steps mentioned in the guide for Software Setup has been followed.
- From a terminal, run
roslaunch bluerov2_dock mission_control.launch
- If the terminal initially outputs Controller error:'joy', move the sticks to clear the error.
- Press button "A" on the joystick to enable autonomous docking mode.
- To switch back to manual mode, move either of the sticks in any direction.