Skip to content

Commit c28b4ca

Browse files
Naoki-Hiraokak-okada
authored andcommitted
[irteus/irtmodel.l] refactor conditional branch and comments for debug print of :inverse-kinematics
1 parent fee8b25 commit c28b4ca

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

irteus/irtmodel.l

+13-14
Original file line numberDiff line numberDiff line change
@@ -2572,20 +2572,19 @@
25722572
(if (consp l) (deep-copy-list l) l))
25732573
lst)))
25742574
(setq print-args (deep-copy-list args)) ;; generate deep copy list for destructive operation
2575-
(dotimes (i (/ (length print-args) 2)) ;; escape list
2576-
(unless (eq (elt print-args (* 2 i)) :move-target) ;; neglect :move-target because move-target is fixed later
2577-
(escape-list print-args (+ 1 (* 2 i)))))
2578-
(dotimes (i (/ (length print-args) 2)) ;; escape list
2579-
(unless (eq (elt print-args (* 2 i)) :move-target) ;; neglect :move-target because move-target is fixed later
2580-
(escape-robot-link print-args (+ 1 (* 2 i))))) ;; escape robot link
2581-
(dotimes (j (count :move-target print-args)) ;; escape move-target
2582-
(if (setq i (position :move-target print-args :count (1+ j)))
2583-
(cond ((atom (elt print-args (+ i 1)))
2584-
(setf (elt print-args (+ i 1)) (get-move-target-transform-list (elt print-args (+ i 1)))))
2585-
(t
2586-
(setf (elt print-args (+ i 1))
2587-
(append '(list)
2588-
(mapcar #'(lambda (x) (get-move-target-transform-list x)) (elt print-args (+ i 1)))))))))
2575+
(dotimes (i (/ (length print-args) 2))
2576+
(if (not (eq (elt print-args (* 2 i)) :move-target))
2577+
;; escape args other than :move-target
2578+
(progn
2579+
(escape-list print-args (+ 1 (* 2 i))) ;; escape list
2580+
(escape-robot-link print-args (+ 1 (* 2 i)))) ;; escape robot link
2581+
;; escape :move-target
2582+
(cond ((atom (elt print-args (+ 1 (* 2 i))))
2583+
(setf (elt print-args (+ 1 (* 2 i))) (get-move-target-transform-list (elt print-args (+ 1 (* 2 i))))))
2584+
(t
2585+
(setf (elt print-args (+ 1 (* 2 i)))
2586+
(append '(list)
2587+
(mapcar #'(lambda (x) (get-move-target-transform-list x)) (elt print-args (+ 1 (* 2 i))))))))))
25892588
(setq command-init `(instance ,(send (class self) :name) :init)
25902589
command-setup `(progn (send r :newcoords (make-coords :4x4 ,(send self :4x4))) (mapc #'(lambda (j a) (send* j :joint-angle a ,joint-args)) (list . ,(mapcar #'(lambda (x) `(send r ,(intern (string-upcase x) *keyword-package*))) (send-all (remove-duplicates (append (send-all union-link-list :joint) joint-list)) :name))) ,(list 'quote av0)) (objects (list r))))
25912590
(setq command-args ;; append target-coords and print-args

0 commit comments

Comments
 (0)