Finding the Centroid of hexapod, given the feet positions

Hi all,

I intend to record the centroid translations in a gait or in any body translation given the feet positions in world coordinate system, so as to determine the error in positions while following some reference trajectory.

One way of achieving this I thought of was joining the TARS “the end points of feet” with straight lines and determine the centroid of that newly formed polygon. This polygon would change at every step in a gait since the feet positions would change, therefore a new polygon would result in every step.

But i wasnt able to determine the centroid of such a hexagon which changes its shape at every step.
Anyone know some algorithm to find the centroid of such irregularly shaped polygons? or any better way to achieve this?

The goal is to give the robot a reference trajectory to travel and theoretically determine the trajectory following errors.

Thanks for your time
cheers!

You want to compute the centroid of a 2D polygon, the algorithm is described in section 2.02 in the comp.graphics.algorithms newsgroup FAQ. You can find a copy of that here:

exaflop.org/docs/cgafaq/

A different approach might calculate the location of the centroid of the robots body as a 3D shell rather than the floor plan made by the position of the feet. Treating it as a cuboid (simple to calculate) rather than some more complex shape may be sufficient.

NOTE: The calculation of a centroid in this way is likely to be good for creating “smoothâ€

Hi,
I’m not sure if I understand your goal exactly but as long as you are using IK to control the leg movement the center of body will always follow the trajectory.

zenta, you are absolutely right that with the analytical IK model the centroid would never deviate from the defined positions, since there is no sensing involved. I am doing this solely for simulation purposes. For example I am creating a simulation for a 12 step ripple gait, all i want to add, is to make the robot leave its trail while walking or turning, so more specifically its tracing out a path rather than following a path. Therefore, if i determine the centroid at every step of the gait, I may then pass a B-Spline through these points to finally exhibit the robot’s path in the simulation.

I hope i’m a little clear now in explicating my intention.

Thanks kevin for the reference, I’ll take a look at that methodology.