Skip to content

Install from source

Requirements

Use Ubuntu 22.04.

  1. Install ROS 2 Humble MBARI WEC is tested against the cyclonedds rmw implementation, so set that up as follows:

    sudo apt install -y ros-humble-rmw-cyclonedds-cpp
    export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
    

  2. Install Gazebo Garden

  3. Install necessary tools

    sudo apt install python3-vcstool python3-colcon-common-extensions python3-pip git wget
    

  4. Install necessary libraries

    curl -s --compressed "https://hamilton8415.github.io/ppa/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ppa.gpg >/dev/null
    sudo curl -s --compressed -o /etc/apt/sources.list.d/my_list_file.list "https://hamilton8415.github.io/ppa/my_list_file.list"
    sudo apt update
    sudo apt install libfshydrodynamics=1.3.1
    

Buoy Simulation Software Build

  1. Create a workspace, for example:

    mkdir -p ~/mbari_wec_ws/src
    cd ~/mbari_wec_ws/src
    

  2. Clone all source repos with the help of vcstool:

    wget https://raw.githubusercontent.com/osrf/mbari_wec/main/mbari_wec_all.yaml
    vcs import < mbari_wec_all.yaml
    cd ~/mbari_wec_ws
    

  3. Set the Gazebo version to Garden. This is needed because we're not using an official ROS + Gazebo combination (place this in ~/.bashrc for convenience if rebuilding often):

    export GZ_VERSION=garden
    

  4. Install ROS dependencies

    sudo pip3 install -U rosdep
    sudo rosdep init
    rosdep update
    rosdep install --from-paths src --ignore-src -r -y -i
    

  5. Build and install

    source /opt/ros/humble/setup.bash
    cd ~/mbari_wec_ws
    colcon build
    

The simulation software should build without errors. To run and test, proceed to the Run the Simulator tutorial series. Or run a quick test as described below to confirm all has worked as expected.

Run an example to test

  1. In a new terminal, source the workspace

    . ~/mbari_wec_ws/install/setup.bash
    

  2. Set SDF_PATH to allow robot_state_publisher parse the robot description from the sdformat model (place this in ~/.bashrc for convenience if rebuilding often):

    export SDF_PATH=$GZ_SIM_RESOURCE_PATH
    

  3. Launch the simulation

    ros2 launch buoy_gazebo mbari_wec.launch.py