Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
tongtybj committed Sep 27, 2018
1 parent f696fdb commit f668d84
Show file tree
Hide file tree
Showing 4 changed files with 345 additions and 342 deletions.
11 changes: 5 additions & 6 deletions dxl_armed_turtlebot/euslisp/dxl-armed-turtlebot-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@
(require :robot-interface "package://pr2eus/robot-interface.l")

;; loadする台車・アームのrobot-interfaceクラスのメソッド定義ファイル
(load "package://turtleboteus/euslisp/turtlebot-interface-common.l")
(load "package://turtleboteus/euslisp/turtlebot-interface.l")
(load "package://dynamixel_7dof_arm/euslisp/dxl-7dof-arm-interface-common.l")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; アーム台車ロボットのrobot-interfaceクラス定義
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defclass dxl-armed-turtlebot-interface
:super robot-interface
:slots (gripper-action))
:slots ((robot-base :forward (:def-vector-value :raw-bumper-data :raw-button-data :raw-wheel-drop-data :raw-cliff-data :raw-imu-data :imurot :update-robot-state :bumper-vector :button-vector :wheel-drop-vector :cliff-vector :cliff-bottom-vector :imucoords :power-system-vector :publish-led :publish-sound :go-stop :move-to :go-pos :go-velocity))
gripper-action))

(eval `(defmethod dxl-armed-turtlebot-interface
;; dxl-7dof-arm-interface, turtlebot-interfaceのメソッドをそれぞれdefmethodする
,@(get-method-list-for-dxl-7dof-arm-interface)
,@(get-method-list-for-turtlebot-interface)
))
(defmethod dxl-armed-turtlebot-interface
(:init
(&rest args)
(prog1
(send-super* :init :robot dxl-armed-turtlebot-robot args)
;; それぞれのcallback登録など
(send self :initialize-turtlebot-ros)

(setq robot-base (instance turtlebot-interface :init))
(send self :initialize-arm-robot-ros)
)
)
Expand Down
21 changes: 21 additions & 0 deletions dxl_armed_turtlebot/euslisp/dxl-armed-turtlebot.l
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
(require :turtlebot-with-sensors-robot "package://turtleboteus/euslisp/turtlebot-with-sensors-robot.l")
(require :dxl-7dof-arm-robot "package://dynamixel_7dof_arm/euslisp/dxl-7dof-arm-robot.l")


;; forward function
(defun forward-function-list (keyword-list)
(let (forward-methods
(arm-robot-methods (send (instance dxl-7dof-arm-robot :init) :methods)))
(setq forward-methods
(flatten
(remove-duplicates
(mapcar
#'(lambda (keyword)
(remove-if-not
#'(lambda (x) (substringp keyword (string-downcase x)))
arm-robot-methods))
keyword-list
))))
forward-methods))
(setq key-funcs (forward-function-list (list "arm"))) ;;global var


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; アーム台車ロボットモデルクラス
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -116,3 +135,5 @@
:rotation-axis nil :debug-view t)
)
|#

(setq *r* (dxl-armed-turtlebot))
329 changes: 0 additions & 329 deletions turtleboteus/euslisp/turtlebot-interface-common.l

This file was deleted.

Loading

0 comments on commit f668d84

Please sign in to comment.