0
$\begingroup$

Rosanswers logo

so i have a raspberry pi and a pc both runing ros ,the publisher and the subscriber are both located in the raspberry pi when i rosrun the both nodes with the rasberry pi being the master everthing works the two nodes can communicate but when i change the master uri on the raspberry pi with the ip of the other pc and launch the two nodes the subscriber code can't subscribe it returns nothing


Originally posted by med97 on ROS Answers with karma: 3 on 2020-11-07

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This is a very common issue, which is why I've created a gist script to set it up correctly, together with some troubleshooting steps: https://gist.github.com/chfritz/8c2adab45a94e091be77c55b0432ad2e.


Originally posted by chfritz with karma: 553 on 2020-11-07

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by med97 on 2020-11-07:
thank you sir it worked , the problem was that i did not set the ROS_HOSTNAME and ROS_IP for both pi and pc

Comment by chfritz on 2020-11-07:
Glad it helped! Please don't forget to upvote the answer.

Comment by gvdhoorn on 2020-11-08:
@chfritz: thank you for answering the question, but could you please not post link-only answers? If/when your gist changes or disappears (and this does happen more frequently than you might think), this answer will lose all its value.

It would be great if you could include the relevant parts from your gist here in your answer, and then also explain what users are seeing, such that it becomes less of a magic incantation they'll just copy-paste.

Comment by chfritz on 2020-11-08:
Hi Gijs, I know what you are getting at, but at the same time we do this sort of thing all the time when we point people at a package or some other ros tool that solves their problem. Granted, packages are perhaps better maintained than gists (perhaps!), but certainly in both cases the benefit is that the outside resource can continue to improve. Maybe the best option would be to move the snippet of my gist over to the ros wiki somewhere? Do you think that would be better?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.