Skip to Content
BonicBot A2DevelopmentROS2 Development Setup — BonicBot A2

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 RobotOption 2: Develop on Your PC
Best forBeginners, quick testingCustom packages, simulations
Setup requiredNoneDocker + BonicBot image
Tools availableROS2 CLI, real hardwareRViz, Gazebo, Nav2, SLAM
Risk to robotDirect (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_IP

Replace ROBOT_IP with your robot’s actual IP address:

# Example ssh username@192.168.1.50

Enter 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/Twist
📖
ROS Development Walkthrough
Drive the robot, explore topics, and run your first simulation

Option 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

  1. Install WSL2 with Ubuntu:
    ➡️ WSL Installation Guide 

  2. 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:latest

Step 3 — Create the Development Container

⚠️ Run this only once. After creation, use docker start to reopen the container (see below).
The bonicbot-data volume 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:latest

Before 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:latest

Reopening 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 bash again 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-dev

What 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 $DISPLAY

If the output is empty, update WSL from PowerShell:

wsl --update

Then restart WSL.


⚠️ Docker: Permission Denied

sudo usermod -aG docker $USER

Then 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 bash

Next Steps

Ready to go deeper? Follow the complete hands-on guide:

🚀
ROS Development Walkthrough
Hands-on guide — teleop, simulation, RViz, and beyond
Last updated on