node-red-contrib-flowake-ros-nodes 1.2.0
A node-red interface for ROS Bridge
node-red-ros-nodes
This is a Node-RED implementation for connecting to ROS bridge. It is based on roslibjs, the standard ROS Javascript for ROS bridge library. https://github.com/RobotWebTools/roslibjs and on the https://github.com/namgk/node-red-contrib-ros contribution. It extends previous node-red-contrib-ros introducing the ability to create services. Publish and subscribe any type of ROS message
install configuration ROS server is the normal websocket address. E.g ws://localhost:9000/
Sample flow
[{"id":"c3aa1150.f668","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6622adb4.ebfc24","type":"ros-subscribe","z":"c3aa1150.f668","server":"cc1970d2.60d8f","topicname":"/node_red_subscriber","x":230,"y":140,"wires":[["192904f1.41274b"]]},{"id":"3d16a449.eebabc","type":"ros-publish","z":"c3aa1150.f668","server":"cc1970d2.60d8f","topicname":"/node_red_publisher","msgtype":"std_msgs/String","x":580,"y":280,"wires":[]},{"id":"2d4449a8.a77b26","type":"comment","z":"c3aa1150.f668","name":"Subscribe","info":"","x":80,"y":80,"wires":[]},{"id":"c975e150.87ace","type":"comment","z":"c3aa1150.f668","name":"Publish","info":"","x":70,"y":220,"wires":[]},{"id":"e62caad3.00e9b8","type":"inject","z":"c3aa1150.f668","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"node-red","payloadType":"str","x":200,"y":280,"wires":[["63f50f3f.86b11"]]},{"id":"d17b8f2c.13a3d","type":"comment","z":"c3aa1150.f668","name":"Service Server","info":"","x":100,"y":340,"wires":[]},{"id":"9d964dd9.51005","type":"ros-adv-service","z":"c3aa1150.f668","server":"cc1970d2.60d8f","servicename":"/node_red_service_server","srvtype":"/std_srvs/SetBool","x":250,"y":400,"wires":[["ebf9d10b.b8217"]]},{"id":"ebf9d10b.b8217","type":"function","z":"c3aa1150.f668","name":"","func":"\nnode.warn('Incoming request: ' + msg.payload.args.data);\n\nconst response = {\n success: true,\n message: 'node_red_response'\n};\n\nmsg.payload.msg = response;\nmsg.payload.id = msg.payload.id;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":400,"wires":[["7a1e5114.8ee2e"]]},{"id":"192904f1.41274b","type":"function","z":"c3aa1150.f668","name":"","func":"node.warn(msg.payload.data);\n\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":440,"y":140,"wires":[]},{"id":"7a1e5114.8ee2e","type":"ros-resp-service","z":"c3aa1150.f668","server":"cc1970d2.60d8f","servicename":"/node_red_service_server","srvtype":"/std_srvs/SetBool","x":710,"y":400,"wires":[]},{"id":"993b5822.bf8b48","type":"comment","z":"c3aa1150.f668","name":"Service Client","info":"","x":90,"y":480,"wires":[]},{"id":"f038eacd.f22c78","type":"ros-call-service","z":"c3aa1150.f668","server":"cc1970d2.60d8f","servicename":"/node_red_service_client","srvtype":"/std_srvs/SetBool","x":610,"y":540,"wires":[["ba9b8bf7.155118"]]},{"id":"63f50f3f.86b11","type":"function","z":"c3aa1150.f668","name":"","func":"msg.payload.data = \"node_red_publisher\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":370,"y":280,"wires":[["3d16a449.eebabc"]]},{"id":"c1ac881a.7b5978","type":"inject","z":"c3aa1150.f668","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"node-red","payloadType":"str","x":190,"y":540,"wires":[["c9118319.d4db5"]]},{"id":"c9118319.d4db5","type":"function","z":"c3aa1150.f668","name":"","func":"msg.payload.data = true;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":540,"wires":[["f038eacd.f22c78"]]},{"id":"ba9b8bf7.155118","type":"function","z":"c3aa1150.f668","name":"","func":"node.warn(msg.payload.message);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":540,"wires":[[]]},{"id":"cc1970d2.60d8f","type":"ros-server","url":"ws://localhost:9090"}]