Some thoughts,
Input a vector to get direction and speed. Use joystick XY or a command from a higher level.
Revolve the vector around the leg angles to get corrected vectors.
Add the vector to the current position to get a new position for a foot.
Do IK for each foot to get moves needed for each foot.
Divide up the move as needed into smaller moves for the servos.
For the gait, move three (tripod) legs at a time.
Rotation vectors can be added in the same way.
alshmac wrote:
Im looking to develop a IK and gait controller for the hexapod im currently building. I have a simple IK solution in place for the legs, where each leg tip can be told to move to a (X,Y,Z) coordinate relative to the base frame of each leg.
Im currently trying to figure out how to build a module which can tie in a gait, the IK and possibly a few other functions, although im having problems trying to figure out exactly how to structure the code. It seems like the logical flow would be combining the gait step with a vector which describes the height, speed and direction of movment, and then also a rotation and then making a movment based on all these criteria, but easier said than done! Can anyone offer and advice or hints as to what to do now? Im using C# on a quad core 2 duo so there is no restrictions on processing power or optimising code for now!
I haven't looked at C#, C is enough for me.
Alan KM6VV