Duckiebot Remote Connection
Contents
Duckiebot Remote Connection#
Have you ever wanted to work from home but your robot is in the lab?
In this guide, we will show how to access your Duckiebot from anywhere in the world using ZeroTier.
ZeroTier is a free, powerful and easy-to-use tool that creates a virtual private network (VPN), allowing devices to communicate as if they were on the same local network, no matter where they are physically located.
We will walk through the following steps:
Installing ZeroTier on the Duckiebot
Installing ZeroTier on your host computer
Creating a ZeroTier network
Joining the network from both the Duckiebot and host computer
Testing connectivity between your Duckiebot and host computer
Running a ROS container using
dts
and accessing the Duckiebot remotelyVerifying ROS topic communication
Step 1: Install ZeroTier on the Duckiebot#
To install ZeroTier on your Duckiebot:
SSH into your Duckiebot:
ssh duckie@<duckiebot_ip_address>
Install ZeroTier:
curl -s https://install.zerotier.com | sudo bash
Step 2: Install ZeroTier on Your Host Computer#
The host computer is the device used to remotely access your Duckiebot.
To install ZeroTier on your host computer:
Install ZeroTier:
curl -s https://install.zerotier.com | sudo bash
Install ZeroTier via Homebrew:
brew install zerotier-one
Start the ZeroTier service:
sudo zerotier-cli join <network_id>
Download and install ZeroTier from here.
Once installed, open the ZeroTier application.
Step 3: Create a ZeroTier Network#
Now that ZeroTier is installed on both your Duckiebot and host computer, the next step is to create a network.
Go to the ZeroTier Central website and sign up for an account if you do not already have one.
Once logged in, click on “Create a Network.”
Take note of the
network ID
as you will need it in the next steps.
Step 4: Join the Network#
On the Duckiebot:#
SSH into your Duckiebot (if not already connected).
Join the network using the ZeroTier CLI:
sudo zerotier-cli join <network_id>
On the Host Computer:#
Open a terminal or the ZeroTier application.
Join the network using the ZeroTier CLI or GUI:
sudo zerotier-cli join <network_id>
Go back to your ZeroTier Central and approve the devices that are requesting to join the network by selecting the checkbox next to their address and clicking ‘Authorize’. The
Auth
field will turn to a green checkbox ✅.
Step 5: Test Connectivity#
To verify that both your Duckiebot and host computer are connected to the ZeroTier network, try pinging your Duckiebot from your host computer:
Find the ZeroTier-assigned IP address of your Duckiebot by connecting through ssh and running:
sudo zerotier-cli info
The output will be a string of the type:
200 info XXXXXXXXXX 1.14.0 ONLINE
where
XXXXXXXXXX
will be the IP address assigned to your Duckiebot by ZeroTier.On your host device list the peers and verify that the IP address of your Duckiebot is in the list:
sudo zerotier-cli listpeers | grep LEAF
You can also check the ZeroTier Central dashboard for the IP address.
Ping your Duckiebot from your host computer:
ping <your_duckiebot_name>.local
If you receive responses, then your Duckiebot and host computer are successfully connected via ZeroTier.
Step 6: Start a ROS Container Using dts
#
Now that your Duckiebot and host computer are connected, you can start a ROS container on your Duckiebot and interact with it remotely.
On your host computer, start the ROS gui tools container:
dts gui <robot_name>
Replace
<robot_name>
with the name of your Duckiebot.
This command will launch a Docker container with ROS, and the GUI will be forwarded to your local machine. You will be connected to the Duckiebot’s ROS environment.
Step 7: Verify ROS Topic Communication#
To verify that you’re able to listen to ROS topics, use the following commands:
List ROS topics:
rostopic list
Subscribe to a topic (e.g.,
<your_robot_name>/camera_node/image/compressed
):rostopic echo <your_robot_name>/camera_node/image/compressed
If you see the topic data being printed in your terminal, then you have successfully set up remote access to your Duckiebot via ZeroTier.
Visualize images (stop the
rostopic echo
by pressing CTRL+C ):rqt_image_view
and in the drop-down menu select the
<your_robot_name>/camera_node/image/compressed
topic.
Conclusion#
By following these steps, you can access your Duckiebot from anywhere in the world using ZeroTier. This setup allows you to interact with your Duckiebot as if it were on your local network, enabling remote development and debugging.
Whether you are conducting experiments, collecting data, or developing new features, this remote access capability will be precious.