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

add interpolation in :angle-vector-raw #849

Merged
merged 6 commits into from
Oct 9, 2017

Conversation

k-okada
Copy link
Member

@k-okada k-okada commented Oct 3, 2017

Fixes #839

rewrited versoin of #841

fetch interface have problems on trajectory interpolation after cancel , (maybe) when the original trajectory goes over 180 degree ( ZebraDevs/robot_controllers#33 )

This PR fixes by sending interpolated angle-vector-sequence within :angle-vector-raw

(incf i (send j :joint-dof)))
add-new-trajectory-point))
(:angle-vector-raw (av &optional (tm 3000) &rest args)
(when (send self :check-continuous-joint-move-over-180 diff-av)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff-avが定義されていないと言われます。
diff-av(v- av (send robot :angle-vector))
のようにするのが正しいでしょうか。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとう.直してみました.

@k-okada k-okada force-pushed the add-wait-interpolation-in-test branch from 293d26a to 0f234ca Compare October 3, 2017 09:06
(let* (avs (minjerk (instance minjerk-interpolator :init))
(scale-av (send self :sub-angle-vector av prev-av))
dist div)
(setq dist (abs (geo::find-extream (coerce diff-av cons) #'abs #'>=)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここのdiff-av(v- av prev-av)だと思います。さっきかくの忘れてました。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そうですね.こんどこそ.

@k-okada k-okada force-pushed the add-wait-interpolation-in-test branch from 0f234ca to 0d86e2b Compare October 3, 2017 09:47
@708yamaguchi
Copy link
Member

角度が180度を超えたら云々というのは、test-fetcheus.lの中でdiff-avを計算するときにdiff-avが大きくなりすぎるという問題から来るものだったような気がします。

@k-okada
Copy link
Member Author

k-okada commented Oct 3, 2017

diff-avが大きくなる理由が #841 (comment) だという理解です.

@708yamaguchi
Copy link
Member

ありがとうございます

@k-okada
Copy link
Member Author

k-okada commented Oct 7, 2017

@708yamaguchi これでマージして大丈夫かな?確認してみてください.

@k-okada k-okada added this to the 1.1.1 milestone Oct 7, 2017
@708yamaguchi
Copy link
Member

708yamaguchi commented Oct 7, 2017

実機で試したのですが、
(send *ri* :angle-vector (send *fetch* :angle-vector #f(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)) 10000)
として最初の姿勢を作ったあとに、
(send *ri* :angle-vector-raw (send *fetch* :angle-vector #f(0.0 0.0 0.0 1000.0 0.0 0.0 0.0 0.0 0.0 0.0)) 10000)
とすると、
#f(1.421085e-14 1.387779e-17 0.0 640.0 2.220446e-16 0.0 -1.110223e-16 0.0 0.0 4.440892e-16)
のような値がかえってきて、実際、fetchの4番目の関節が640度回転したのを目で確認しました。

(send *ri* :sub-angle-vector #f(0.0 0.0 0.0 1000.0 0.0 0.0 0.0 0.0 0.0 0.0) #f(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0))
の返り値が
#f(0.0 0.0 0.0 640.0 0.0 0.0 0.0 0.0 0.0 0.0)
となるのが問題だと思うのですが、どうでしょうか。

@k-okada
Copy link
Member Author

k-okada commented Oct 7, 2017

なるほど.
jsk-ros-pkg/jsk_pr2eus#323
が必要でしょうか.

@k-okada k-okada added the hacktoberfest-accepted https://hacktoberfest.digitalocean.com/hacktoberfest-update label Oct 7, 2017
@708yamaguchi
Copy link
Member

jsk-ros-pkg/jsk_pr2eus#323
を入れて再び実機で

(send *ri* :angle-vector (send *fetch* :angle-vector #f(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)) 10000)
(send *ri* :angle-vector-raw (send *fetch* :angle-vector #f(0.0 0.0 0.0 1000.0 0.0 0.0 0.0 0.0 0.0 0.0)) 10000)

としたところ、
#f(0.0 -5.551115e-17 -5.551115e-17 -80.0 0.0 4.163336e-17 2.220446e-16 -1.110223e-16 \ 0.0 1.776357e-15)
のような値がかえってきて、実際にfetchの腕が-80度だけ回転するのを確認しました。
また、
(send *ri* :sub-angle-vector #f(0.0 0.0 0.0 1000.0 0.0 0.0 0.0 0.0 0.0 0.0) #f(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0))
の返り値も
#f(0.0 0.0 0.0 -80.0 0.0 0.0 0.0 0.0 0.0 0.0)
だったので、正しい挙動をしていると思います。

@k-okada k-okada reopened this Oct 8, 2017
@k-okada k-okada merged commit 4e65b00 into jsk-ros-pkg:master Oct 9, 2017
@k-okada k-okada deleted the add-wait-interpolation-in-test branch October 9, 2017 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetch15 hacktoberfest-accepted https://hacktoberfest.digitalocean.com/hacktoberfest-update MergeOK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fetch] :cancel-angle-vectorが上手く動かない。
2 participants