Resolve ROS2-specific issues with topics, nodes, and package discovery.
ROS2 topics not visible
Symptoms:
ros2 topic list shows nothing
- Nodes not communicating
The domain ID isolates ROS2 networks:echo $ROS_DOMAIN_ID
# Should output: 30
export ROS_DOMAIN_ID=30
All nodes must use the same ROS_DOMAIN_ID to communicate.
Ensure ROS2 environment is properly sourced:source /opt/ros/jazzy/setup.bash
source /workspace/turtlebot3_ws/install/setup.bash
# Or use: sb
You must source the workspace in every new terminal.
Verify simulation is running
Topics only appear when nodes are publishing them:ros2 node list
# Should see nodes if simulation is running
If no nodes are listed, start the simulation first with tb3_empty.
Package not found
Symptoms:
- “Package ‘turtlebot3_XXX’ not found”
- Cannot launch nodes
This usually means the workspace wasn’t built successfully or wasn’t sourced in the current terminal.
Rebuild workspace
cd /workspace/turtlebot3_ws
colcon build --symlink-install
source install/setup.bash
Verify package exists
ros2 pkg list | grep turtlebot3
ls /workspace/turtlebot3_ws/src
You should see all TurtleBot3 packages listed.Re-clone repositories if missing
cd /workspace/turtlebot3_ws/src
rm -rf turtlebot3*
bash /workspace/turtlebot3_ws/.devcontainer/post-create.sh
Build and compilation issues
Symptoms:
colcon build fails with errors
- Compilation errors
Remove build artifacts and rebuild from scratch:cd /workspace/turtlebot3_ws
rm -rf build install log
colcon build --symlink-install
Install missing dependencies
sudo apt update
rosdep update
rosdep install --from-paths src --ignore-src -r -y
This automatically installs all dependencies declared in package.xml files.
Build with verbose output
See detailed compilation messages:colcon build --symlink-install --event-handlers console_direct+
Build one package at a time
Isolate which package is failing:colcon build --packages-select turtlebot3_gazebo
Dependency errors
If you get errors about missing ROS2 packages:
# Update rosdep
rosdep update
# Install all dependencies
cd /workspace/turtlebot3_ws
rosdep install --from-paths src --ignore-src -y -r
# Install specific package if needed
sudo apt install ros-jazzy-<package-name>
Node communication issues
If nodes are running but not communicating:
- Check ROS_DOMAIN_ID matches across all terminals
- Verify DDS implementation:
echo $RMW_IMPLEMENTATION
# Should be: rmw_cyclonedds_cpp
- Check topic names - ensure publisher and subscriber use exact same name
- Verify message types match between publisher and subscriber
Service or action not available
If you get “service not available” or “action server not available”:
# List all available services
ros2 service list
# List all available actions
ros2 action list
# Check if the server node is running
ros2 node list
Make sure the node providing the service/action is actually running.
Nuclear option: Complete reset
When nothing else works:
Close VS Code
Exit VS Code completely.
Stop all containers
docker stop $(docker ps -aq)
Remove containers
docker rm $(docker ps -aq)
Remove volumes (optional)
This will delete container data. Your workspace files are safe but container configuration will reset.
Restart Docker Desktop
Quit and restart Docker Desktop completely.
Rebuild container
- Open project in VS Code
- Press F1 → “Dev Containers: Rebuild Container Without Cache”