ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can query the NodeHandle using the "connected" function:
if (nh.connected())
{
// do something here
}
It returns a bool as to whether the connection is still active, but be aware there is a timeout before we "break" the connection.