esimkowitz / sphero-rvr-ros2

Containerized ROS2 Node for Sphero RVR
Other
3 stars 1 forks source link

Use an executor loop in rvr_node and update robot_control to use WebSocket #15

Closed esimkowitz closed 1 year ago

esimkowitz commented 1 year ago

Adding an executor loop at 100 Hz in the rvr_node package to check for changes to the robot state and send commands to the RVR. This will ensure that we can down-sample the commands to the RVR to prevent overloading the serial connection.

Also updating the robot_control package to use a WebSocket instead of XMLHttpRequest to communicate between the browser and the Flask server. This involved some finessing but this discussion page was extremely helpful!

I've also moved the robot_control static files and templates into the package, which allowed me to remove the ros2_ws/src folder from the final container image. In a future PR, I'm going to see if I can slim it down even further by only copying over the built packages.