Our initial focus was to build a suite of these panels that corresponded to existing open source tools like rviz, rqt console, rqt_runtime_monitor, rostopic echo, and rqt_plot. With further development, we added custom panels outside the realm of existing tools to serve Cruise-specific needs. With our continued customizations and gradual migration away from legacy tools, these panels became more finely tuned to help our engineers solve their problems, while staying useful for people in the open source robotics community.
作者(被通用收购的cruise-automation)做webviz的目的是替代ROS中的一些可视化工具,例如rviz,rqt等。具体效果见上图,确实还是比较酷炫的,经过试用,我发现稳定性好,加载速度快,使用方便。
目前支持的功能:
- 浏览器拖进ROS bag,直接相当于play bag;
- ROS实时数据的绘制。
安装Webviz
下面是具体的安装和运行过程(运行环境ubuntu18.04)。
- 安装rosbridge_suite
Rosbridge provides a JSON API to ROS functionality for non-ROS programs. There are a variety of front ends that interface with rosbridge, including a WebSocket server for web browsers to interact with. Rosbridge_suite is a meta-package containing rosbridge, various front end packages for rosbridge like a WebSocket package, and helper packages.
Webviz和ROS之间是通过rosbridge_suite进行数据传递,如果要实时显示(不是用bag),则必须安装。
sudo apt-get install ros-<rosdistro>-rosbridge-suite
运行,launch中默认的websocket端口为9090,不用去更改,因为目前Webviz连接默认的端口就是9090。
roslaunch rosbridge_server rosbridge_websocket.launch
- 安装nodejs
参考https://github.com/nodesource/distributions/blob/master/README.md,不要安装最新的版本(v12.x编译不过),我安装的是v10.x,
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
- 编译webviz
下载代码,
git clone https://github.com/cruise-automation/webviz.git
编译,根目录执行,安装依赖,
npm run bootstrap
编译,
npm run build
执行,
npm run docs
执行完成后,会直接跳转到浏览器中(推荐用chrome)。
- 测试
实际测试的效果如下图所示,两个topic,一个是速腾的lidar,一个是gnss的位置(x默认是时间,也可以改为xy 形式)。