Skip to content

Commit 966b4b8

Browse files
nozawanozawa
nozawa
authored and
nozawa
committed
support assoc list min-max table discussed in euslisp/jskeus#77
1 parent 89e277a commit 966b4b8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

euslisp/test/joint.l

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@
9696
(deftest test-min-max-table
9797
(let ((j1 (send *robot* :j1))
9898
(j2 (send *robot* :j2))
99-
(j1-min-max-table (make-hash-table))
100-
(j2-min-max-table (make-hash-table))
99+
j1-min-max-table
100+
j2-min-max-table
101101
min-max-table-view
102102
x y)
103103

104104
;; set min-max-table
105105
;; j1-hash
106106
(do ((i -90 (+ i 1))) ((> i 90))
107-
(setf (gethash (round i) j1-min-max-table) (cons (- (abs i) 90) (- 90 (abs i))))
108-
(setf (gethash (round i) j2-min-max-table) (cons (- (abs i) 90) (- 90 (abs i))))
107+
(push (list (round i) (cons (- (abs i) 90) (- 90 (abs i)))) j1-min-max-table)
108+
(push (list (round i) (cons (- (abs i) 90) (- 90 (abs i)))) j2-min-max-table)
109109
)
110110
(setq (j1 . joint-min-max-table) j1-min-max-table)
111111
(setq (j1 . joint-min-max-target) j2)
@@ -124,8 +124,8 @@
124124
((> x 90))
125125
(do ((y -90 (+ y 1)))
126126
((> y 90))
127-
(let* ((j1-min-max (gethash (round y) j1-min-max-table)) ;; j1-min-max-table is functoin of j2
128-
(j2-min-max (gethash (round x) j2-min-max-table))
127+
(let* ((j1-min-max (cadr (assoc (round y) j1-min-max-table))) ;; j1-min-max-table is functoin of j2
128+
(j2-min-max (cadr (assoc (round x) j2-min-max-table)))
129129
(j1-min (car j1-min-max))
130130
(j1-max (cdr j1-min-max))
131131
(j2-min (car j2-min-max))

0 commit comments

Comments
 (0)