jsk-ros-pkg / jsk_control

jsk control ros packages
http://github.com/jsk-ros-pkg/jsk_control
13 stars 51 forks source link

[optmotiongen] fix gravity torque calculation #714

Closed mmurooka closed 5 years ago

mmurooka commented 5 years ago
mmurooka commented 5 years ago

Demo of torque and torque jacobian calculation:

roscd eus_qp/optmotiongen/euslisp/demo/
roseus demo-rhp4b-torque-gradient.l "(demo-rhp4b-torque-gradient)"

Before this PR's fix:

contact-torque-error: 6.851075e-15
gravity-torque-error: 7.19025 ;; <= not correct !!!                                                                                                                                                                                    
contact-torque-jacobian-error: 1.435224e-05
gravity-torque-jacobian-error: 2.768217e-05
torque-jacobian-error: 3.197068e-05

After this PR's fix:

contact-torque-error: 6.851075e-15
gravity-torque-error: 3.745714e-14 ;; <= correct !!!                                                                                                                                                                                   
contact-torque-jacobian-error: 1.435224e-05
gravity-torque-jacobian-error: 3.321519e-05
torque-jacobian-error: 3.682560e-05
sshige commented 5 years ago

遅くなってしまい申し訳ありません。コードを確認しました。

別の環境でもテストしてみて

(scale
               -1
               (get-gravity-torque
        :robot _robot-env
        :drive-joint-list _drive-joint-list
        :gravity-link-list (send _robot-env :robot :links)
        ))

(send (send _robot-env :robot) :calc-torque)

の値がiteration中も、変わらないことも確認したので、合っていると思います。

マニュアルも変更箇所を確認しました。こちらも合っていると思います。

mmurooka commented 5 years ago

Thank you for your review.