Hexapod gait code examples

Hi,

New to this forum and starting to collect information to build my first arduino controlled hexapod.

I'm new to robot design but not to programming and I'm looking for some source code examples of hexapod gate implementation. I found plenty of videos showing the robots moving with different gates but I'd just like to browse a few examples to see how they are implemented (not necessarily Arduino).

Is there anywhere I could find some examples?

Another question is that I'm not sure how to implement turns with a hexapod. The gate descriptions I've found so far only implement forward motion.

Thanks in advance.

Small problem.

You don’t mention what kind of hexapod. There are 3 servo hexapods, then 12 and 18 servo versions. Gates across the 3 versions will be different.

I’d suggest using Google. If
I’d suggest using Google. If it hasn’t worked before, it’s because you need to search for “Hexapod gaits” (gait rather than gate).

Trossen robotics has a forum
Trossen robotics has a forum with a lot of discussion about Hexapods and quadrapods.

As for turning, I think it’s like most other bots: to turn left, move the left legs a shorter distance than the right ones.

Yes, sorry, I meant gaits

Yes, sorry, I meant gaits (In fact Google finds things for both gates and gaits) . It will have 3 servos per leg. 

It seems that the ripple gate is smoother and more naturel but looking at the sequence diagrams I found, they show which legs are up and down but not the lateral mouvement.

 

Gaits and turning.
Depending on the hexapod, there can be multiple means of turning. And while they are more complex than a differentially steered bot, there are a lot of close similarities.

For example, a gradual turn left, you can do by shortening the forward distance of the left legs.

To turn in place is also pretty much like a DSB. Left side forward, right side reverse (or visa versa).

To make this look life like, you need some very good programming and I’m beginning to suspect more power than the traditional hexapod. And a hexapod can do things that a wheeled robot can’t.

Two parts of movement
I’m still working on my hexapod, but I got quite a few quadrupeds to work very nicely by splitting the animation in two parts, happening at the same time (each frame).

The first is moving all the legs that are touching ground backwards (and also rotating them around the center of the body, if the robot is turning). This is done at a constant speed, and stops if any of the legs reaches the limit of its range – but that should never happen for a properly tuned gait.

The second part is making steps with the legs – in case of a hexapod in threes, for quadruped it would be one leg at a time for creep or two for trot. You raise a leg, move it horizontally to its home position plus some speed-dependant offset and rotation, and set it down. The offset should be tuned so that the legs never reach their limit in the time it takes to move the leg again. The order in which you make those steps is important, of course, but in case of hexapod it’s simply even and odd legs, alternating.

One very cool trick you can do with a hexapod, is to program a quadruped gait for it, and use the two free front legs for grabbing things.