Ros nodes and losing WIFI connection
We have a mobile device (an Odroid) with a camera that runs a ROS node that publishes the camera data. We interface the device by SSHing into it via its WiFi dongle. We want to record a dataset while moving outdoors, i.e. where the device loses its WiFi connection.
We try do this the following way:
ssh odroid@[odroid ip]
screen
roscore &
roslaunch my_pkg camera_node.launch
[ctrl-A, d] # detach the screen
screen
rosbag record /my_camera_topics
[ctrl-A, d] # detach the screen
[ctrl-D] # close SSH session
When we return to the WiFi area, we reconnect to the device via SSH, which has automatically re-established the network connection. We see both screens open and attaching to them shows that both the camera node and the rosbag recroding are still going on.
The problem is that the recording is incomplete. The rosbag simply ends at a point which we assume to coincide with the moment the device lost the network connection. The ROS_IP environment variable is set to the (static) IP this device has, but the problem persists if ROS_IP is left unset.
How can we record complete datasets in this kind of scenario?
Would the same thing happen if you automatically started roscore and rosbag using an automated script that doesn't involve ssh'ing in and detaching?
Can the robot successfully ping its own hostname after the wifi is lost? ROS likes to be able to ping its own hostname.
Thanks for the reply. I haven't tried pinging the hostname. However, I found that the bags are (almost always) complete if I do the above procedure with ROS_IP unset and then remove the WIFI dongle. At the end of the dataset, I re-attach the dongle and SSH in to stop the logging.
Yes. Unsetting ROS_IP does ring a bell. I think I've had to do that before.