Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5d6e74c
Add ball simulation
JuanDelPueblo Jul 26, 2025
83eba22
Fix stonefish library not being recognized by intellisense
JuanDelPueblo Jul 26, 2025
66984f4
Add ocean (untested because WSL2 broke)
JuanDelPueblo Jul 26, 2025
14b82c2
Add working hydrus model
JuanDelPueblo Aug 3, 2025
6f6aec4
Define Hydrus robot with thrusters in XML file for compatibility with…
JuanDelPueblo Aug 4, 2025
a82e28c
Merge branch 'main' into stonefish
JuanDelPueblo Aug 10, 2025
654b75f
Add Docker image for simulation
JuanDelPueblo Aug 28, 2025
26ceba2
Move existing simulation files to standalone
JuanDelPueblo Aug 28, 2025
db8b2d6
Add ros 2 stonefish package to git
JuanDelPueblo Aug 28, 2025
f4e9d24
Finish implementing ros 2 container with working simulation
JuanDelPueblo Aug 28, 2025
b42bdb6
Add README.md with instructions for running the simulation
JuanDelPueblo Sep 2, 2025
cb6c96e
Add thruster control instructions to README and update scenario file …
JuanDelPueblo Sep 2, 2025
22015f7
Merge branch 'main' into stonefish
JuanDelPueblo Sep 4, 2025
0374035
Add simulation Docker entrypoint for easier running
JuanDelPueblo Sep 4, 2025
87eb32e
Add thruster teleop node to control simulation thrusters
JuanDelPueblo Sep 4, 2025
dafbfa0
Adjust material so sub doesn't sink
JuanDelPueblo Sep 4, 2025
4ab17e2
Adjust material density
JuanDelPueblo Sep 4, 2025
575cbcf
Remove standalone sim
JuanDelPueblo Sep 18, 2025
11e909a
Improve thruster teleop and make it easier to run
JuanDelPueblo Sep 18, 2025
f33a371
Simplify docker compose file
JuanDelPueblo Sep 18, 2025
5e9a155
Add IMU and Camera (to be tuned)
JuanDelPueblo Sep 18, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ best.pt
.venv-formatters
autonomy/src/autonomy.egg-info
hydrus_software_stack.egg-info
*build/

# Generated by Cargo
# will have compiled files and executables
Expand Down
17 changes: 17 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/include/Stonefish/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
53 changes: 27 additions & 26 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"python.autoComplete.extraPaths": [
"/home/catkin_ws/src/hydrus-software-stack/scripts",
"/catkin_ws/devel/lib/python3/dist-packages",
"/opt/ros/noetic/lib/python3/dist-packages"
],
"python.analysis.extraPaths": [
"/home/catkin_ws/src/hydrus-software-stack/scripts",
"/catkin_ws/devel/lib/python3/dist-packages",
"/opt/ros/noetic/lib/python3/dist-packages"
],
"pyrefly.trace.server": "verbose",
"editor.hover.enabled": true,
"editor.snippetSuggestions": "inline",
"python.testing.unittestArgs": [
"-v",
"-s",
"./test",
"-p",
"*_test.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"files.associations": {
"*.hss": "yaml"
}
}
"python.autoComplete.extraPaths": [
"/home/catkin_ws/src/hydrus-software-stack/scripts",
"/catkin_ws/devel/lib/python3/dist-packages",
"/opt/ros/noetic/lib/python3/dist-packages"
],
"python.analysis.extraPaths": [
"/home/catkin_ws/src/hydrus-software-stack/scripts",
"/catkin_ws/devel/lib/python3/dist-packages",
"/opt/ros/noetic/lib/python3/dist-packages"
],
"pyrefly.trace.server": "verbose",
"editor.hover.enabled": true,
"editor.snippetSuggestions": "inline",
"python.testing.unittestArgs": [
"-v",
"-s",
"./test",
"-p",
"*_test.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"files.associations": {
"*.hss": "yaml"
},
"cmake.ignoreCMakeListsMissing": true
}
2 changes: 2 additions & 0 deletions docker/amd64/cpu/hydrus.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ RUN apt-get update && apt-get install -y \
ros-noetic-image-transport \
ros-noetic-laser-proc



COPY ./devices/Arduino/HydrusModule /root/Arduino/libraries/HydrusModule

COPY ./ /catkin_ws/src/hydrus-software-stack
Expand Down
4 changes: 4 additions & 0 deletions docker/simulation/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
colcon build --symlink-install
source install/setup.bash
ros2 launch hydrus_sim_ros2 hydrussim.launch.py
45 changes: 45 additions & 0 deletions docker/simulation/simulation.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM osrf/ros:humble-desktop-full-jammy
RUN apt-get update

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get upgrade -y && \
apt-get install -y \
libglm-dev \
libfreetype6-dev \
libsdl2-dev \
python3-colcon-common-extensions \
python3-rosdep \
python3-vcstool \
python3-ament-package \
ros-humble-ament-cmake

# Setup Stonefish

WORKDIR /home/

RUN git clone https://github.com/patrykcieslak/stonefish
RUN cd stonefish && mkdir build && cd build && cmake .. && make -j$(nproc) && sudo make install

# ROS 2 workspace setup
SHELL ["/bin/bash", "-c"]

ENV ROS_WS=/home/ros2_ws

RUN mkdir -p /${ROS_WS}/src \
&& echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc

WORKDIR $ROS_WS/

RUN cd src \
&& git clone https://github.com/juandelpueblo/stonefish_ros2.git

RUN source /opt/ros/humble/setup.bash && colcon build --symlink-install \
&& source install/setup.bash

WORKDIR $ROS_WS/

COPY docker/simulation/entrypoint.sh .
COPY docker/simulation/thruster_teleop.sh .

CMD ["bash", "entrypoint.sh"]
19 changes: 19 additions & 0 deletions docker/simulation/simulation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
simulation:
build:
context: ../../../hydrus-software-stack
dockerfile: docker/simulation/simulation.Dockerfile
privileged: true
runtime: nvidia
environment:
- DISPLAY=${DISPLAY}
- PYTHONUNBUFFERED=1
ulimits:
nofile:
soft: 1024
hard: 524288
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- ../../simulation/hydrus_sim_ros2:/home/ros2_ws/src/hydrus_sim_ros2
stdin_open: true
tty: true
3 changes: 3 additions & 0 deletions docker/simulation/thruster_teleop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
source install/setup.bash
ros2 run hydrus_sim_ros2 thruster_teleop
13 changes: 13 additions & 0 deletions simulation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# How to run:

Docker is required to run the simulation along with a Linux install (WSL works but very slow). An Nvidia GPU is also highly recommended.

1. Go to docker/simulation folder

2. Run `docker compose -f simulation.yaml run simulation`. This will launch a window with the simulation.

To control thrusters, follow these steps after running the simulation:

1. Run `docker compose -f simulation.yaml run simulation /bin/bash` in another terminal window/tab to gain access to the shell.

2. Run `ros2 topic pub /hydrus_thrusters std_msgs/msg/Float64MultiArray "{layout: {}, data: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]}"`. The first 4 are the corner thrusters while the last 4 are the depth thrusters.
Loading
Loading