Replaying a rosbag on a static website

I’d like to load a rosbag file on a static website and play it back. I wonder if it is possible or if someone has done it before.

I am aware of roslibjs, which requires a network connection to a backend. That’s a little different.

I’m thinking about a way to replay a rosbag right inside the browsing context, without any network connection (i.e. load the file into the client from a static file server, then emulate playback).

This would be great for making demos on static websites requiring only static servers to serve the client (and rosbag files).

For example, one could store the website HTML file and rosbag files on Amazon S3 or Google Cloud Storage, serve them statically, then the HTML app would be able to fetch the rosbag files and play them in the browser. One could then, for example, make a WebGL rendering.

If you know of something, or have any ideas, it would be interesting to hear.

Hi @trusktr have you tried looking into Webviz?

Webviz would definitely help here. There is also https://avs.auto/ although I haven’t used that one.

Who would be the user of the website? Do you want them to be able to interact with the bag at all, or just display a static playback layout? If the latter, rendering to video might be easier.

Have you seen Rosbag Bazaar? One of the speakers had mentioned it in the Weekly Robotics community meeting: https://youtu.be/nNWgXSi-lds?t=1335. I didn’t test the package yet so I’m not sure it does exactly what you need.

WHOA. That’s cool. Do you know the author? Can you put me in touch with them?

@Cam_Buscaron @amacneil @msadowski Thanks you all! Those tools are interesting. In particular the ability that webviz has in that it can playback a rosbag from a static file is what I’m looking for.

What I already have is a custom visualization system at Velodyne (not released yet). It currently runs in Electron and uses rosnodejs to receive topic messages (deserialized to JS objects) that I can then pass to the graphics system.

What I’m looking for is something like rosnodejs (which passes deserialized JS objects into my callback) but rather than it being connected as an actual ROS node, it would simply be reading a rosbag file.

It seems rosbag.js (from webviz) might be what I need: it can load a rosbag file from anywhere then play it.

It is not clear if it will be able to give me JS objects based on custom message types (f.e. those generated using catkin).

I will have to try it out.

EDIT: I tried topics with standard messages using rosbag.js, and the object format is exactly as expected, the same as rosnodejs. So I can call my standard-message handling callbacks using either of the tools just the same (good for live vs dev/testing).

I still need to see what happens with custom messages.