From bf59955532b65e2cd7d33e1b73c77cdfddf03ac1 Mon Sep 17 00:00:00 2001 From: Shunichi Nozawa Date: Tue, 18 Apr 2017 22:59:41 +0900 Subject: [PATCH] Call :define-min-max-table in :init-ending in xx-utils.l. (reported problem : https://github.com/start-jsk/rtmros_tutorials/pull/508, discussion : https://github.com/start-jsk/rtmros_tutorials/pull/509#issuecomment-294832351) --- hrpsys_ros_bridge_tutorials/euslisp/hrp2g-utils.l | 8 ++++++++ hrpsys_ros_bridge_tutorials/euslisp/hrp2jsk-utils.l | 7 +++++++ hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknts-utils.l | 6 ++++++ hrpsys_ros_bridge_tutorials/euslisp/hrp2w-utils.l | 8 ++++++++ hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l | 1 + hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l | 1 + .../euslisp/make-joint-min-max-table.l | 7 +------ hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l | 1 + 8 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 hrpsys_ros_bridge_tutorials/euslisp/hrp2jsk-utils.l diff --git a/hrpsys_ros_bridge_tutorials/euslisp/hrp2g-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/hrp2g-utils.l index b6c0acd1..98aed04e 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/hrp2g-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/hrp2g-utils.l @@ -1,3 +1,11 @@ +(defmethod hrp2g-robot + (:init-ending + () + (prog1 + (send-super :init-ending) + (send self :define-min-max-table) + ))) + ;; stop and start grasp (defun hrp2g-stop-grasp (limb) (when (boundp '*hrp2g*) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsk-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsk-utils.l new file mode 100644 index 00000000..8c06232f --- /dev/null +++ b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsk-utils.l @@ -0,0 +1,7 @@ +(defmethod hrp2jsk-robot + (:init-ending + () + (prog1 + (send-super :init-ending) + (send self :define-min-max-table) + ))) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknts-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknts-utils.l index 94614ec8..632a48cd 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknts-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknts-utils.l @@ -8,6 +8,12 @@ ,@(get-hrp2-with-hand-class-methods))) (defmethod hrp2jsknts-robot + (:init-ending + () + (prog1 + (send-super :init-ending) + (send self :define-min-max-table) + )) (:inverse-kinematics (target-coords &rest args diff --git a/hrpsys_ros_bridge_tutorials/euslisp/hrp2w-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/hrp2w-utils.l index 66c68304..9e9a8dfb 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/hrp2w-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/hrp2w-utils.l @@ -1,3 +1,11 @@ +(defmethod hrp2w-robot + (:init-ending + () + (prog1 + (send-super :init-ending) + (send self :define-min-max-table) + ))) + ;; stop and start grasp (defun hrp2w-stop-grasp (limb) (when (boundp '*hrp2w*) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l index 56a045da..9becda53 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l @@ -14,6 +14,7 @@ (send self :add-hip-contact-coords) (send self :put :lhand-model (instance dummy-thk-hand-robot :init :name :l-thk-hand)) (send self :put :rhand-model (instance dummy-thk-hand-robot :init :name :r-thk-hand)) + (send self :define-min-max-table) )) (:add-hoist-point-coords () diff --git a/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l index 483718aa..80ef29f8 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l @@ -14,6 +14,7 @@ (send self :add-hip-contact-coords) (send self :put :lhand-model (instance dummy-thk-hand-robot :init :name :l-thk-hand)) (send self :put :rhand-model (instance dummy-thk-hand-robot :init :name :r-thk-hand)) + (send self :define-min-max-table) )) (:add-hoist-point-coords () diff --git a/hrpsys_ros_bridge_tutorials/euslisp/make-joint-min-max-table.l b/hrpsys_ros_bridge_tutorials/euslisp/make-joint-min-max-table.l index 7fbc8654..330daf5c 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/make-joint-min-max-table.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/make-joint-min-max-table.l @@ -161,14 +161,9 @@ (with-open-file (f path :direction :output :if-exists :append) (format f "(defmethod ~A~%" (send (class robot) :name)) - (format f " (:init-ending~%") - (format f " ()~%") - (format f " (prog1~%") - (format f " (send-super :init-ending)~%") - (format f " (send self :define-min-max-table)~%") - (format f " ))~%") (format f " (:define-min-max-table~%") (format f " ()~%") + (format f " \"This method should be called in :init-ending.\"~%") (labels ((gen-string-name (j) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l index 7a084d07..37ecbc6e 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l @@ -67,6 +67,7 @@ (prog1 (send-super* :init-ending args) (send self :add-additional-body-parts) + (send self :define-min-max-table) ;; add contact-end-coords to arms (let (rarm-contact-end-coords larm-contact-end-coords)