ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

Webviz now supports live robots!

Hey everyone, I’m the tech lead on the Webviz project at Cruise. If you’re not familiar, Webviz is a web-based tool for robotics visualization, with functionality similar to RViz, rqt_runtime_monitor , rqt_plot , rqt_image_view , rostopic echo , and rqt_console. More about our motivation to build Webviz here and here.

Up until now you could only use Webviz to view bag files (either by dragging them in or streaming them from cloud storage). Now we’ve released an integration with roslibjs, which means that you can connect to a rosbridge_server over a WebSocket to use the tool with live systems.

To set up a rosbridge_server, see their tutorial. Then just open the Webviz page, and by default it will connect to ws://localhost:9090. See the help page in the top right of the tool for how to change this URL.

webviz.io/try screenshot

We hope that this will make our tool a lot more useful! As always, we welcome feedback of all forms: bug reports, feature suggestions, better documentation, etc. Please open an issue on our Github page, or submit a PR.

Happy holidays! :christmas_tree::santa::turtle:

20 Likes

Hi, it looks like a test with a remote host fails with this error for me:

Mixed Content: The page at ‘blob:https://webviz.io/f2029644-5a97-42ed-ae1f-8130519697d0’ was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint ‘ws://robot:9090/’. This request has been blocked; this endpoint must be available over WSS.
(anonymous) @ f2029644-5a97-42ed-ae1f-8130519697d0:1
f2029644-5a97-42ed-ae1f-8130519697d0:1 Uncaught DOMException: Failed to construct ‘WebSocket’: An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
at blob:https://webviz.io/f2029644-5a97-42ed-ae1f-8130519697d0:1:1133

You might want to catch and display this error.

Starting chrome with “–allow-running-insecure-content” seems to be a workaround (Yes, currently too lazy to configure wss).

Ah interesting, which version of rosbridge_server do you use? I expected to see an error like this when I tested it myself, but I didn’t, because it looks like the latest rostbridge_server supports secure connections. I’d love to reproduce this and show instructions in the UI on how to fix this.

This is rosbridge_server from kinetic, tag 0.11.3. I guess one have to configure rosbridge to enable wss. At least the certificates/keys I guess. I have not done this (yet).

That’s helpful, thanks. You should be able to work around it for now by allowing unsafe connections in Chrome:

WssErrorModal

This should be fixed — an dialog with instructions should be surfaced now if you run into this issue. Let me know if you still have problems with this! Thanks for reporting!

Excited for your work in this area! Looking forward to taking it for a spin on a live robot this week!

And thanks for what might have been a holiday push to get 299 (dec 26 eh?) :slight_smile: and this announcement out! :slight_smile:

Awesome!

looking forward to it.

This is awesome @janpaul123! Was there any key takeaways or surprises from the roslibjs integration? Is there anything you wish was different?

Good question. I ran into a little bug and I wish that I could make a single call to get message types. Oh and it would be cool if rosbag play could host a service so we can control it with our timeline UI (but that’s unrelated to roslibjs :slight_smile: ).

But most importantly I’d like to get the messages in their raw binary format instead of serialized as CBOR. This is because everywhere else in Webviz we use raw ROS messages, and having just one binary format to deal with makes things quite a bit simpler. We particularly care because we’d like to defer deserialization as late as possible, e.g. in WebWorkers or even in WebAssembly, for performance reasons. Having just one format would help a lot with this.

What do you think about that? In our proprietary websocket server, we send messages in the following format: <version number> <topic number> <(simulated) receive time sec> <(simulated) receive time nsec> <raw ros message binary>. And before we start receiving messages we first receive a list of all topics and types (similar to getTopics and getMessageDetails) but where each topic is assigned a number (for <topic number>) above, and also we send the raw .msg definitions since we already have functionality for parsing those and using them to read raw ROS messages. In other words, I’d like the rosbridge_server to do less than it’s doing now, just pass through raw data. :wink:

It would be useful to mirror some of that in roslibjs / rosbridge_server. I’d be happy to work on PRs if someone could point me in the right direction or be available for questions. It would help a lot in our upcoming work of making Webviz more performant in the browser.

In any case, it was overall pretty easy to get roslibjs working with our application, so thanks everyone who has worked on that!!

Yes, I get the unsafe warning now, thanks.

1 Like

I made a PR to rosbridge_server and roslibjs with something similar to what I described above. If you could have a look at those PRs, then that would be super helpful. They basically fix everything that I wish was different.

I just tested out the webziv.io, and rosbridge_websocket is now using 100% cpu churning out the error message:

rosbridge_websocket: [callback]: Exception calling subscribe callback: ‘str’ object has no attribute ‘slots

Any idea? Google doesn’t know.

1 Like

Oof, not sure about that! Might be worth filing an issue with rosbridge. But also, the PRs that I posted above should circumvent anything that has to do with “slots” entirely, I think, so hopefully we can get those in soon.

Have the same issue as you.
Also tf transforms don’t work for me. The tf messages arrive with all the frames, but showing different sensor data in base_link for example doesn’t work.

Let’s hope the PR is fixing this.

Ah weird. If you want to see if this is a problem with Webviz or with the websocket bridge, you could record the messages using rosbag record, and then drag the resulting bag into Webviz, and then see if it works.

If that still doesn’t work, then there is likely a bug in Webviz. In that case it would be super useful if you could share that bag with us, and describe what you see vs the expected behaviour, so we can do some debugging. :slight_smile:

Jan, I recorded a bag. How can I send you it please?

My email is johnflux@gmail.com

So are you seeing the same issue with the bag then? My email address is jp.posma@getcruise.com, feel free to send it there :+1:

Thank you for the awesome live feature.

Is there any plan to add more topic visualization (Path, Pose, PoseArray, etc. )

Not currently but feel free to contribute!