Moves within the Servotor32 2.0 Firmware

I’ve gotten a bit familiar now with the PoMoCo python code, less so with the Servotor32 Arduino side…

And we use node.js at work and I know some folks are doing robotics stuff in javascript with node…

So for fun I started porting PoMoCo (sans GUI) to javascript with the thought of running it on the raspberry pi.

And it was going well (it was even kind of fun :slight_smile:) till I recognized how PoMoCo was using threads to let moves run simultaneously while syncing them through the “sericalHandler” thread to send the commands (interleaved) over the serial port.

Since node/javascript is strictly single threaded I had to start thinking at that point…

I’ve come up with a design I think can work, just using heartbeat timer to round robin between queues of move data all generated in the one thread.

But the exercise was making me question if I understand the tradeoffs between doing more on the python side versus more on the arduino side.

i.e. In theory entire moves consisting sequences of servo positions could be sent over the serial for the servotor32 to play out on the arduino side, if the servotor32 firmware were doing similar interleaving/simulated-multitasking kind of stuff - correct?

In fact this reminded me I’d seen http://arcbotics.com/2013/01/servotor32-2-0-firmware-update/ saying this about the 2.0 firmware:
“I can now generate moves with python code that you can copy-paste into the arduino code.”

But I haven’t seen that? This means a “move” like “wave”/“reset”/“dance” etc. would be generated as C code for inclusion in the firmware build? Is there docs or an example of doing that somewhere?