Skip to content

Varchasvin10/Underwater_Drone_Simulation

Repository files navigation

Underwater Drone Simulation on Ubuntu 18.04 with ROS Melodic and Gazebo

Welcome to the Underwater Drone Simulation project! This README provides a guide to setting up and running an underwater drone simulation using Ubuntu 18.04, ROS Melodic, and Gazebo. This simulation environment allows you to test and develop algorithms for underwater robotics in a virtual setting.

Prerequisites

Before setting up the simulation, ensure you have the following prerequisites installed:

  1. Ubuntu 18.04: The operating system used for this setup.
  2. ROS Melodic: The Robot Operating System (ROS) version for this project.
  3. Gazebo: The simulation tool used for creating and running the virtual environment.

Installing ROS Melodic

  1. Setup your sources.list:

    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list'
  2. Setup your keys:

    sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key '421C365BD9FF1F71'
  3. Install ROS Melodic:

    sudo apt update
    sudo apt install ros-melodic-desktop-full
  4. Initialize rosdep:

    sudo rosdep init
    rosdep update
  5. Set up your environment:

    echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
    source ~/.bashrc
  6. Install rosinstall:

    sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

Installing Gazebo

Gazebo is included in the ROS Melodic installation, but you can install the latest version if needed:

  1. Install Gazebo:

    sudo apt install gazebo9 libgazebo9-dev
  2. Install Gazebo ROS packages:

    sudo apt install ros-melodic-gazebo-ros ros-melodic-gazebo-ros-pkgs

Setting Up the Simulation

  1. Create a ROS workspace:

    mkdir -p ~/catkin_ws/src
    cd ~/catkin_ws/
    catkin_make
    source devel/setup.bash
  2. Clone the underwater drone simulation repository:

    cd ~/catkin_ws/src
    git clone https://github.com/Varchasvin10/Underwater_Drone_Simulation.git
  3. Install dependencies: If the simulation package has dependencies, install them using:

    cd ~/catkin_ws
    rosdep install --from-paths src --ignore-src -r -y
  4. Build the workspace:

    cd ~/catkin_ws
    catkin_make
  5. Source the workspace:

    source devel/setup.bash

Running the Simulation

  1. Launch Gazebo with the underwater world:

    roslaunch uuv_gazebo_worlds ocean_waves.launch
  2. Launch the Drone:

    roslaunch uuv_descriptions upload_rexrov.launch mode:=default x:=0 y:=0 z:=-20 namespace:=rexrov
  3. Use Teleop Keys with the cascaded PID controller

    roslaunch uuv_control_cascaded_pid key_board_velocity.launch model_name:=rexrov

Troubleshooting

  • Gazebo crashes or fails to start: Ensure that all dependencies are correctly installed and the ROS workspace is built. Check for error messages in the terminal for clues.
  • Missing ROS packages or libraries: Use rosdep to install missing dependencies.
  • Build issues: Verify that all source files and configurations are correct.

Contributing

If you would like to contribute to this project, please fork the repository, make your changes, and submit a pull request. Make sure to include relevant documentation and test your changes thoroughly.

Happy simulating!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published