jrl-umi3218 / RBDyn

RBDyn provides a set of classes and functions to model the dynamics of rigid body systems.
BSD 2-Clause "Simplified" License
163 stars 47 forks source link

Dynamics Identification Identification Model #29

Open ahundt opened 7 years ago

ahundt commented 7 years ago

I'm interested in trying out the IDIM module on my robot arm. I looked at your papers and the comments and it seems an important aspect is dealing with the rubber feet on your bot. Can these algorithms be used for the dynamics of an arm without such a rubber component?

I'd normally just jump in and try things, but I also assume this will require physically moving the robot to make the estimates so I want to ensure I proceed safely. Any advice would be appreciated!

haudren commented 7 years ago

I never personally used the IDIM module but it's generally used for identifying more than only the elastic components at the feet, but rather to obtain all the inertial and dynamic properties of the robot. The IDIM module provided in Tasks actually does not compute the viscoelasticity regressors. To use it:

In code:

IDIM idim(mb);
Eigen::MatrixXd regressors(samples.size()*mb.nrDof(), mb.nrBodies()*10);
Eigen::VectorXd torques(samples.size()*mb.nrDof());
for(int i = 0; i < samples.size(); ++i)
{
    updateFromSample(sample, mbc);
    regressors.block(i*mb.nrDof(), 0, mb.nrDof(), mb.nrBodies()*10) = idim.computeY(mb, mbc);
    torque.segment(i*mb.nrDof(), mb.nrDof()) = sample.torque;
}
params = regressors.jacobiSvd(ComputeThinU | ComputeThinV).solve(torque)

See: https://www.researchgate.net/publication/303840688_Humanoids_and_Humans_Inertia_Parameters_Identification_using_Hierarchical_Optimization For more advanced discussions on this topic.

ahundt commented 7 years ago

awesome! I'll give it a look.

So I can create an appropriate trajectory in joint space using position commands, then as it follows that path record the position, velocity, acceleration, and torque on each joint at each time step. I then feed it into the solver as you mentioned in code, and that should extract my parameters.

My arm is attached to a base on wheels which I want to consider "fixed" I can attach the base solidly to a beam if that will help, but do I correctly assume that will affect the ability to get the parameters for the first few joints?

haudren commented 7 years ago

Having an fixed base is an asset and a drawback:

If your trajectories are well-designed, you should be able to reconstruct every parameter of every body regardless of the base being fixed or not.

e/ Here is a video showing the kind of movement you should be aiming for: https://www.youtube.com/watch?v=qoUSdh3aW7I