Closed pazeshun closed 1 year ago
Currently, interpolator does not work with integer time-list:
EusLisp 9.29(7b154531 1.2.5) for Linux64 created on pazeshun-ThinkPad-T460s-1804(Fri Oct 14 20:33:55 JST 2022) 1.irteusgl$ (progn (setq l (instance minjerk-interpolator :init)) (send l :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(5 6 7)) :time-list (list 1000 1800)) (send l :start-interpolation) (while (send l :interpolatingp) (send l :pass-time 200) (print (send l :position)))) #f(5.0 6.0 7.0) nil 2.irteusgl$ (progn (setq l (instance minjerk-interpolator :init)) (send l :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(5 6 7)) :time-list (list 1000.0 1800)) (send l :start-interpolation) (while (send l :interpolatingp) (send l :pass-time 200) (print (send l :position)))) #f(1.0 2.0 3.0) #f(1.11584 2.11584 3.11584) #f(1.63488 2.63488 3.63488) #f(2.36512 3.36512 4.36512) #f(2.88416 3.88416 4.88416) #f(5.0 6.0 7.0) nil
This PR fixes this issue by forcibly converting time-list to float. Result:
EusLisp 9.29(7b154531 1.2.5) for Linux64 created on pazeshun-ThinkPad-T460s-1804(Fri Oct 14 20:33:55 JST 2022) 1.irteusgl$ (progn (setq l (instance minjerk-interpolator :init)) (send l :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(5 6 7)) :time-list (list 1000 1800)) (send l :start-interpolation) (while (send l :interpolatingp) (send l :pass-time 200) (print (send l :position)))) #f(1.0 2.0 3.0) #f(1.11584 2.11584 3.11584) #f(1.63488 2.63488 3.63488) #f(2.36512 3.36512 4.36512) #f(2.88416 3.88416 4.88416) #f(3.0 4.0 5.0) #f(3.20703 4.20703 5.20703) #f(4.0 5.0 6.0) #f(4.79297 5.79297 6.79297) #f(5.0 6.0 7.0) nil
When irteus/irtutil.l and lisp/geo/geopack.l are loaded explicitly, that issue disappears:
irteus/irtutil.l
lisp/geo/geopack.l
3.irteusgl$ (load "irteus/irtutil.l") t 4.irteusgl$ (progn (setq l (instance minjerk-interpolator :init)) (send l :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(5 6 7)) :time-list (list 1000 1800)) (send l :start-interpolation) (while (send l :interpolatingp) (send l :pass-time 200) (print (send l :position)))) #f(5.0 6.0 7.0) nil 5.irteusgl$ (load "lisp/geo/geopack.l") t 6.irteusgl$ (progn (setq l (instance minjerk-interpolator :init)) (send l :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(5 6 7)) :time-list (list 1000 1800)) (send l :start-interpolation) (while (send l :interpolatingp) (send l :pass-time 200) (print (send l :position)))) #f(1.0 2.0 3.0) #f(1.11584 2.11584 3.11584) #f(1.63488 2.63488 3.63488) #f(2.36512 3.36512 4.36512) #f(2.88416 3.88416 4.88416) #f(3.0 4.0 5.0) #f(3.20703 4.20703 5.20703) #f(4.0 5.0 6.0) #f(4.79297 5.79297 6.79297) #f(5.0 6.0 7.0) nil
That issue was cause by #596 and https://github.com/euslisp/EusLisp/issues/406.
eps>
https://github.com/euslisp/jskeus/blob/3040a1aa1cce1326c2e79890111d099b07207479/irteus/irtutil.l#L297 https://github.com/euslisp/jskeus/blob/3040a1aa1cce1326c2e79890111d099b07207479/irteus/irtutil.l#L299 But compiled eps> does not work when one item is float and the other is integer as https://github.com/euslisp/EusLisp/issues/406. So if (nth segment time-list) is integer, it cannot be compared with time (float).
(nth segment time-list)
time
This issue is fatal in https://github.com/jsk-ros-pkg/jsk_pr2eus/issues/486. We usually pass integer time to :angle-vector, but this cannot be correctly managed in current interpolator: https://github.com/jsk-ros-pkg/jsk_pr2eus/blob/4700cf84db91d3b8d6cb17a540c29add5fbfd656/pr2eus/robot-interface.l#L516
:angle-vector
CI successfully failed on #626 and passed on this PR. @k-okada Could you review this?
Thank you!
Currently, interpolator does not work with integer time-list:
This PR fixes this issue by forcibly converting time-list to float. Result:
Details
When
irteus/irtutil.l
andlisp/geo/geopack.l
are loaded explicitly, that issue disappears:That issue was cause by #596 and https://github.com/euslisp/EusLisp/issues/406.
596 introduced
eps>
to interpolator:https://github.com/euslisp/jskeus/blob/3040a1aa1cce1326c2e79890111d099b07207479/irteus/irtutil.l#L297 https://github.com/euslisp/jskeus/blob/3040a1aa1cce1326c2e79890111d099b07207479/irteus/irtutil.l#L299 But compiled
eps>
does not work when one item is float and the other is integer as https://github.com/euslisp/EusLisp/issues/406. So if(nth segment time-list)
is integer, it cannot be compared withtime
(float).This issue is fatal in https://github.com/jsk-ros-pkg/jsk_pr2eus/issues/486. We usually pass integer time to
:angle-vector
, but this cannot be correctly managed in current interpolator: https://github.com/jsk-ros-pkg/jsk_pr2eus/blob/4700cf84db91d3b8d6cb17a540c29add5fbfd656/pr2eus/robot-interface.l#L516