ROS is a distributed system, but to be able to communicate all the machines in the robotic system must be correctly configurated.
At this stage of the system configuration we have two machines:
- NVidia Jetson TK1 that controls the robot onboard (IP 192.168.1.51 Host myzharbot)
- A “Console machine” that controls the robot remotely (IP 192.168.1.61 Host myzharbot-console)
For this configuration we assume that all the machines are mapped on the network with the following IP mask: 192.168.1.X. (your network router must be mapped with this mask, if not modify the configuration according to your network profile).
NVidia Jetson TK1
NVidia Jetson TK1 runs the core of the entire system.
- Change the hostname of the machine following the apposite guide.
Now MyzharBot can be referred on the network with its own name. - Assign an univocal IP address to the board:
- Open “System Settings” and select “Network”
- Open the current network clicking on the green arrow
- Click “Settings”
- Select tab “IPv4 settings”
- Select “Manual” in the “Method” combo-box
- Add the new IP address:
- IP: 192.168.1.51
- Netmask: 255.255.255.0
- Gateway: 192.168.1.1
- Add the following DNS (I use Google’s DNS):
8.8.8.8, 8.8.4.4 - Click save and exit
- Edit the “hosts” file to add information about the other machines on the network
-
sudo gedit /etc/hosts
- Add the “myzharbot-console” adding the following line to the list:
192.168.1.61 myzharbot-console
-
- Add ROS Environment variables:
- Edit “.bashrc”:
gedit ~/.bashrc
- Add the following lines at the end of the file:
export ROS_HOSTNAME=myzharbot export ROS_MASTER_URI=http://myzharbot:11311
- Edit “.bashrc”:
The Jetson is ready to run the “roscore”.
Console machine
The console machine runs the monitor nodes and the teleoperation nodes.
- [Optional] Change the hostname of the machine editing /etc/hostname as in the Jetson guide.
Now the console can be referred on the network with its own name: myzharbot-console.
[You can choose to not perform this step, but be aware to use the correct hostname instead of “myzharbot-console”] - Assign an univocal IP address to the PC:
- Open “System Settings” and select “Network”
- Open the current network clicking on the green arrow
- Click “Settings”
- Select tab “IPv4 settings”
- Select “Manual” in the “Method” combo-box
- Add the new IP address:
- IP: 192.168.1.61
- Netmask: 255.255.255.0
- Gateway: 192.168.1.1
- Add the following DNS (I use Google’s DNS):
8.8.8.8, 8.8.4.4 - Click save and exit
- Edit the “hosts” file to add information about the other machines on the network
-
sudo gedit /etc/hosts
- Add the “myzharbot” adding the following line to the list:
192.168.1.51 myzharbot
-
- Add ROS Environment variables:
- Edit “.bashrc”:
gedit ~/.bashrc
- Add the following lines at the end of the file:
export ROS_HOSTNAME=myzharbot-console export ROS_MASTER_URI=http://myzharbot:11311
- Edit “.bashrc”:
Now the console is ready to monitor and teleoperate MyzharBot
[Source: Nootrix – ROS NETWORKING]