Open AlexandreHiroyuki opened 1 month ago
"fxxxx" - forward + time with 4 characters in milliseconds "bxxxx" - backward time with 4 characters in milliseconds
Encoding the messages with binary should be considered instead of using native strings from JS. Currently, each type of message requires its conversion method, sometimes it's reusable, but sending the wrong type on JS can break the workflow, and it is an error that doesn't show up on compilation time.
It's possible to work the current way, maybe it's a good refactoring to pay attention to the future.
Since each module requires procedural execution (order matters), but blocking execution between tasks isn't desirable, I chose to approach the problem with an Active Object design pattern.
A message pump would be undesirable because certain messages require a previous one to be fully executed (like timed engine movements) before it pops out of the queue, blocking other messages that don't need to wait for others to be executed.
https://stackoverflow.com/questions/43529031/websockets-and-text-encoding To assign a misunderstanding, despite JS working with UTF-16 strings, the WebSocket protocol defines that UTF-8 must be used in communication.
https://stackoverflow.com/questions/10229156/how-many-characters-can-utf-8-encode With this knowledge in our hands, we can address another misunderstanding about how Unicode formatting works: UTF-8 does not work with a fixed size of bytes for a character, it varies from 1 to 4 bytes.
https://datatracker.ietf.org/doc/html/rfc3629#section-3 A character written with multiple bytes is defined by the most significant bits of each byte.
Goal
Make the robot react to a simple test command from the LLM.
Web
Embedded