Ros does not receive data from MATLAB publishing topics
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I use ubuntu18.04 melodic ros and matlabR2021a.
My linux operate system IP is: 172.20.10.3
My windows operate system IP is: 172.20.10.11
First, in my linux operate system:
I set the
explore ROS_MASTER_URI = https://172.20.10.3:11311
explore ROS_HOST_NAME = 172.20.10.3
explore ROS_IP = 172.20.10.3
Then, I start the "roscore" in my linux.
Second, in my windows10 operate system:
I use the matlab and set
setenv('ROS_MASTER_URI','http://172.20.10.3:11311/')
setenv('ROS_HOSTNAME','172.20.10.11')
setenv('ROS_IP','172.20.10.11')
rosinit()
Then, in the matlab terminal, use
ros topic list
could see all the ros topic in the matlab terminal.
Then, I run the code in the matlab
chatterpub = rospublisher('/chatter',rostype.std_msgs_String)
chattermsg = rosmessage(chatterpub)
chattermsg.Data = 'hello world'
send(chatterpub,chattermsg)
pause(5)
in the ros terminal, i can see the topic '/chatter', when i use 'topic echo /chatter', the ros can't receive the data 'hello world'.
To sum up, i can see all the topic list and topic node in the matlab and ros, but ros can't receive the data from matlab.
How do i deal withe this problem?
0 Kommentare
Antworten (1)
praguna manvi
am 29 Nov. 2024
It seems you are unable to receive messages echoed from MATLAB using "rostopic." Here is a link to a useful discussion thread on a similar issue. You could troubleshoot by using regular "ping" in both directions and follow the detailed steps in the link below:
0 Kommentare
Siehe auch
Kategorien
Mehr zu ROS Network Connection and Exploration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!