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

ROS Noetic Master on Ubuntu 20.04 PC cannot be reached by ROS Melodic Node on Ubuntu 18.04 BeagleBone

asked 2020-06-14 03:38:02 -0500

robotogo gravatar image

updated 2020-06-15 03:21:44 -0500

gvdhoorn gravatar image

Using an Ubuntu 18.04 PC with ROS Melodic and a BeagleBone with Ubuntu 18.04 and ROS Melodic everything works fine. I am now testing a Ubuntu 20.04 PC with ROS Melodic. If I run the ROS Master on the BeagleBone (still Ubuntu 18.04 and ROS Melodic) the PC can communicate with the BeagleBone via ROS.

But if the ROS Master is runnung on the PC the BeaglBone ROS Melodic does not find this ROS Master. Ping commands between these two machines work fine and the Variables like ROS_MASTER_URI are correctly set. I have a similar Problem if I run Simulink with the latest ROS Toolbox on my PC.

Is it possible in general, that ROS Noetic can communicate with a ROS Melodic Master but not the other way around? Do I need to have ROS Noetic also on the BeagleBone?


Edit: Thanks for your quick response: On the BeagleBone (BB) I flashed a ready to use image from elinux.org https://elinux.org/Beagleboard:Beagle... On the PC I first installed Ubuntu 20.04 and the ROS Noetic via apt-get.

The PC and BB are connected via USB (virtual IP-connection ethernet over USB). Pings from both sides work fine.

Here detailed informations:


ROS Master (Noetic 1.15.7) on Ubuntu 20.04 PC:

export ROS_MASTER_URI=http://192.168.6.1:11311
export ROS_HOSTNAME=192.168.6.1

Output command "roscore":

... logging to /home/master/.ros/log/4300ceee-aed7-11ea-ba2a-b7f88a7d75c9/roslaunch-ssdtogo-4503.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.6.1:40083/
ros_comm version 1.15.7


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.7

NODES

auto-starting new master
process[master]: started with pid [4513]
ROS_MASTER_URI=http://192.168.6.1:11311/

setting /run_id to 4300ceee-aed7-11ea-ba2a-b7f88a7d75c9
process[rosout-1]: started with pid [4523]
started core service [/rosout]

ROS Node (Melodic 1.14.3) on Ubuntu 18.04 BeagleBone:

export ROS_MASTER_URI=http://192.168.6.1:11311
export ROS_HOSTNAME=192.168.6.2

Output command "rosrun srp_init gpio_talker.py":

GPIO-Talker starting...
[ERROR] [1592205938.965650]: Unable to immediately register with master node [http://192.168.6.1:11311]: master may not be running yet. Will keep trying.

Source code gpio_talker.py:

#!/usr/bin/env python
#-*- coding: utf-8 -*-
## Simple talker reading P9_11 (GPIO 30) and publishing
## value as UInt8 on topic 'gpio_val'


import rospy
import Adafruit_BBIO.GPIO as GPIO

from std_msgs.msg import UInt8

def talker():
    pub = rospy.Publisher('gpio_val', UInt8, queue_size=10)
    rospy.init_node('GPIOTalker', anonymous=False)
    rate = rospy.Rate(10)
    GPIO.setup("P9_11", GPIO.IN)
    print('GPIO setup done...')
    while not rospy.is_shutdown():
        gpio_val = GPIO.input("P9_11") # int value returned
        #rospy.loginfo('Talker: GPIO value = ' + str(gpio_val))
        pub.publish(gpio_val)
        rate.sleep()

if __name__ == '__main__':
    try:
        print('GPIO-Talker starting...')
        talker()
    except rospy.ROSInterruptException:
        print('ROSInterruptException')
        pass
    finally:
        GPIO.cleanup() # Bewirkt unexport
        print('...Pin disabled.')
        print('Byebye...')
edit retag flag offensive close merge delete

Comments

I am now testing a Ubuntu 20.04 PC with ROS Melodic

Built from source? Or do you mean: I'm trying to exchange messages between ROS Noetic on Focal (20.04) with Melodic on Bionic (18.04)?

Ping commands between these two machines work fine and the Variables like ROS_MASTER_URI are correctly set

Please include the values of those variables here, so we can make sure.

As to the rest of your problem description: you'll need to tell us which messages or services aren't working for you. There could well have been changes, but without knowing which messages you're attempting to use, no one can help you.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-14 05:46:54 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-06-17 10:33:48 -0500

robotogo gravatar image

updated 2020-06-18 14:05:11 -0500

Problem solved: The (new?) Ubuntu 20.04 firewall was blocking the ROS communication

Thanks for the quick and competent answers.

In the end I followed the suggestions how to debug the network connection as proposed in http://wiki.ros.org/ROS/NetworkSetup. Doing this I realized, that ping worked but I could not establish a connection using netcat -l 11311 on the PC and netcat 192.168.6.1 11311 on the BeagleBone. Hence it became clear that my BeagleBone could not reach his ROS-Master via ROS_MASTER_URI=http://192.168.6.1:11311/ :-(

My problem came up because I switched from Ubuntu 18.04 to 20.04 on the PC. Honestly I never heard anything about a firewall on Ubuntu 18.04. But actually on Ubuntu 20.04 a firewall is set active by default. But it is possible to deactivate the Ubuntu 20.04 firewall:

master@ssdtogo:~/Work$ sudo ufw status
Status: Aktiv
master@ssdtogo:~/Work$ sudo ufw disable
Firewall gestoppt und beim Systemstart deaktiviert
master@ssdtogo:~/Work$ sudo ufw status
Status: Inaktiv

Now everything works fine. Has anybody any suggestions how to safely deactivate the Ubuntu 20.04 firewall - I mean to only set an exception for the ROS communication?

edit flag offensive delete link more
0

answered 2020-06-15 12:55:49 -0500

sloretz gravatar image

Is it possible in general, that ROS Noetic can communicate with a ROS Melodic Master but not the other way around? Do I need to have ROS Noetic also on the BeagleBone?

Different distros of ROS (Noetic, Melodic, Kinetic, etc) are not guaranteed to be able to communicate with each other. I would install the same version of ROS on both machines.

If you'd like to try it anyways, there might be useful information in these:

I'm surprised it works one direction but not the other. Since the value being set in ROS_HOSTNAME is an IP address, it might be better to use ROS_IP instead.

http://wiki.ros.org/ROS/EnvironmentVa...

edit flag offensive delete link more

Comments

Seeing as the OP is trying to publish UInt8 and that message hasn't changed between Noetic and Melodic, I suspect something else is going wrong here -- other than the regular "incompatible messages" cause of inter-ROS-version incompatibility.

The "Unable to immediately register with master node" message is probably something to look into.

@robotogo: perhaps looking at a Wireshark capture while starting these scripts could provide some insight. It could tell you whether the node on the Beaglebone is even getting to the ROS Master or not.

The ROS_HOSTNAME vs ROS_IP hint by @sloretz is a good one. Don't use ROS_HOSTNAME with IPs.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-15 13:18:25 -0500 )edit

Question Tools

Stats

Asked: 2020-06-14 03:37:13 -0500

Seen: 2,720 times

Last updated: Jun 18 '20