Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamics Identification Identification Model #29

Open
ahundt opened this issue Jan 27, 2017 · 3 comments
Open

Dynamics Identification Identification Model #29

ahundt opened this issue Jan 27, 2017 · 3 comments

Comments

@ahundt
Copy link

ahundt commented Jan 27, 2017

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
Copy link
Collaborator

haudren commented Jan 27, 2017

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:

  • Have your robot perform some trajectory with high speed/accelerations to stimulate all components and save all the relevant data (joint angles, velocity, acceleration, torque)
  • At each step, compute the linearized dynamics using the IDIM. The point is to obtain:
Y \Phi = \tau

Where Y depends on the trajectory parameters (joint angles, velocity and acceleration), Phi represents all parameters. You can then inverse however you'd like Y to obtain the parameters back. I recommend generating joint-level trajectories and playing them directly on the robot to excite at most the joints.

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
Copy link
Author

ahundt commented Jan 31, 2017

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
Copy link
Collaborator

haudren commented Jan 31, 2017

Having an fixed base is an asset and a drawback:

  • It allows you to generate much more aggressive trajectories, that will stimulate all modes of the dynamics without having to worry about the stability and without having to observe the free-flyer dynamics.
  • It prevents you from observing the free-flyer dynamics that contain all the necessary information (summed) to perform the identification, and thus contribute to having good identification.

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

gergondet added a commit that referenced this issue Jun 7, 2017
bad6dbd Allow to specify pybindgen install prefix
3f214dd Update pybindgen archive url
f13ddca Use a common script for Eigen 3.2 and 3.3
0d26976 Add a script for Eigen 3.3
027bca4 Update Eigen 3.2 version to 3.2.10
629f539 ipopt: update to 3.12.6
87f7ee7 eigen: update to 3.2.9
a0c7e47 common.sh: fix OS X environment
811fbd6 Merge pull request #31 from francois-keith/dev4
4c8a74c Hard code the path to git.exe
8c1c5f5 Build in debug.
89d0b39 Add some intermediary checks.
c2f4554 [AppVeyor] Add a method to run the unit tests.
e59a441 Correct choco install.
af4c533 Merge pull request #30 from jcarpent/master
00d90b0 Fix bug in common.sh
9da636c Merge pull request #29 from jcarpent/master
dd15db5 Use CI_BRANCH instead of TRAVIS_BRANCH
448cc3f Set DO_*_ON_BRANCH to the current branch if they are not yet defined
c5ed776 [Cppcheck] Do ccpcheck only on specified branches
3c52bd1 [Coverage] Do coverage only on specified branches
2a03b5b [AppVeyor] Support for projects with fortran subdirectory
b819e8a dependencies: add missing -qq for apt-get
9b94f1a dependencies/ipopt: install dependencies with apt
7b21446 dependencies: add script to install Ipopt from source
211e163 Merge pull request #28 from gergondet/topic/Win32
8f7b969 [Win32] Add AppVeyor support
REVERT: 7a40a28 Update submodule before building
REVERT: bc0a72e [Win32] Solve an issue in functions
REVERT: 99d898d [Win32] Add AppVeyor support

git-subtree-dir: .travis
git-subtree-split: bad6dbd29cf70e852e5e427e876390d954ca7d6b
gergondet added a commit that referenced this issue Jun 7, 2017
bad6dbd Allow to specify pybindgen install prefix
3f214dd Update pybindgen archive url
f13ddca Use a common script for Eigen 3.2 and 3.3
0d26976 Add a script for Eigen 3.3
027bca4 Update Eigen 3.2 version to 3.2.10
629f539 ipopt: update to 3.12.6
87f7ee7 eigen: update to 3.2.9
a0c7e47 common.sh: fix OS X environment
811fbd6 Merge pull request #31 from francois-keith/dev4
4c8a74c Hard code the path to git.exe
8c1c5f5 Build in debug.
89d0b39 Add some intermediary checks.
c2f4554 [AppVeyor] Add a method to run the unit tests.
e59a441 Correct choco install.
af4c533 Merge pull request #30 from jcarpent/master
00d90b0 Fix bug in common.sh
9da636c Merge pull request #29 from jcarpent/master
dd15db5 Use CI_BRANCH instead of TRAVIS_BRANCH
448cc3f Set DO_*_ON_BRANCH to the current branch if they are not yet defined
c5ed776 [Cppcheck] Do ccpcheck only on specified branches
3c52bd1 [Coverage] Do coverage only on specified branches
2a03b5b [AppVeyor] Support for projects with fortran subdirectory
b819e8a dependencies: add missing -qq for apt-get
9b94f1a dependencies/ipopt: install dependencies with apt
7b21446 dependencies: add script to install Ipopt from source
211e163 Merge pull request #28 from gergondet/topic/Win32
8f7b969 [Win32] Add AppVeyor support
REVERT: 7a40a28 Update submodule before building
REVERT: bc0a72e [Win32] Solve an issue in functions
REVERT: 99d898d [Win32] Add AppVeyor support

git-subtree-dir: .travis
git-subtree-split: bad6dbd29cf70e852e5e427e876390d954ca7d6b
gergondet added a commit that referenced this issue Jun 7, 2017
* Switch to Cython bindings

* [ci] Adapt travis.yml to changes

* [ci] Prevent install directory removal

* Move wrapper functions to private pxd

* Update copyright

* Fix pickling and unit tests

* Fixes for Python 3

* [CI] Setup a Python 3.4 CI build

* Add an option to install Python bindings to user space

* Fix a few more Python 3 string issues

* Use Eigen3ToPython and SVA master

* Squashed '.travis/' changes from 7a40a28..bad6dbd

bad6dbd Allow to specify pybindgen install prefix
3f214dd Update pybindgen archive url
f13ddca Use a common script for Eigen 3.2 and 3.3
0d26976 Add a script for Eigen 3.3
027bca4 Update Eigen 3.2 version to 3.2.10
629f539 ipopt: update to 3.12.6
87f7ee7 eigen: update to 3.2.9
a0c7e47 common.sh: fix OS X environment
811fbd6 Merge pull request #31 from francois-keith/dev4
4c8a74c Hard code the path to git.exe
8c1c5f5 Build in debug.
89d0b39 Add some intermediary checks.
c2f4554 [AppVeyor] Add a method to run the unit tests.
e59a441 Correct choco install.
af4c533 Merge pull request #30 from jcarpent/master
00d90b0 Fix bug in common.sh
9da636c Merge pull request #29 from jcarpent/master
dd15db5 Use CI_BRANCH instead of TRAVIS_BRANCH
448cc3f Set DO_*_ON_BRANCH to the current branch if they are not yet defined
c5ed776 [Cppcheck] Do ccpcheck only on specified branches
3c52bd1 [Coverage] Do coverage only on specified branches
2a03b5b [AppVeyor] Support for projects with fortran subdirectory
b819e8a dependencies: add missing -qq for apt-get
9b94f1a dependencies/ipopt: install dependencies with apt
7b21446 dependencies: add script to install Ipopt from source
211e163 Merge pull request #28 from gergondet/topic/Win32
8f7b969 [Win32] Add AppVeyor support
REVERT: 7a40a28 Update submodule before building
REVERT: bc0a72e [Win32] Solve an issue in functions
REVERT: 99d898d [Win32] Add AppVeyor support

git-subtree-dir: .travis
git-subtree-split: bad6dbd29cf70e852e5e427e876390d954ca7d6b

* Fix test include path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants