ROS Multiple Machines - penn-figueroa-lab/lab_wiki GitHub Wiki
Setup:
- Connect the PCs via Ethernet/Switch and set the following IPs Manually on every system with Netmask
255.255.255.0
- ROS Master
10.42.0.1
- ROS Client 1
10.42.0.2
- ROS Client 2
10.42.0.3
- To bashrc add:
gedit ~/.bashrc
- ROS Master:
export ROS_MASTER_URI=http://10.42.0.1:11311/
export ROS_IP=10.42.0.1
export ROS_HOSTNAME=ros_master
- ROS Client:
export ROS_MASTER_URI=http://10.42.0.1:11311/
export ROS_IP=10.42.0.2
export ROS_HOSTNAME=ros_master
Ensure that only theROS_IP
corresponds to the client, also bashrc must be edited for every PCUSER
.
- For all PCs, to /etc/hosts add
sudo gedit /etc/hosts
:10.42.0.1 ros_master
Test
- On ROS Master PC:
ping 10.42.0.2
or other client IP set manually, to check if packets are being received from the client. - On ROS Client PC:
ping 10.42.0.1
or other client IP set manually, to check if packets are being received from the master/client. - On ROS Master PC run
roscore
- On ROS Master PC run
rosrun rospy_tutorials talker.py
and on ROS Client runrosrun rospy_tutorials listener.py
, then switch the commands to check bi-directional communication - To check image or pointcloud transmission, connect camera to either PC then:
- On Camera PC run
roslaunch realsense2_camera rs_camera.launch
- On network PC run
rviz
add image or pointcloud topic to visualize orrostopic echo
corresponding topic
Debug
If you can ping between the machines but cannot run roslaunch with this setup, trying removing export ROS_HOSTNAME=ros_master