Multi-Machine Communication Setup
After installing Ubuntu VM on your host PC, the next step is to configure multi-machine communication between your host VM and the Jetson Nano. This allows your development computer to interact with the JetRacer remotely.
Overview
ROS (Robot Operating System) is designed to work across multiple machines, allowing you to:
- Run resource-intensive computations on your more powerful host PC
- Control the JetRacer remotely
- Visualize sensor data and debug information on your development machine
- Deploy code seamlessly between development and robot environments
In this guide, you'll learn how to:
- Configure network settings on both machines
- Set up ROS environment variables
- Test the multi-machine communication
- Troubleshoot common issues
Prerequisites
- Jetson Nano with ROS installed and connected to your network
- Ubuntu VM running on your host PC
- Both machines connected to the same network
Step 1: Determine IP Addresses
First, you need to know the IP addresses of both machines:
On Jetson Nano:
Look at the OLED display of the mainboard to see the IP (e.g., 192.168.1.100).
On Ubuntu VM:
ifconfig
Look for the ens33 or similar interface and note the IP address (e.g., 192.168.1.200).
Step 2: Configure Hosts File on Both Machines
You'll need to edit the hosts file on both machines to enable hostname resolution:
On Jetson Nano:
sudo nano /etc/hosts
Add the following lines:
127.0.0.1 localhost
127.0.1.1 jetson
192.168.1.100 jetson # Your Jetson Nano's IP
192.168.1.200 ubuntu # Your Ubuntu VM's IP
Save and exit (Ctrl+X, then Y, then Enter).
On Ubuntu VM:
sudo nano /etc/hosts
Add the following lines:
127.0.0.1 localhost
127.0.1.1 ubuntu
192.168.1.100 jetson # Your Jetson Nano's IP
192.168.1.200 ubuntu # Your Ubuntu VM's IP
Save and exit.
Step 3: Configure ROS Environment Variables
ROS needs to know which machine is the master and how to communicate between machines:
On Jetson Nano (ROS Master):
Edit the .bashrc file:
nano ~/.bashrc
Add these lines at the end:
export ROS_MASTER_URI=http://jetson:11311
export ROS_HOSTNAME=jetson
Apply the changes:
source ~/.bashrc
On Ubuntu VM:
Edit the .bashrc file:
nano ~/.bashrc
Add these lines at the end:
export ROS_MASTER_URI=http://jetson:11311
export ROS_HOSTNAME=ubuntu
Apply the changes:
source ~/.bashrc
Step 4: Test the Communication
Now let's test if the multi-machine communication is working:
On Jetson Nano:
Start the ROS master:
roscore
On Ubuntu VM:
Check if you can see the ROS master:
rostopic list
If you see a list of topics (even if it's just /rosout and /rosout_agg), the communication is working!
Step 5: Run a Test Example
Let's run a simple publisher/subscriber example to verify the communication:
On Jetson Nano:
Start an example receiving node:
rosrun rospy_tutorials listener
On Ubuntu VM:
Start an publishing receiving node:
rosrun rospy_tutorials talker
You should see "hello world" messages appearing repeatedly being received on the Jetson side.
Troubleshooting
Cannot Connect to ROS Master
-
Verify both machines can ping each other:
ping jetson # From Ubuntu VM
ping ubuntu # From Jetson Nano -
Verify ROS environment variables:
echo $ROS_MASTER_URI
echo $ROS_HOSTNAME
Connection Timeouts
- Make sure both machines are on the same network
- Check if the IP addresses have changed (common with DHCP)
- Update the hosts file if IP addresses change
References
For more detailed instructions, refer to the official Waveshare JetRacer ROS AI Kit Tutorial IV.