ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As mentioned by @MCornelis you need to spin the ROS node. Your invocation of node.socketio.run(node.app) does not run any of the ROS threads. ROS nodes are not flask Nodes.

I recommend you go through the basic python tutorials here: https://index.ros.org/doc/ros2/Tutorials/Writing-A-Simple-Py-Publisher-And-Subscriber/

As mentioned by @MCornelis you need to spin the ROS node. Your invocation of node.socketio.run(node.app) does not run any of the ROS threads. ROS nodes are not flask Nodes.

I recommend you go through the basic python tutorials here: https://index.ros.org/doc/ros2/Tutorials/Writing-A-Simple-Py-Publisher-And-Subscriber/

Update:

With your original one which uses the rclpy.spin(node) there's nothing processing the Flask app's threads. You need to provide threads for both of them. So that both the Flask app and the rclpy node have threads to do their work. You can't do just one or the other.