ROS2 Development Setup — BonicBot A2
New to ROS2? Start by connecting directly to the robot via SSH — no installation needed.
Want simulations or advanced tools? Jump to setting up a Docker dev environment.
Choose Your Approach
| Option 1: SSH into Robot | Option 2: Develop on Your PC | |
|---|---|---|
| Best for | Beginners, quick testing | Custom packages, simulations |
| Setup required | None | Docker + BonicBot image |
| Tools available | ROS2 CLI, real hardware | RViz, Gazebo, Nav2, SLAM |
| Risk to robot | Direct (use carefully) | Safe — test before deploying |
Option 1: Connect to the Real Robot via SSH
The fastest way to start. No installation needed — just SSH in and run ROS2 commands directly on the robot.
Connect
ssh username@ROBOT_IPReplace ROBOT_IP with your robot’s actual IP address:
# Example
ssh username@192.168.1.50Enter the robot’s password when prompted. You’re now in the robot’s terminal.
Try These ROS2 Commands
# See all active topics
ros2 topic list
# Stream live laser scan data
ros2 topic echo /scan
# List all running nodes
ros2 node list
# Send a velocity command to move the robot
ros2 topic pub /cmd_vel geometry_msgs/msg/TwistOption 2: Development Environment (Docker Setup)
Use this approach when you need:
- RViz — 3D visualization
- Gazebo — robot simulation
- Navigation2 — autonomous navigation
- SLAM — mapping and localization
Docker gives you a ready-to-use ROS2 environment without manually managing dependencies. Your workspace is stored in a Docker-managed volume (bonicbot-data) that persists across container recreations — no data loss if you accidentally recreate the container.
Step 1 — Install Docker
Pick your operating system:
Linux
Install Docker Engine:
➡️ Docker Engine Installation Guide
Windows
-
Install WSL2 with Ubuntu:
➡️ WSL Installation Guide -
Install Docker Desktop:
➡️ Docker Desktop for Windows
Important: Run all Docker commands inside the Ubuntu WSL2 terminal, not PowerShell or CMD.
macOS
Install Docker Desktop:
➡️ Docker Desktop for macOS
Step 2 — Pull the BonicBot Docker Image
docker pull autobonicsofficial/bonicbot:latestStep 3 — Create the Development Container
⚠️ Run this only once. After creation, use
docker startto reopen the container (see below).
Thebonicbot-datavolume is created automatically by Docker if it doesn’t exist — no setup needed.
Linux
docker run -it \
--name bonicbot-dev \
--network host \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ~/bonicbot-data:/root \
autobonicsofficial/bonicbot:latestBefore launching Gazebo or RViz for the first time, run:
xhost +local:docker
Windows (WSL2 Ubuntu Terminal)
docker run -it \
--name bonicbot-dev \
--network host \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ~/bonicbot-data:/root \
autobonicsofficial/bonicbot:latest
macOS
docker run -it \
--name bonicbot-dev \
-v ~/bonicbot-data:/root \
autobonicsofficial/bonicbot-a2:latestReopening the Container
You only create the container once. Every subsequent session:
# Start the container
docker start bonicbot-dev
# Open a terminal inside it
docker exec -it bonicbot-dev bash💡 Need multiple terminals? Run
docker exec -it bonicbot-dev bashagain in a new terminal window — each call opens an independent shell inside the same container. This is common in ROS2 development.
Stopping the Container
When you’re done developing:
docker stop bonicbot-devWhat You Can Do Inside the Container
Once inside, your full development environment is ready:
- 🤖 Run Gazebo simulations
- 🗺️ Build maps with SLAM
- 🧭 Test Navigation2 workflows
- 📊 Visualize with RViz
- 🔧 Write and test ROS2 packages — connect to the real robot or run in simulation
Troubleshooting
⚠️ Gazebo or RViz window doesn't open
Linux
Run the following, then restart the container:
xhost +local:docker
Windows WSL2
Check if WSLg display is configured:
echo $DISPLAYIf the output is empty, update WSL from PowerShell:
wsl --updateThen restart WSL.
⚠️ Docker: Permission Denied
sudo usermod -aG docker $USERThen reboot or log out and back in.
⚠️ "Container name already in use" error
The container already exists — don’t create a new one. Just start the existing one:
docker start bonicbot-dev
docker exec -it bonicbot-dev bashNext Steps
Ready to go deeper? Follow the complete hands-on guide:
🚀