ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

rostopic publish message to remote machine?

asked 2014-01-16 02:23:06 -0500

Hendrik Wiese gravatar image

Hi folks,

I'm trying to connect to ROS running on a remote machine. I can remotely echo the topics from the machine however I cannot publish anything.

rostopic echo /odom

works like a charm, printing all the odom messages published by the remote ROS on my local laptop.

rostopic pub /cmd_vel geometry_msgs/Twist -- "<some twist="" data="">"

however does not. I have traced the communication using Wireshark and all I can see are some registerService, registerPublisher and getParam commands. My message however doesn't arrive. I've also tried to simply publish a std_msgs/String to a topic called /blubb. But even that does not work. I cannot see the message itself on the network (however I can see the mentioned remote procedure calls) and thus it doesn't arrive at the remote machine.

ROS_IP is set to the remote machine's IP on both machines. ROS_MASTER_URI is set to http://<remoteip>:11311 on both machines.

netcat works, rostopic echo does, rqt_plot does, even rviz does using the remote connection. I just can't send messages to the remote machine.

Any idea what might be wrong?

Thanks a lot!

Cheers, Hendrik

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-01-16 02:56:45 -0500

dornhege gravatar image

I think you've got the meaning of ROS_IP wrong. ROS_IP is to be set to each machine's ip, where a node is running. It is not something like ROS_MASTER_URI!

So, if you have machine a at 10.1.1.1 and machine b at 10.1.1.2, each node running on a must have ROS_IP 10.1.1.1 and each node on machine b ROS_IP 10.1.1.2. The reason is that machines need to be able to connect forth and back. That is why some connections work (in one direction), while others don't.

edit flag offensive delete link more

Comments

1

See http://wiki.ros.org/ROS/NetworkSetup for an overview of networking setup.

tfoote gravatar image tfoote  ( 2014-01-16 06:18:44 -0500 )edit

I see, I see. Thanks a lot! That has solved this problem.

Hendrik Wiese gravatar image Hendrik Wiese  ( 2014-01-18 04:01:25 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-01-16 02:23:06 -0500

Seen: 5,446 times

Last updated: Jan 16 '14