Skip to content

Commit

Permalink
Merge pull request #625 from pazeshun/interpolator-integer
Browse files Browse the repository at this point in the history
[irteus/irtutil.l] Enable to pass integer time-list to interpolator
  • Loading branch information
k-okada committed Oct 18, 2022
2 parents 3040a1a + 09a2b55 commit caa563b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion irteus/irtutil.l
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
position-list: list of control point
time-list: list of time from start for each control point, time in first contrall point is zero, so length of this list is length of control point minus 1"
(setq position-list pl)
(setq time-list tl)
(setq time-list (mapcar #'float tl)) ;; float conversion is for compiled eps> (see https://github.com/euslisp/EusLisp/issues/406)
(if (/= (length position-list) (1+ (length time-list)))
(warning-message 1 "length of position-list must be length of time-list + 1"))
(setq time 0.0)
Expand Down
15 changes: 15 additions & 0 deletions irteus/test/interpolator.l
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@
))
))

;; https://github.com/euslisp/jskeus/pull/625
(defun test-interpolators-625
(&optional (ip-class linear-interpolator))
(let ((ip (instance ip-class :init)))
(send ip :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(1 2 3)) :time-list (list 1000 1800))
(send ip :start-interpolation)
(send ip :pass-time 200)
(assert (send ip :interpolatingp))))

(deftest test-linear-interpolator ()
(let ((res (test-interpolators linear-interpolator)))))

Expand All @@ -257,6 +266,12 @@
(deftest test-minjerk-absolute-interpolator-457-0005 ()
(let ((res (test-interpolators-457 minjerk-interpolator 0.0005)))))

(deftest test-linear-interpolator-625 ()
(let ((res (test-interpolators-625 linear-interpolator)))))

(deftest test-minjerk-interpolator-625 ()
(let ((res (test-interpolators-625 minjerk-interpolator)))))


#|
(load "~/prog/euslib/jsk/gnuplotlib.l")
Expand Down

1 comment on commit caa563b

@k-okada
Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for contributing jskeus documentation

Please check latest documents before merging

PDF version of Japanese jmanual: jmanual.pdf
HTML version of Japanese manual: jmanual.html
Sphinx (ReST) version of Japanese manual: jmanual.rst

Please sign in to comment.