Robotics StackExchange | Archived questions

how to connect to ros master running on rasberry pi

I have a desktop computer running ros noetic on ubuntu 20.04 and a rasberry pi with the same setup, they are both connected to the same wifi

Asked by bribri123 on 2021-08-07 23:12:46 UTC

Comments

Answers

I believe these tutorials are all you need ( Network Setup, Multiple Machines ), however, if you need anything more comment here and I update the answer.

Asked by Teo Cardoso on 2021-08-08 01:52:29 UTC

Comments

Hi there,

In the most simple setup, you need to tell the Raspberry Pi that it is the ROS master and also to tell itself, what is its IP address. For this, execute the following lines in a terminal or add them to the .bashrc file in your home directory, assuming your Raspberry Pi has the IP address 192.168.22.14.

export ROS_MASTER_URI=http://192.168.22.14:11311
export ROS_IP=192.168.22.14
export ROS_HOSTNAME=192.168.22.14

Now you can start the ROS core in the Raspberry Pi.

Next, you need to tell the second computer, what is the IP address of the ROS master and what is its own IP address. Assuming, the IP address of the second device is 192.168.22.36, you can execute the following commands in a terminal and then run the ROS node that you like to run on that device.

export ROS_MASTER_URI=http://192.168.22.14:11311
export ROS_IP=192.168.22.36
export ROS_HOSTNAME=192.168.22.36

This should allow you to have the Raspberry set up as the ROS master and the second device communicate with the ROS master remotely.

Asked by dave on 2021-08-09 15:42:14 UTC

Comments