Skip to content

Instantly share code, notes, and snippets.

@mmurooka
Last active January 20, 2018 07:05
Show Gist options
  • Save mmurooka/3f798900d4d98914f325a927afbf52df to your computer and use it in GitHub Desktop.
Save mmurooka/3f798900d4d98914f325a927afbf52df to your computer and use it in GitHub Desktop.
PR2 virtual force
(setq *robot* (instance pr2-robot :init))
(setq *J*
(send *robot* :calc-jacobian-from-link-list
(send *robot* :link-list (send (send *robot* :larm :end-coords) :parent)
(send (car (send *robot* :larm :joint-list)) :child-link))
:move-target (send *robot* :larm :end-coords)))
(setq *torque-vector* (float-vector 5 5 5 5 5 5 5))
;; (send *ri* :state :torque-vector)から左腕だけ取ってくる
(setq *force* (transform (pseudo-inverse2 (transpose *J*)) *torque-vector*))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment