webviz
webviz copied to clipboard
How to connect robot in Gazebo to WebViz
Could I connect a virtual robot such as the turtlebot in Gazebo to WebViz using WebSocketServer? If yes, how?
Yes, if you can get a rosbridge_server to work, then you can connect to it with Webviz. I don't know how to set that up with Gazebo though, might be worth asking the rosbridge people. Also feel free to join our Slack channel.
Yes, I know how to connect Gazebo to rosbridge. However I do not know how to use Webviz to connect Webviz to rosbridge_server.
Ah — we have a help page that is accessible in the app by clicking on the question mark in the top right. It explains a bit on how to configure the Websocket URL:
By default we try connect to a rosbridge_server using a WebSocket on
ws://localhost:9090
. If you want to use a different URL, use the?rosbridge-websocket-url=…
parameter. For example, to connect tows://localhost:4321
, use this URL. If you're using a more complex URL, it'd be good to url-encode it, for example like this. This also applies to other parameters mentioned below.
So yeah, typically you can take a URL like this: https://webviz.io/app/?rosbridge-websocket-url=ws://localhost:4321
and replace localhost
by the hostname or IP address of your ROS machine (if it's a remote one), and 4321
by the port number that you configured in rosbridge.
By the way, it might be necessary to click on a "Load unsafe scripts" button if the websocket server is in non-SSL mode. We should show a popup in that case that has this image in it:
But I've seen a bug before where that popup doesn't show up, so if that's the case let me know because I haven't been able to reproduce that, so your input would be helpful there.
Hi- I've managed to connect the websocket to Webviz but nothing is showing up! Also, I'm not receiving the popup.
Looks like stuff is appearing on /rosout at least. You might want to try opening the Raw Messages panel to look at your topics and if they look like what you expect. The 3d panel only works with RViz markers (and some other messages types like Pose.
How do I add Rviz markers?
I'd recommend getting RViz to work first and to use their guides. Once you have RViz markers working within RViz, you can click in the top left button of a 3d panel and enable those markers. You might also have to click on the little arrow in the right menu to select which TF you're following.
Meaning I have to run Rviz and Gazebo before running WebViz ?
Yeah I'd recommend trying to get it to work with RViz first. Webviz' 3d panel is supposed to be compatible with RViz, so if it works in RViz, then it should work in Webviz. If it then still doesn't work in Webviz, then it might be a bug.
I managed to get the map from Rviz to show in Webviz. Is there a way that the turtlebot could also be displayed there? As right now only the turtlebot's links (different parts) are being displayed.
Yeah, you'd have to publish an RViz marker to represent the turtlebot. We also support geometry_msgs/Pose
. Here's a current list of the message types that we support in the 3d panel: https://github.com/cruise-automation/webviz/blob/ed49a4c1757c3b6efa8f5d6e862333534453bf61/packages/webviz-core/src/hooksImporter.js#L86
I managed to get the map from Rviz to show in Webviz. Is there a way that the turtlebot could also be displayed there? As right now only the turtlebot's links (different parts) are being displayed.
Hello, I have the same problem, do you have any good solution?