rosbag record over network
Hi
Is it recommended or common to record bags over a network? That is to store the bag file on a machine within the local network. Suppose the robot recording the bag was connected to the network over WiFi, would there be sufficient bandwidth for bag recording though? Suppose the resolution is 640x480 at 30fps.
It really depends on your network and the rate at which you're trying to record data into your rosbag. The compressed rosbag structure will take up less space than the original topics, so it should be more bandwidth efficient to run
rosbag record
on your robot and the save the file to a network drive, than it would for rosbag to subscribe to the same topics over the network.If you can tell us a bit more about your setup and what types of topics you need to record and we can let you know if it's realistic or not.
@PeteBlackerThe3rd Thanks. I was thinking to record the minimal needed for a XYZRGB point cloud, thus these topics:
camera/depth_registered/image_raw camera/depth_registered/camera_info camera/rgb/image_raw camera/rgb/camera_info
My reading is that
camera/depth_registered/image_raw
is 2 bytes per pixel andcamera/rgb/image_raw
is 1 byte per pixel. At 640 x 480 @30fps, that's 26MB/s. Not sure how muchcamera_info
needs. For 802.11n, perhaps that's a bit too much?camaera/rgb/image_raw
will be 3 bytes per pixel, one each for red, green and blue. You really want to use the compressed version of these topics if you're sending the data over a wi-fi network. The last time I checked there isn't any compression support for 16 bit mono (i.e. depth) images in ROS.rosbag can use zip compression as it creates a bag file though. You can test this by recording a short test bag on your robot and then calculating it's data rate. This will give you a good idea if it's possible to stream over your wi-fi.
I'm giving it a try now, but I'm not sure if I'm doing it right. Am I meant to run
roscore
on the network machine, setROS_MASTER_URI
tohttp://ip:11311
and run the camera driver androsbag record
on the robot? Strangely I'm not getting any recording though.Regarding your issue of not getting any recording you might take a look at the ROS NetworkSetup tutorial.
From your brief problem description I am guessing that there might be no full two way connectivity. You can easily check that by trying to subscribe to one topic published on your remote master from the command line. If this does not work either you know it is a network issue. In order to record bag files or more generally subscribe to topics published on a remote machine, the hostnames of all participating machines have to be resolvable.
While setting
ROS_MASTER_URI
is sufficient to view all available topics, it might be also necessary toexport ROS_IP=<IP Address>
on the local PC you are using for recording the bagfile.A different option would be setting
ROS_HOSTNAME
explicitly on you local machine and add the host name to/etc/hosts
file on the ...(more)I've got it working now. The network connection is definitely not good enough...