Close

Changed Controller Behaviour

A project log for Stubby the (Teaching) Hexapod

100% open source robot platform with accessability and affordability in mind: teaching children of all ages about robots & programming

the-big-oneThe Big One 04/24/2014 at 03:050 Comments

Up to now, I was using the digital buttons (PAD_UP, PAD_DOWN, LEFT_2, and RIGHT_2) to control the velocity and direction of Stubby.  That was a nice and easy way to get basic movement working, but it is far from refined.  A big issue was that it did not allow for velocities: it was either going forward or backward, but nothing in between.

I have now programmed support for the PS2 controller's analog joystick.  The left joystick controls velocity and direction.  By changing velocity, it affects both the stride length (how far the legs move back and forth) and the servo delay.  The X button is still used to reset Stubby to sitting position (all legs sticking directly out).

Future plans for the movement code include dynamic gaits (either switching gaits depending on velocity, or manually switching gaits using controller buttons) and smoother servo movements (making multiple small steps to get from angle A to angle B, given a desired duration).  The first option will probably wait until I get the real PCBs, as it has a RGB LED on it which can show status (such as manually selected gait); the second will hopefully be completed within a few days.

Discussions