RobotWebTools / ros2-web-bridge

Bridging your browser to the ROS 2.0
Apache License 2.0
209 stars 68 forks source link

Using ros2-web-bridge for Node-Red implementation #168

Open a-pastore opened 3 years ago

a-pastore commented 3 years ago

Hello all,

i would like to ask you if anyone here already has experience with the connection between ROS2 and node-red. I was hoping to use the ros2-web-bridge in combination with the following node-red-module to create a web-based joystick, for instance.

node-red-contrib-ros

The following system is used in a VM:

Can someone please assist with the following confusion? Is it enough to directly access the websocket ws://127.0.0.1:9090 to access the ROS2 Topics? Or does the ros2-web-bridge differ in this respect from the ROSbridge based on this tutorial?

The connection status of the Node-Red pub/sub indicates a successful connection. Unfortunately, ROS2 messages neither get in nor out. After connecting for the first time, the following is output in the webbridge terminal:

(node:13026) DeprecationWarning: Deep requiring likeconst uuidv4 = require('uuid/v4');is deprecated as of uuid@7.x. Please require the top-level module when using the Node.js CommonJS module or use ECMAScript Modules when bundling for the browser. See https://github.com/uuidjs/uuid#deep-requires-now-deprecated for more information.

Thank you for your time

minggangw commented 3 years ago

Theoretically, I think it's feasible to use ros2-web-bridge to replace the ROS bridge because ros2-web-bridge is designed to be compatible with roslibjs and follows the rosbridge v2 protocol.

The warning you mentioned is not critical, please try to run the ros2-web-bridge:

DEBUG=ros2-web-bridge* node bin/rosbridge.js

to find any meaningful output. For Node.js, I suggest you upgrade to v12.20.1.

vkuehn commented 3 years ago

@a-pastore interesting project ! It looks like you are using an older node version. Look here Node Red Supported Versions. Maybe you want to forward ROS2 as an issue to https://github.com/namgk/node-red-contrib-ros ?