laas / metapod

A template-based robot dynamics library
GNU Lesser General Public License v3.0
14 stars 10 forks source link

Torques from Rnea and equation of motion don't match #78

Closed nunoguedelha closed 9 years ago

nunoguedelha commented 10 years ago

If we compute the torques using RNEA, Tau=ID(q,dq,ddq), we get the expected reference torques (rnea.ref). If we use the equation of motion, Tau=H*ddq+C, we get wrong torques. The issue is introduced by the use of optional parameter "prefer-fixed-axis=true" in simple_humanoid.config file . Refer to following comments for more details.

nunoguedelha commented 10 years ago

Tests have been done on top of master :

== With following section in simple_humanoid.config file (8857c5eca7720b2175b520ac246f42e564c14d37) :

prefer-fixed-axis=true joint=WAIST_P joint=LARM_SHOULDER_P joint=RARM_SHOULDER_P joint=LLEG_HIP_R joint=RLEG_HIP_R

=> RNEA computed torques match the expected values (refer to logs rnea.log, rnea.log.diff) => (H*ddq + C) give wrong torques (refer to logs rnea_from_DynEquation.log, rnea_from_DynEquation.log.diff) These logs are generated by metapod/_build/tests/use_simple_humanoid/test_rnea_simple_humanoid executable.

errors can be significant like:

Due to "prefer-fixed-axis=true" option, TransformT sXp template matrices are being instanciated using Spatial::RotationMatrixAboutYTpl, instead of Spatial::RotationMatrixTpl.

== Without the reffered section (76db02f73af48ae36534fd56199ab8238d9186cb) :

All torques are correct. Torques computed from ID(q,dq,ddq) and H*ddq+C match.

olivier-stasse commented 9 years ago

Fixed by beb4f69