Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ src/neural_depth/
src/neural_depth_ros2/
src/rviz_plugin_zed_od/
src/zed*/
src/orb_slam3_ros2/
tools/kalibr/
vendor/ORB_SLAM3/
vendor/zed-ros-interfaces/
vendor/zed-ros2-examples/
vendor/depth_anything_v2/
vendor/joystick_drivers/
external/

# Compiled files
compile_commands.json
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/headless-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,13 @@ jobs:
--name headless-test \
rumarino-headless:latest \
bash -c "
source /opt/ros/jazzy/setup.bash && \
source /opt/ros/humble/setup.bash && \
source /ros2_ws/install/setup.bash && \
ros2 launch bringup stonefish.launch.py \
mission_name:=prequalify \
auv_name:=hydrus \
env_file_name:=hydrus_env_headless.scn \
headless:=true \
fast_fixed_step:=true \
use_sim_time_stamps:=true \
realtime_factor_cap:=5.0 &
headless:=true &
LAUNCH_PID=\$! && \
sleep 15 && \
kill \$LAUNCH_PID 2>/dev/null || true
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ log
debug
target

# Local benchmark output
build_benchmark.log

# These are backup files generated by rustfmt
**/*.rs.bk

Expand All @@ -26,4 +29,9 @@ src/bringup/launch/depth_with_simulator.launch.py
__pycache__/
*.pyc

# Removed / local-only vision tooling
vendor/ORB_SLAM3/
vendor/stonefish/build/
vendor/stonefish/3rdparty/SDL2/


6 changes: 1 addition & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "vendor/stonefish"]
path = vendor/stonefish
url = https://github.com/patrykcieslak/stonefish.git
url = https://github.com/Rumarino-Team/stonefish.git
[submodule "vendor/stonefish_ros2"]
path = vendor/stonefish_ros2
url = https://github.com/Rumarino-Team/stonefish_ros2.git
Expand All @@ -10,10 +10,6 @@
[submodule "vendor/depth_anything_v2"]
path = vendor/depth_anything_v2
url = https://github.com/DepthAnything/Depth-Anything-V2.git
[submodule "vendor/vectornav"]
path = vendor/vectornav
url = https://github.com/dawonn/vectornav.git
branch = ros2
[submodule "vendor/joystick_drivers"]
path = vendor/joystick_drivers
url = https://github.com/ros-drivers/joystick_drivers.git
Expand Down
80 changes: 24 additions & 56 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,110 +1,78 @@
FROM ros:jazzy-ros-base
# syntax=docker/dockerfile:1
FROM ros:humble-ros-base

# Install dependencies matching README Ubuntu instructions
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
build-essential \
curl \
cmake \
git \
# Clang/LLVM (required for Rust ROS 2 bindings)
pkg-config \
libclang-dev \
llvm-dev \
clang \
# ROS 2 build tools
python3-colcon-common-extensions \
python3-rosdep \
# ROS 2 packages needed by stonefish_ros2
ros-jazzy-vision-msgs \
ros-jazzy-image-transport \
ros-jazzy-pcl-conversions \
ros-jazzy-pcl-ros \
# Stonefish dependencies (from README)
ros-humble-vision-msgs \
ros-humble-image-transport \
ros-humble-pcl-conversions \
ros-humble-visualization-msgs \
libfreetype6-dev \
libsdl2-dev \
libglm-dev \
libeigen3-dev \
libogre-1.9-dev \
libopencv-dev \
libssl-dev \
libboost-all-dev \
libepoxy-dev \
libtinyxml2-dev \
ros-jazzy-visualization-msgs \
libgl1-mesa-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV CARGO_TARGET_DIR=/ros2_ws/target

# Create workspace
WORKDIR /ros2_ws
COPY vendor/stonefish ./vendor/stonefish

# Build Stonefish library
RUN cd vendor/stonefish && \
mkdir -p build && cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig

# Copy only package.xml files for dependency caching
# Stonefish + package manifests (layer cache)
COPY vendor/stonefish ./vendor/stonefish
COPY src/interfaces/package.xml ./src/interfaces/package.xml
COPY src/bringup/package.xml ./src/bringup/package.xml
COPY src/bridge_stonefish/package.xml ./src/bridge_stonefish/package.xml
COPY src/mission_executor/package.xml ./src/mission_executor/package.xml
COPY src/detection_mocker/package.xml ./src/detection_mocker/package.xml
COPY vendor/stonefish_ros2/package.xml ./src/stonefish_ros2/package.xml

RUN rosdep init || true && \
rosdep update
RUN rosdep init || true && rosdep update

RUN bash -c "source /opt/ros/jazzy/setup.bash && \
rosdep install --from-paths src --ignore-src -r -y || true"
RUN bash -c "source /opt/ros/humble/setup.bash && \
rosdep install --from-paths src vendor/stonefish --ignore-src -r -y || true"

# build interfaces first
COPY src/interfaces ./src/interfaces
RUN bash -lc "source /opt/ros/jazzy/setup.bash && \
colcon build --packages-select interfaces --cmake-args -DCMAKE_BUILD_TYPE=Release"
RUN bash -lc "source /opt/ros/humble/setup.bash && \
colcon build --packages-select Stonefish interfaces \
--cmake-args -DCMAKE_BUILD_TYPE=Release"

# copy mission_executor files except actual src/mission_executor/src/*
COPY Cargo.toml Cargo.lock ./
COPY src/mission_executor/Cargo.toml ./src/mission_executor/Cargo.toml
COPY src/mission_executor/CMakeLists.txt ./src/mission_executor/CMakeLists.txt
RUN mkdir -p src/mission_executor/src && printf "fn main() {}" > src/mission_executor/src/main.rs

# add dummy main.rs to src/mission_executor/src/ so cargo allows building mission_executor
RUN mkdir -p src/mission_executor/src && \
printf "fn main() {}" > src/mission_executor/src/main.rs

# fetch and build dependencies for mission_executor
RUN bash -lc "source /opt/ros/jazzy/setup.bash && \
source install/setup.bash && \
colcon build --packages-select mission_executor --cmake-args -DCMAKE_BUILD_TYPE=Release"
RUN bash -lc "source /opt/ros/humble/setup.bash && source install/setup.bash && \
colcon build --packages-select mission_executor \
--cmake-args -DCMAKE_BUILD_TYPE=Release"

COPY src/bringup ./src/bringup
COPY src/bridge_stonefish ./src/bridge_stonefish
COPY src/detection_mocker ./src/detection_mocker
COPY vendor/stonefish_ros2 ./src/stonefish_ros2

# build ROS 2 workspace except interfaces and mission_executor
RUN bash -c "source /opt/ros/jazzy/setup.bash && \
colcon build \
--packages-select stonefish_ros2 bridge_stonefish bringup detection_mocker \
RUN bash -c "source /opt/ros/humble/setup.bash && source install/setup.bash && \
colcon build --packages-select stonefish_ros2 bridge_stonefish bringup detection_mocker \
--cmake-args -DCMAKE_BUILD_TYPE=Release"

# build mission_executor with actual source code
COPY src/mission_executor/src ./src/mission_executor/src
RUN ln -sf /ros2_ws/src/mission_executor/target /ros2_ws/target && \
bash -c "source /opt/ros/jazzy/setup.bash && \
source install/setup.bash && \
colcon build \
--packages-select mission_executor \
bash -c "source /opt/ros/humble/setup.bash && source install/setup.bash && \
colcon build --packages-select mission_executor \
--cmake-args -DCMAKE_BUILD_TYPE=Release"

# Set environment variables
ENV ROS_DOMAIN_ID=0

Loading
Loading