Skip to content

Commit 0b9949b

Browse files
committed
Add :time key to :start-grasp
1 parent a0ca0e8 commit 0b9949b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

hrpsys_ros_bridge_tutorials/euslisp/hironxjsk-interface.l

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@
257257
;; setjointangles
258258
(let ((av-rad-list (map cons #'deg2rad av)))
259259
(case hand
260-
(:hands (send self :call-operation-return :servocontrollerservice_setjointangles
260+
(:hands
261+
(when (= (length av) 4) (setq av-rad-list (concatenate float-vector av-rad-list av-rad-list)))
262+
(send self :call-operation-return :servocontrollerservice_setjointangles
261263
:jvs av-rad-list :tm (/ tm 1000.0)))
262264
((:rhand :lhand)
263265
(send self :call-operation-return :servocontrollerservice_setjointanglesofgroup
@@ -316,23 +318,20 @@
316318
(multiple-value-bind (a1 a2 b1 b2) (map cons #'deg2rad vec)
317319
(+ (get-width a1 a2)
318320
(get-width (- b1) (- b2)))))))
319-
(:hand-width (hand &optional width &key (tm 1000) effort)
321+
(:hand-width (hand &optional width &key (time 1000) effort)
320322
(if width
321323
;; set hand width
322324
(progn
323325
(when effort (send self :hand-effort hand effort))
324-
(send self :hand-angle-vector hand (send self :hand-width2angles width) tm))
326+
(send self :hand-angle-vector hand (send self :hand-width2angles width) time))
325327
;; get hand width
326328
(send self :hand-angles2width (send self :hand-angle-vector hand))))
327-
(:start-grasp (&optional (arm :arms) &key effort)
328-
(cond ((eq arm :rarm)
329-
(send self :hand-width :rhand 0 :effort effort))
330-
((eq arm :larm)
331-
(send self :hand-width :lhand 0 :effort effort))
332-
((eq arm :arms)
333-
(send self :hand-width :rhand 0 :effort effort)
334-
(send self :hand-width :lhand 0 :effort effort))
335-
(t (error ";; No such arm: ~A~%." arm))))
329+
(:start-grasp (&optional (arm :arms) &key (time 1000) effort)
330+
(case arm
331+
(:arms (setq arm :hands))
332+
(:rarm (setq arm :rhand))
333+
(:larm (setq arm :lhand)))
334+
(send self :hand-width arm 0 :time time :effort effort))
336335
(:stop-grasp (&optional (arm :arms) &key effort)
337336
(cond ((eq arm :rarm)
338337
(send self :hand-width :rhand 100 :effort effort))

0 commit comments

Comments
 (0)