how to receive topics via an IP address?

asked 2022-09-23 11:55:47 -0500

RH56 gravatar image

updated 2022-09-25 09:36:02 -0500

(my adapted text) I am running on Arduino 'TCPHelloWorld' which publishes "hello world" through a topic called 'chatter': https://answers.ros.org/question/4068...

For speed reasons, I don't use USB. Instead I connect the Arduino directly to my Ubuntu PC with an ethernet cable. Having no home network involved, there is no local IP address generated. Therefore I entered a local IP address manually in my Ubuntu PC in the yaml file: /etc/netplan/50-cloud-init.yaml

So now my configuration is:

Ubuntu ROS PC (192.168.0.178) |--------ethernet cable --------| Arduino(192.168.177)

ping works fine to both addresses

In /opt/ros/noetic/setup.bash , I have configured:

export ROS_MASTER_URI=http://192.168.0.178:11411
export ROS_IP=192.168.0.178

I then run roscore. Then, when I type: rostopic list I get: Unable to communicate with master

Anyone who can tell me to make a correct one-to-one ethernet connection with a single cable?

Thanks a lot.

edit retag flag offensive close merge delete

Comments

It seems that your ROS master is running on a remote PC, i.e., 192.168.0.177. Therefore, you need to set ROS_MASTER_URI and ROS_IP environment variables using the appropriate IP addresses on both sides. Furthermore, make sure your firewall is not blocking those calls. For more information, please check [1] and [2].

ravijoshi gravatar image ravijoshi  ( 2022-09-23 12:09:11 -0500 )edit

Please show us the source code for this arduino app. I believe it is rare (impossible?) to run full ros on an arduino, so people instead use rosserial. Is this app a rosserial client?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-09-24 09:49:07 -0500 )edit

Hi, Mike. This is the code I am running on the Arduino: https://github.com/ros-drivers/rosser... The IP address in the shield settings is the address I am able to ping from my Ubuntu ROS computer

RH56 gravatar image RH56  ( 2022-09-25 04:57:23 -0500 )edit
1

github.com/ros-drivers/rosserial /blob/noetic-devel/ rosserial_arduino /src/ros_lib/examples/

Please do a web search to learn how to set up rosserial.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-09-25 08:06:54 -0500 )edit

While I agree it would help @RH56, it's not really nice to post a (more polite version of) RTFM.

If we feel the rosserial documentation could help @RH56, we should point out a specific example or section of the documentation.

rosserial has a rather extensive Tutorials section on the wiki. Perhaps that would help the OP.

If you've already read/seen those @RH56, please clarify which part(s) didn't work for you, or was (were) unclear. I have to agree with @Mike Scheutzow reading your post it seems like you haven't looked up the documentation, as that should have made it clear rosserial works in a different way from "regular ROS 1", and the terminology/concepts you're using/refering to don't apply/work there.

gvdhoorn gravatar image gvdhoorn  ( 2022-09-26 06:13:57 -0500 )edit