Skip to content

Commit

Permalink
Merge pull request #5 from pazeshun/reuse-panda-on-fr3
Browse files Browse the repository at this point in the history
Re-use panda-robot-interface in fr3-robot-interface & Add fr3 to README
  • Loading branch information
yuki-asano authored Nov 27, 2023
2 parents ca18d81 + c8273af commit 57f70bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
10 changes: 5 additions & 5 deletions jsk_panda_robot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@
```


## Running single Panda
## Running single Panda/FR3 (Franka Research 3)
### Boot robot
1. Please turn on the controller box and unlock joints by accessing desk.
### Via roseus
1. Start controller on controller PC:
```bash
ssh [email protected] # Or ssh [email protected]
roslaunch jsk_panda_startup panda.launch robot_ip:=<IP OF TARGET ROBOT>
roslaunch jsk_panda_startup panda.launch robot_ip:=<IP OF TARGET ROBOT> # FR3: roslaunch jsk_panda_startup fr3.launch robot_ip:=<IP OF TARGET ROBOT>
```

2. Controlling single Panda via roseus:
2. Controlling single Panda/FR3 via roseus:
1. Setting up network:
```bash
rossetmaster dual-panda1.jsk.imi.i.u-tokyo.ac.jp # Or rossetmaster dual-panda2.jsk.imi.i.u-tokyo.ac.jp
rossetip
```
2. Execute following script in roseus:
```lisp
(load "package://panda_eus/euslisp/panda-interface.l")
(panda-init)
(load "package://panda_eus/euslisp/panda-interface.l") ;; FR3: (load "package://panda_eus/euslisp/fr3-interface.l")
(panda-init) ;; FR3: (fr3-init)
(send *robot* :angle-vector (send *robot* :reset-pose))
(when (send *ri* :check-error)
(send *ri* :recover-error))
Expand Down
19 changes: 2 additions & 17 deletions jsk_panda_robot/panda_eus/euslisp/fr3-interface.l
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
(require :franka-common-interface "package://panda_eus/euslisp/franka-common-interface.l")
(require :panda-interface "package://panda_eus/euslisp/panda-interface.l")
(require :fr3-utils "package://panda_eus/euslisp/fr3-utils.l")

(defclass fr3-robot-interface
:super franka-common-interface
:super panda-robot-interface
:slots ())

(defmethod fr3-robot-interface
(:init
(&rest args)
(send-super* :init :robot fr3-robot
:joint-states-topic "joint_states"
:all-arms (list :rarm)
:all-arm-aliases (list :arm)
:error-topics (list "/franka_state_controller/franka_states")
:error-topic-types (list franka_msgs::FrankaState)
:error-recovery-action "/franka_control/error_recovery"
:gripper-action-prefixes (list "")
args))
(:default-controller
()
(list
(list
(cons :controller-action "/position_joint_trajectory_controller/follow_joint_trajectory")
(cons :controller-state "/position_joint_trajectory_controller/state")
(cons :action-type control_msgs::FollowJointTrajectoryAction)
(cons :joint-names (send-all (send robot :joint-list) :name)))))
)

(defun fr3-init ()
Expand Down
4 changes: 2 additions & 2 deletions jsk_panda_robot/panda_eus/euslisp/panda-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

(defmethod panda-robot-interface
(:init
(&rest args)
(send-super* :init :robot panda-robot
(&rest args &key (robot panda-robot))
(send-super* :init :robot robot
:joint-states-topic "joint_states"
:all-arms (list :rarm)
:all-arm-aliases (list :arm)
Expand Down

0 comments on commit 57f70bd

Please sign in to comment.