Repository for Polaris scripts to simulate sensors and control nodes.
- dive_test.py, example script to test dave setup.
- bladder_control_node, example node setup for the 2025 divetest. Fully integrated nodes setup can be found at polaris-ros2-divetest.
- Install DAVE, our custom fork containing the Polaris model.
Tip
Set up python dependencies, add to requirements.txt
:
pip install -r requirements.txt
Tip
Set up shell aliases, add to ~/.bashrc_aliases
:
alias jazzy='source /opt/ros/jazzy/setup.bash'
alias harmonic='source /opt/gazebo/install/setup.bash && export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python'
alias dave='jazzy && harmonic && source ~/dave_ws/install/setup.bash'
cd /home/loco/nautilus/polaris-dave-simulation
source /opt/ros/jazzy/setup.bash
colcon build --symlink-install
source install/setup.bash
Working example with Polaris custom dave code at this commit.
Terminal 1:
source /opt/ros/jazzy/setup.bash
source /opt/gazebo/install/setup.bash && export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python
source ~/dave_ws/install/setup.bash
source run.sh
Terminal 2:
source /opt/ros/jazzy/setup.bash
source install/setup.bash
ros2 run py_pkg dive_test
polaris-dave-simulation/
├── src/
│ └── py_pkg/
│ ├── py_pkg/
│ │ ├── dive_test.py
│ │ └── bladder_control_node/
│ ├── package.xml
│ └── setup.py
├── requirements.txt
└── run.sh
When adding new ROS2 nodes to this package, follow the structure of the existing bladder_control_node
:
- Create a new directory under
src/py_pkg/py_pkg/
for your node - Implement your node class inheriting from
rclpy.node.Node
- Add the entry point in
setup.py
:entry_points={ 'console_scripts': [ 'your_node_name = py_pkg.your_node_directory.main:main', ], }
- Rebuild the workspace with
colcon build
After making changes to the code:
# Navigate to workspace root
cd ~/nautilus/polaris-dave-simulation
# Source ROS2
source /opt/ros/jazzy/setup.bash
# Rebuild the package
colcon build --symlink-install --packages-select py_pkg
# Source the updated workspace
source install/setup.bash
Some useful debugging commands,
- To run nodes with additional debugging output:
ros2 run py_pkg your_node --ros-args --log-level debug
- To inspect active topics and nodes:
# List all topics
ros2 topic list
# Echo a specific topic
ros2 topic echo /your/topic/name
# List all nodes
ros2 node list
# Get info about a node
ros2 node info /your_node_name