Cannot connect to ROS master running on mi PC from raspberry pi

조회 수: 10 (최근 30일)
Francisco Florido
Francisco Florido 2020년 4월 19일
답변: Tohru Kikawada 2020년 6월 2일
ERROR: Unable to communicate with master!
I am using Matlab 2019B and I have installed Raspbian GNU/Linux 9 in mi Raspberry Pi 3 board. The thing is that I create a ros master on mi PC and I try to connect to it from my Raspberry pi and it gives mi this error.
PC ip : 192.162.1.21
Raspberry Pi IP = 192.162.1.38
To create Matlab master on mi pc I use:
rosinit('NodeHost','192.168.1.21')
then I open a communication terminal using :
r = raspberrypi('192.168.1.38','pi','raspberry');
openShell(r)
then trough this terminal I oppened I type:
$ source ~/catkin_ws/devel/setup.bash
$ export ROS_MASTER_URI=http://192.168.1.21:11311
$ rostopic echo /rosout
This las one is to subscribe to the topic /rosout that the matlab master creates when using rosinit.
This is when I get the error.
ERROR: Unable to communicate with master!
I thought it could be a firmware problem but when I ping mi rspberry from mi PC there is no problem and neither the other way.
I apreciated if anyone could help me
thanks in advance.

답변 (1개)

Tohru Kikawada
Tohru Kikawada 2020년 6월 2일
Please try to set the following environment variable on your Raspberry Pi as disscussed here.
$ export ROS_HOSTNAME=192.168.1.100 # Raspberry Pi's IP address. This should be reached from your PC

카테고리

Help CenterFile Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by