From 5589cd5f6d1d2db51ed0c4c24cdfd20a999db43f Mon Sep 17 00:00:00 2001 From: Shunichi Nozawa Date: Tue, 18 Apr 2017 19:13:28 +0900 Subject: [PATCH 1/2] [hrpsys_ros_bridge_tutorials/euslisp] Call pre-defined :init-ending in overwritten :init-ending (https://github.com/start-jsk/rtmros_tutorials/pull/508). --- hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l | 5 +++-- hrpsys_ros_bridge_tutorials/euslisp/hrp4r-utils.l | 5 ++++- hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l | 4 +++- hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l | 5 ++++- hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l | 4 +++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l index 46895fcf..e4d322a0 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l @@ -3,6 +3,8 @@ (unless (assoc :init-org (send hrp2jsknt-robot :methods)) (rplaca (assoc :init (send hrp2jsknt-robot :methods)) :init-org)) +(unless (assoc :init-ending-org (send hrp2jsknt-robot :methods)) + (rplaca (assoc :init-ending (send hrp2jsknt-robot :methods)) :init-ending-org)) (eval `(defmethod hrp2jsknt-robot ,@(get-hrp2-with-hand-class-methods))) @@ -11,9 +13,8 @@ (:init-ending (&rest args) (prog1 - (send-super* :init-ending args) + (send self :init-ending-org) (send self :set-additional-end-coords) - (send self :define-min-max-table) )) (:inverse-kinematics (target-coords diff --git a/hrpsys_ros_bridge_tutorials/euslisp/hrp4r-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/hrp4r-utils.l index af1c60ff..dbdf314d 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/hrp4r-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/hrp4r-utils.l @@ -1,5 +1,8 @@ (require :hrp4r "package://hrpsys_ros_bridge_tutorials/models/hrp4r.l") +;; If you overwrite :init-ending in hrp4r.l, comment in the following: +;; (unless (assoc :init-ending-org (send hrp4r-robot :methods)) +;; (rplaca (assoc :init-ending (send hrp4r-robot :methods)) :init-ending-org)) (defmethod hrp4r-robot (:init-ending () @@ -39,4 +42,4 @@ )) ))) ) - ) \ No newline at end of file + ) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l index 56a045da..f3adeb2f 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l @@ -1,11 +1,13 @@ (require :jaxon "package://hrpsys_ros_bridge_tutorials/models/jaxon.l") (require :thkhand-utils "package://hrpsys_ros_bridge_tutorials/euslisp/thkhand-utils.l") +(unless (assoc :init-ending-org (send JAXON-robot :methods)) + (rplaca (assoc :init-ending (send JAXON-robot :methods)) :init-ending-org)) (defmethod JAXON-robot (:init-ending (&rest args) (prog1 - (send-super* :init-ending args) + (send self :init-ending-org) (send self :add-hoist-point-coords) (send self :add-shin-cushion-parts) (send self :add-shin-contact-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..97a329ee 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l @@ -1,11 +1,14 @@ (require :jaxon "package://hrpsys_ros_bridge_tutorials/models/jaxon_red.l") (require :thkhand-utils "package://hrpsys_ros_bridge_tutorials/euslisp/thkhand-utils.l") +(unless (assoc :init-ending-org (send JAXON_RED-robot :methods)) + (rplaca (assoc :init-ending (send JAXON_RED-robot :methods)) :init-ending-org)) + (defmethod JAXON_RED-robot (:init-ending (&rest args) (prog1 - (send-super* :init-ending args) + (send self :init-ending-org) (send self :add-hoist-point-coords) (send self :add-shin-cushion-parts) (send self :add-shin-contact-coords) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l index 7a084d07..8176536c 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l @@ -61,11 +61,13 @@ ) ) +(unless (assoc :init-ending-org (send STARO-robot :methods)) + (rplaca (assoc :init-ending (send STARO-robot :methods)) :init-ending-org)) (defmethod STARO-robot (:init-ending (&rest args) (prog1 - (send-super* :init-ending args) + (send self :init-ending-org) (send self :add-additional-body-parts) ;; add contact-end-coords to arms From ae6471bfa2d594efaa32d33c2fd3143dd6dfa735 Mon Sep 17 00:00:00 2001 From: Shunichi Nozawa Date: Tue, 18 Apr 2017 19:15:09 +0900 Subject: [PATCH 2/2] [hrpsys_ros_bridge_tutorials/euslisp] Do not change argument of :init-ending (remove '&rest args') --- hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l | 2 +- hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l | 2 +- hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l | 2 +- hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l index e4d322a0..0644cd47 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/hrp2jsknt-utils.l @@ -11,7 +11,7 @@ (defmethod hrp2jsknt-robot (:init-ending - (&rest args) + () (prog1 (send self :init-ending-org) (send self :set-additional-end-coords) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l index f3adeb2f..a4a1f861 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/jaxon-utils.l @@ -5,7 +5,7 @@ (rplaca (assoc :init-ending (send JAXON-robot :methods)) :init-ending-org)) (defmethod JAXON-robot (:init-ending - (&rest args) + () (prog1 (send self :init-ending-org) (send self :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 97a329ee..dce75645 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/jaxon_red-utils.l @@ -6,7 +6,7 @@ (defmethod JAXON_RED-robot (:init-ending - (&rest args) + () (prog1 (send self :init-ending-org) (send self :add-hoist-point-coords) diff --git a/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l b/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l index 8176536c..2dafb8fe 100644 --- a/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l +++ b/hrpsys_ros_bridge_tutorials/euslisp/staro-utils.l @@ -65,7 +65,7 @@ (rplaca (assoc :init-ending (send STARO-robot :methods)) :init-ending-org)) (defmethod STARO-robot (:init-ending - (&rest args) + () (prog1 (send self :init-ending-org) (send self :add-additional-body-parts)