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

[WIP] [fetch] add interpolation in :angle-vector-raw #841

Conversation

708yamaguchi
Copy link
Member

:angle-vector-rawの中で補間点を入れると#839 のような挙動を示さなくなった。

以下の部分で、補間点が少ないと良くないことが起こるらしい。
https://github.com/fetchrobotics/robot_controllers/blob/74970680716f8af29c5ff3e1e8a76ea1089640ff/robot_controllers/src/follow_joint_trajectory.cpp#L381

:position-list (list (send self :state :potentio-vector :wait-until-update t) av)
:time-list (list tm))
(send minjerk :start-interpolation)
(send minjerk :pass-time (/ tm devide))
Copy link
Member

Choose a reason for hiding this comment

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

divide

@@ -23,7 +23,17 @@
(setq moveit-robot (instance fetch-robot :init))
(send self :set-moveit-environment (instance fetch-moveit-environment :init :robot moveit-robot))
))
(:angle-vector-raw (&rest args) (send-super* :angle-vector args))
(:angle-vector-raw (av &optional (tm 3000) &key (devide 4) &rest args)
Copy link
Member

Choose a reason for hiding this comment

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

divide

(send minjerk :start-interpolation)
(send minjerk :pass-time (/ tm devide))
(dotimes (i devide)
(setq avs (cons (send minjerk :pass-time (/ tm devide)) avs)))
Copy link
Member

Choose a reason for hiding this comment

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

(setq avs (append avs (send minjerk :pas-time (/ tm divide)))

(send minjerk :pass-time (/ tm devide))
(dotimes (i devide)
(setq avs (cons (send minjerk :pass-time (/ tm devide)) avs)))
(setq avs (reverse avs))
Copy link
Member

Choose a reason for hiding this comment

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

why do you need to reverse the list?

(dotimes (i devide)
(setq avs (cons (send minjerk :pass-time (/ tm devide)) avs)))
(setq avs (reverse avs))
(send* self :angle-vector-sequence-raw avs (/ tm devide) args)))
Copy link
Member

Choose a reason for hiding this comment

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

tms should be list of time.
Is this code tested?

:position-list (list (send self :state :potentio-vector :wait-until-update t) av)
:time-list (list tm))
(send minjerk :start-interpolation)
(send minjerk :pass-time (/ tm devide))
Copy link
Member

Choose a reason for hiding this comment

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

if you fo (send minjerk :pass-time time) for the first time, it returns angle-vector at time 0s.
Is this a bug or a designed return? @k-okada

1.irteusgl$ (setq minjerk (instance minjerk-interpolator :init))
#<minjerk-interpolator #X591c800>
2.irteusgl$ (send minjerk :reset :position-list (list #f(0 0 0) #f(0 10 20)) :time-list (list 5000))
(#f(0.0 0.0 0.0) #f(0.0 0.0 0.0))
3.irteusgl$ (send minjerk :start-interpolation)
t
4.irteusgl$ (send minjerk :pass-time 1000)
#f(0.0 0.0 0.0)
5.irteusgl$ (send minjerk :pass-time 1000)
#f(0.0 0.5792 1.1584)
6.irteusgl$ (send minjerk :pass-time 1000)
#f(0.0 3.1744 6.3488)
7.irteusgl$ (send minjerk :pass-time 1000)
#f(0.0 6.8256 13.6512)
8.irteusgl$ (send minjerk :pass-time 1000)
#f(0.0 9.4208 18.8416)
9.irteusgl$ (send minjerk :pass-time 1000)
#f(0.0 10.0 20.0)
10.irteusgl$ (send minjerk :pass-time 1000)
nil

@708yamaguchi 708yamaguchi force-pushed the interpolation-in-angle-vector-raw branch from 63beb60 to a21e8ed Compare September 28, 2017 13:01
@708yamaguchi 708yamaguchi force-pushed the interpolation-in-angle-vector-raw branch from 7ec0e65 to b24e7db Compare September 29, 2017 06:47
@708yamaguchi 708yamaguchi force-pushed the interpolation-in-angle-vector-raw branch from b24e7db to 9d7a737 Compare September 29, 2017 06:51
@708yamaguchi 708yamaguchi changed the title [fetch] add interpolation in :angle-vector-raw [WIP] [fetch] add interpolation in :angle-vector-raw Sep 29, 2017
@708yamaguchi
Copy link
Member Author

wait for #847

@k-okada
Copy link
Member

k-okada commented Oct 3, 2017

#849
を試してみてください.#841 だと,#847 (comment)
に書いたように実機に -150度 おくってから, 150度 送ったばあい,小さい方の距離として,-60度で動くのではなくて,300度送るようになる気がする.
もとの仕様がどうか,という話があるけど,何も考えずにikといて,:angle-vector すると同じ姿勢になる(角度は違っても)というのが直感としては正しいという理屈になっています.

@k-okada
Copy link
Member

k-okada commented Oct 7, 2017

#849 でいいか確認してみてください.OKだったらクローズでいいのかな.

@knorth55 knorth55 closed this Oct 12, 2017
@knorth55
Copy link
Member

moved to #849

@708yamaguchi 708yamaguchi deleted the interpolation-in-angle-vector-raw branch November 11, 2017 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants