Pypot extended motor controller

One of the point of object oriented programmation is to cut a complex system in small components. We can see it with pypot in which you can access a motor as an object. But the drawback is that the global shape of the robot is lost.
I thnik about merging the architecture of a list of motors with the kinematics.
I designed a kinematic file for making Poppy walk with @Manon which is a “monster” with more than 1000 code lines to compute the complete geometric model and its Jacobian.
On the other way, I did not use all the jacobians or all the coordinates of the model for each iteration.

Finally, after brain pressing, I observed that I need only two things:

  • the position of the center of the motor (on the axis) in an earth frame (considering IMU)
  • the orientation of the axis of the motor in the earth frame (considering IMU)

If I want the influence of motor in A which vector axis is j on the position of point B, I just have to do cross(j,AB)
What is difficult is the direction of axis which depends on where is the base. For an industrial robot, the base is always the same. For a biped… it depends…
The result is that the computation time is again reduced a loooooooooot. And the size of the Kinematic file :slight_smile:

The aim is to control a motor, not by position but by constraint, which is more easy to understand (this is a way to animate cartoons)

My question is do you know people working on this kind of issue ? I am sure I am creating a wheel…

Thomas,

I have a file with direct kinematics and approximate (first order) jacobian computation with an object oriented point of view: your leg in a Chain, containing several Segments, each segment being a structure part (a translation) with a motor (1 axis rotation) at the end. Iterativily, you can compurte the position in earth referential of any point of any segment by combining rotation and translation matrices from segments below.

The code is only vaguely tested, not commented, etc, I give it just in case it helps you…
manon_kinematics.txt (4.5 KB)