cruise-automation / webviz

web-based visualization libraries
https://webviz.io/
Apache License 2.0
2.05k stars 415 forks source link

Talking to webviz directly from non-ROS application #604

Open AndreiBarsan opened 3 years ago

AndreiBarsan commented 3 years ago

Hi WebViz team,

I am interested in using webviz for ad-hoc visualization tasks, e.g., quickly showing point clouds or images from a Python project that does not use ROS.

It seems like it would be possible to communicate with webviz by directly synthesizing, e.g., visualization messages in JSON and writing them to an appropriate websocket, without relying on ROS + rosbridge.

Are there any examples of code doing this? Is this even possible, or is it absolutely necessary to have a full instance of ROS running under the hood for visualizing things in webviz?

Thank you!

kwetril commented 3 years ago

Have the same problem, trying to implement my own writer for rosbag files without ros dependency for that.

shreyas2311 commented 3 years ago

@kwetril @AndreiBarsan Were you able to achieve this? It would be great to know.

amacneil commented 3 years ago

What format(s) are your data currently in?

shreyas2311 commented 3 years ago

@amacneil Thanks for the reply. I have my data stored in protobuf format.

AndreiBarsan commented 3 years ago

@shreyas2311 I was able to get this working by writing ROS messages to a websocket with roslibpy, and routing those to a running ROS instance via rosbridge, which was the instance that webviz connected to.

So this was still in a way relying on ROS, so not super clean. I was running ROS in its own container but this still had a fair bit of overhead.

amacneil commented 3 years ago

This is something we've been thinking about for foxglove/studio (fork of webviz). We really want to add support for non ROS formats.

However, it would really help to understand more specifically how your data is structured. For example, sensor_msgs/PointCloud2 is a standard message for storing point clouds in ROS. If you're storing point clouds in protobuf, what do the definitions look like? How would you expect to tell webviz how to decode your point cloud?