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

[fetch] testが通りません #844

Closed
708yamaguchi opened this issue Sep 29, 2017 · 5 comments
Closed

[fetch] testが通りません #844

708yamaguchi opened this issue Sep 29, 2017 · 5 comments

Comments

@708yamaguchi
Copy link
Member

708yamaguchi commented Sep 29, 2017

次のような関数を定義して

(defun test ()
  (let (diff-av)
    (send *fetch* :inverse-kinematics (make-coords :pos #f(800 0 1300)))
    (send *ri* :angle-vector (send *fetch* :angle-vector))
    (setq diff-av (v- (send *ri* :state :potentio-vector) (send *fetch* :angle-vector)))
    (assert (eps= (norm diff-av) 0.0 5.0) (format nil "diff-av ~A" diff-av))
    ))

実機と繋がず

(load "package://fetcheus/fetch-interface.l")
(fetch-init)
(test)

とすると、

10.irteusgl$ test
diff-av #f(-5.08757 0.999811 1.03595 2.39243 -0.158107 357.138 0.140609 0.368797 0.0 0.0)ass:

のようなエラーが出ます。どうしてでしょうか。
diff-avの6番目の要素が0に近い値になるべきだと思うのですが、なぜか360に近い値になっています。

@k-okada
Copy link
Member

k-okada commented Sep 29, 2017

無限回転軸だからかな.

何を正解とすべきかはむづかしいんだけど、多分だけど、

5.irteusgl$ send *fetch* :angle-vector
#f(385.822 13.4851 29.5611 -158.632 113.043 -182.46 80.8974 -18.0974 0.0 0.0)
6.irteusgl$ send *ri* :state :potentio-vector
#f(380.0 14.4741 30.3673 -156.29 112.813 174.715 81.1236 -17.8094 0.0 0.0)

となっていて送るときは-182を希望するんだけど、*ri*のなかで
https://github.com/jsk-ros-pkg/jsk_pr2eus/blob/master/pr2eus/robot-interface.l#L72
https://github.com/jsk-ros-pkg/jsk_pr2eus/blob/master/pr2eus/robot-interface.l#L890
あたりで、近い方の178を目標に補間されている
https://github.com/jsk-ros-pkg/jsk_pr2eus/blob/master/pr2eus/pr2-interface.l#L368
のようにして、-182側に廻るようにすると、期待通りになることはなる.

@knorth55
Copy link
Member

これmasterのtestが通っているのはなんでなんですか?

@708yamaguchi
Copy link
Member Author

上のtest関数で:wait-interpolationが抜けていたので

(defun test ()
  (let (diff-av)
    (send *fetch* :inverse-kinematics (make-coords :pos #f(800 0 1300)))
    (send *ri* :angle-vector (send *fetch* :angle-vector))
    (send *ri* :wait-interpolation)
    (setq diff-av (v- (send *ri* :state :potentio-vector) (send *fetch* :angle-vector)))
    (assert (eps= (norm diff-av) 0.0 5.0) (format nil "diff-av ~A" diff-av))
    ))

としましたが、同じ現象が起きました。

@knorth55
Copy link
Member

@708yamaguchi Can we close this issue?

@708yamaguchi
Copy link
Member Author

すみません。閉じます。

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

3 participants