建议全程在代理环境下进行! 加代理都麻烦的要死, 无代理建议换个方式, 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
/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
)删掉, 删除完成以后大概长这个样子
原因: 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
主要就是需要一个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="0" />
<arg name="max_message_size" default="None" />
<arg name="unregister_timeout" default="10" />
<arg name="websocket_external_port" default="None" />
<arg name="use_compression" default="false" />
<arg name="authenticate" default="false" />
<arg name="websocket_ping_interval" default="0" />
<arg name="websocket_ping_timeout" default="30" />
<arg name="websocket_null_origin" default="true" />
<arg name="topics_glob" default="[*]" />
<arg name="services_glob" default="[*]" />
<arg name="params_glob" default="[*]" />
<arg name="bson_only_mode" default="false" />
<!-- Output: screen, log -->
<arg name="output" default="screen" />
<!-- Valid options for binary_encoder are "default", "b64" and "bson". -->
<arg unless="$(arg bson_only_mode)" name="binary_encoder" default="default"/>
<group if="$(arg ssl)">
<node name="rosbridge_websocket" pkg="rosbridge_server" type="rosbridge_websocket" output="$(arg output)">
<param name="certfile" value="$(arg certfile)" />
<param name="keyfile" value="$(arg keyfile)" />
<param name="authenticate" value="$(arg authenticate)" />
<param name="port" value="$(arg port)"/>
<param name="address" value="$(arg address)"/>
<param name="retry_startup_delay" value="$(arg retry_startup_delay)"/>
<param name="fragment_timeout" value="$(arg fragment_timeout)"/>
<param name="delay_between_messages" value="$(arg delay_between_messages)"/>
<param name="max_message_size" value="$(arg max_message_size)"/>
<param name="unregister_timeout" value="$(arg unregister_timeout)"/>
<param name="use_compression" value="$(arg use_compression)"/>
<param name="websocket_ping_interval" value="$(arg websocket_ping_interval)" />
<param name="websocket_ping_timeout" value="$(arg websocket_ping_timeout)" />
<param name="websocket_external_port" value="$(arg websocket_external_port)" />
<param name="websocket_null_origin" value="$(arg websocket_null_origin)" />
<param name="topics_glob" value="$(arg topics_glob)"/>
<param name="services_glob" value="$(arg services_glob)"/>
<param name="params_glob" value="$(arg params_glob)"/>
</node>
</group>
<group unless="$(arg ssl)">
<node name="rosbridge_websocket" pkg="rosbridge_server" type="rosbridge_websocket" output="$(arg output)">
<param name="authenticate" value="$(arg authenticate)" />
<param name="port" value="$(arg port)"/>
<param name="address" value="$(arg address)"/>
<param name="retry_startup_delay" value="$(arg retry_startup_delay)"/>
<param name="fragment_timeout" value="$(arg fragment_timeout)"/>
<param name="delay_between_messages" value="$(arg delay_between_messages)"/>
<param name="max_message_size" value="$(arg max_message_size)"/>
<param name="unregister_timeout" value="$(arg unregister_timeout)"/>
<param name="use_compression" value="$(arg use_compression)"/>
<param name="websocket_ping_interval" value="$(arg websocket_ping_interval)" />
<param name="websocket_ping_timeout" value="$(arg websocket_ping_timeout)" />
<param name="websocket_external_port" value="$(arg websocket_external_port)" />
<param name="topics_glob" value="$(arg topics_glob)"/>
<param name="services_glob" value="$(arg services_glob)"/>
<param name="params_glob" value="$(arg params_glob)"/>
<param name="bson_only_mode" value="$(arg bson_only_mode)"/>
</node>
</group>
<node name="rosapi" pkg="rosapi" type="rosapi_node" output="$(arg output)">
<param name="topics_glob" value="$(arg topics_glob)"/>
<param name="services_glob" value="$(arg services_glob)"/>
<param name="params_glob" value="$(arg params_glob)"/>
</node>
</launch>
成品效果图: