I made some functions to allow a statically stable turning motion of the robot around its own center. Stability is preserved by moving the robot's body into a position that allows stable lifting of a foot before each transfer.
The resting positions for all feet are known. They are chosen for their high kinematic margins in all directions.
(i.e. all servos set to their middle angle to allow for the most room for movement).
The turning motion is then generated with the following cycle:
- Find the resting positions for each foot when the body would be turned by x radians
- Look at the legs that have not been transferred yet
- Move to a position to allow any of those legs to be lifted with stability
- Lift the leg and transfer it to its new resting position
- Turn the body by x/4 radians
- Repeat steps 2 through 6 until all legs are transferred and the body has turned x radians
- Move the body back to the center
The result can be seen in the following video, where x = 0.3
With a few modifications this cycle might be used to reset all legs to their resting positions by simply doing a turning motion for 0 radians. More on that later...