Rocco is built on an Arduino, which is a development board and environment that can read data from sensors and run code written in C. The code for this project is located on GitHub here:
The main focus of the code right now is to read input over a serial connection and execute appropriate functions (mostly movements) based on the characters received. The core function handling movement is “motion”.
There are no inverse or forward kinematics involved yet, only motion presets which are defined in the motionPreset function. Destination angles are set in that function as well and passed to the motion function to be executed.
The motion function uses the servo_interval variable to determine how many degrees each servo should move at a time on the way to completing a motion. It also uses the servo_speed variable to determine how frequently each servo should move.
For an interval of “01” (one degree, the most granular), a speed of “010” (10 milliseconds) works best. Here is an example of Rocco moving slowly (with an interval close to 01):
For the fastest movements, the maximum interval value of “32” (32 degrees) can be used along with a speed of “001” (1 millisecond). There is very little observable difference in anything lower than 25 milliseconds for fast motions.