hadabot / hadabot_main

Content used in collaboration with various Hadabot blog posts to get guide you through learning ROS2.
https://blog.hadabot.com
GNU General Public License v3.0
37 stars 19 forks source link

Command latency with micropython firmware #4

Closed dsryzhov closed 2 years ago

dsryzhov commented 3 years ago

Hi,

I've tried your hadabot software stack. (content/p7) It works for me. But there is a lattency for user commands (issued from teleop page). Because of the latency car is not responsive to user commands. I don't yet understand the reason.

Webbridge work well for the messages from teleop to ros. ros2 topic echo /hadabot/cm_vel shows commands from teleop without a latency. But firmware reacts to commans with a latency.

To understand more I've tried to use another esp32 firmware based on Micro-ROS. In this case additional ros2 node is started (micro-ros agent) and communication with esp32is handeled by this node (but not with web-bridge) Communication between esp32 and micro-ros agent is over UPD (over WiFi) In this case all works great. Car is fully responsive.

As a result I assume that source of the problem in the following list

I've tried to exclude micropython from this and implemented websockets using Arduino IDE (C++). Unfortunately I have some problem with this experiment. Connecttion from this firmware to websocket is not stable and droped.

Do you also have a latency wih your micropython firmware? I assume not but not understand how to use it by my self.

Regards, Dmitry

jackpien commented 2 years ago

Hi Dmitry, it's been a while since you posted this. Wanted to close the issue. For our current stack - MicroPython + WebSockets over TCP - we do experience a 100ms latency. For fast speeds, that latency can be very problematic.

Not sure if you saw the ROS Discourse post about an agent-less DDS layer for the ESP32 but that actually looks very interesting.

Will keep this issue open for additional notes. Feel free to add any updates on your end. Thx

jackpien commented 2 years ago

Actually, unless you feel otherwise, will close this issue and track the new agent-less DDS layer progress from https://github.com/hadabot/hadabot_main/issues/13