MarginallyClever / Robot-Overlord-App

Simulation and control software for robots
https://www.marginallyclever.com/
GNU General Public License v2.0
168 stars 49 forks source link

Smalltalk (scripting language) interpreter in Java > drive robot #217

Open i-make-robots opened 9 months ago

i-make-robots commented 9 months ago

Is your feature request related to a problem? Please describe. Jon would like to drive his robots using Smalltalk "as though it was in a ROS node". This implies that nodes should talk to each other with the ROS system.

JonHylands commented 9 months ago

I don't have enough experience with ROS to say whether or not this is true... The current controller of my robots (running on a Raspberry pi) is written in Squeak Smalltalk, and does not have anything to do with ROS.

i-make-robots commented 9 months ago

@JonHylands awesome. Have you got Smalltalk samples of your current work? I'm interested in the API you use to drive motors and read sensors.

JonHylands commented 9 months ago

For Roz and MicroRaptor, it is very simple - everything other than their respective cameras are on a serial bus. The servos for each robot are Robotis Dynamixel servos, AX-12s to be specific. Each servo has its own unique id (1-252), and they are all daisy chained on a serial bus. Also on this serial bus are a couple STM32F405 boards, which have specific sensors attached (IMU, Optical flow, ToF LIDAR, etc). The 405 boards run MicroPython, and I've written code that allows the 405 to be presented on the bus as just another serial device. Each device on the bus has a control table, and in the case of the 405's, the control table contain sensor values that are updated at some refresh rate (might be 50Hz or 100Hz, I don't remember off the top of my head).

The bus is presented to the Raspberry pi, and thus to Smalltalk, as a serial port, with the comms speed set to one megabit. My code in Smalltalk can query the bus, find out what devices are connected, and talk to each device individually, all over this single serial port.

i-make-robots commented 8 months ago

Great... what does the API look like? At my level all I care about is how to connect your API with mine.

JonHylands commented 8 months ago

Are you talking about the API for the serial bus, or the robot? The robot doesn't have an API. The serial bus API is well documented by Robotis (https://emanual.robotis.com/docs/en/dxl/ax/ax-12a/) and (https://emanual.robotis.com/docs/en/dxl/protocol1/). My new devices follow the same structure and protocol, although the control table is obviously different.