Checking for network loss on TCPROS node

asked 2019-07-18 01:16:17 -0500

Tav_PG gravatar image

updated 2019-07-18 17:11:42 -0500

I have an android app. running ROSJava which upon connecting to a robot (Ubuntu 16.04.LTS, ROS Kinetic) will create a new node called android_controller. The Android app. controls the robot by publishing and subscribing to topics between the android app. and the robot. Another node called android_listener, created on the robot, will listen to what android_controller is doing and intercede where necessary.

I now what android_listener to know when there is a network disconnection, and android_controller is no longer connected (the android app. is no longer connected to the robot)

I found when I run roswtf after a network disconnection I get this:

ERROR Could not contact the following nodes:
 * /android/robot_controller

What I want is to do the same process as roswtf inside my android_listener node (C++). Does anyone have code to test for this?

edit retag flag offensive close merge delete