源码编译运行webviz
建议全程在代理环境下进行! 加代理都麻烦的要死, 无代理建议换个方式, linux就用rviz, windows考虑用foxglove吧
此外, 我尝试在arm架构使用webviz, 但是尽管编译成功, 但是出不了图, 看不到相关消息, 如果有大佬知道为什么还请不吝赐教!
git clone https://github.com/cruise-automation/webviz.git
cd webviz
sudo apt install npm
npm run bootstrap
npm run build-static-webviz
# 运行webviz
npm run serve-static-webviz
TroubleShooting
报错 /usr/bin/git ls-remote -h -t + 仓库名
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/davidswinegar/chartjs-plugin-datalabels.git
解决:
cd packages/webviz-core
vim package-lock.json
使用/git+ssh 查找所有带git+ssh的字段, 切换为 https://
举个例子
git+ssh://git@github.com/troygibb/react-mosaic.git#860c8d70ba3c723be07bc6208f0d05e2c3f2915f
# 把前面的 git+ssh://git@ 换成 https://
https://github.com/troygibb/react-mosaic.git#860c8d70ba3c723be07bc6208f0d05e2c3f2915f
报错 sha 512 xxxxxxxx 验证不通过
cd packages/webviz-core
vim package-lock.json
通过/chart.js 查找 chart.js并将括号中的验证行(integrity)删掉, 删除完成以后大概长这个样子

报错 path = process.cwd(); Error: ENOENT: no such file or directory, uv_cwd
原因: nodejs版本太低, 10.19不行, 要升级到12
# 在下面这行命令执行的过程中会有警告, 因为12也是老版本, 需要等待20s以后才执行该命令, 再等60s以后才开始正式刷新源
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
webviz显示实时运行的信息
主要就是需要一个rosbridge的协助, rosbridge默认的端口为0.0.0.0:9090, 需要修改的话, 建议自建一个rosbridge.launch
# 下载rosbridge
sudo apt update
sudo apt install ros-<rosdistro>-rosbridge-suite
# 不需要改端口直接按下面的指令就可以
roslaunch <自己的包> <自己的launch>
roslaunch rosbridge_server rosbridge_websocket.launch # 在0.0.0.0:9090启动rosbridge
cd /path/to/webviz #切换到webviz目录
npm run serve-static-webviz
如果需要修改ip以及端口, 示例launch文件如下, 这是默认的rosbridge_websocket.launch, 只是修改了地址, 建议不要改端口, 因为webviz监听的是9090, 而我不知道怎么改webviz的端口emmmm
注: rosapi这个node不要删, 因为webviz会通过rosapi去获取消息的类型, 从而显示在浏览器上
<launch>
<arg name="port" default="9090" />
<arg name="address" default="10.168.2.183" />
<arg name="ssl" default="false" />
<arg name="certfile" default=""/>
<arg name="keyfile" default="" />
<arg name="retry_startup_delay" default="5" />
<arg name="fragment_timeout" default="600" />
<arg name="delay_between_messages" default


2817

被折叠的 条评论
为什么被折叠?



