Skip to content

Commit

Permalink
Merge branch 'master' into update_smach_to_mail_tsukamoto
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada authored Oct 31, 2023
2 parents d08f141 + 6caf38c commit 455d005
Show file tree
Hide file tree
Showing 15 changed files with 711 additions and 271 deletions.
33 changes: 32 additions & 1 deletion jsk_panda_robot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,35 @@
```


## Running single Panda
### 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>
```

2. Controlling single Panda 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)
(send *robot* :angle-vector (send *robot* :reset-pose))
(when (send *ri* :check-error)
(send *ri* :recover-error))
(send *ri* :angle-vector (send *robot* :angle-vector) 3000)
```
- Notice
- `(send *ri* :recover-error)` is required every time when you press and release the black switch (`activated` -> `monitored stop` -> `activated`).


## Running Dual-Panda
### Boot robot
1. Please turn on the controller box and unlock joints by accessing desk.
Expand Down Expand Up @@ -76,7 +105,9 @@
(send *ri* :recover-error))
(send *ri* :angle-vector (send *robot* :angle-vector) 3000)
```
`(send *ri* :recover-error)` is required every time when you press and release the black switch (`activated` -> `monitored stop` -> `activated`).
- Notice
- `(send *ri* :recover-error)` is required every time when you press and release the black switch (`activated` -> `monitored stop` -> `activated`).
- `dual_panda`'s `reset-pose` and `reset-manip-pose` are different from single `panda`'s ones for historical reasons.
#### Record/play rosbag
```bash
roslaunch jsk_panda_startup dual_panda1_record.launch # Or roslaunch jsk_panda_startup dual_panda2_record.launch
Expand Down
19 changes: 19 additions & 0 deletions jsk_panda_robot/jsk_panda_startup/launch/franka.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" ?>

<launch>
<arg name="robot_ip" default="192.168.0.2"/>
<arg name="robot" default="panda" />
<arg name="arm_id" default="$(arg robot)" />
<arg name="load_gripper" default="true" />
<arg name="xacro_args" default="" />

<include file="$(find franka_control)/launch/franka_control.launch">
<arg name="robot_ip" value="$(arg robot_ip)" />
<arg name="robot" value="$(arg robot)" />
<arg name="arm_id" value="$(arg arm_id)" />
<arg name="load_gripper" value="$(arg load_gripper)" />
<arg name="xacro_args" value="$(arg xacro_args)" />
</include>

<node name="position_joint_trajectory_controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="position_joint_trajectory_controller" />
</launch>
17 changes: 17 additions & 0 deletions jsk_panda_robot/jsk_panda_startup/launch/panda.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" ?>

<launch>
<arg name="robot_ip" default="192.168.0.2"/>
<arg name="robot" default="panda" />
<arg name="arm_id" default="$(arg robot)" />
<arg name="load_gripper" default="true" />
<arg name="xacro_args" default="" />

<include file="$(find jsk_panda_startup)/launch/franka.launch">
<arg name="robot_ip" value="$(arg robot_ip)" />
<arg name="robot" value="$(arg robot)" />
<arg name="arm_id" value="$(arg arm_id)" />
<arg name="load_gripper" value="$(arg load_gripper)" />
<arg name="xacro_args" value="$(arg xacro_args)" />
</include>
</launch>
2 changes: 2 additions & 0 deletions jsk_panda_robot/panda_eus/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
models/dual_panda.l
models/dual_panda.urdf
models/panda.l
models/panda.urdf
29 changes: 24 additions & 5 deletions jsk_panda_robot/panda_eus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ find_package(franka_description) # Just in case when description is not release

catkin_package()

###
### dual_panda.l generation
###
set(_franka_description_min_ver "0.10.0")
set(_xacro_min_ver "1.13.14")
if(franka_description_FOUND
Expand All @@ -25,6 +22,10 @@ if(franka_description_FOUND
# xacro.load_yaml cannot be recognized when xacro < 1.13.14, while it is recommended when xacro >= 1.13.14.
# PR introducing xacro.load_yaml: https://github.com/ros/xacro/pull/283
# Related issue: https://github.com/ros/xacro/issues/298

###
### dual_panda.l generation
###
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/models/dual_panda.l
COMMAND rosrun euscollada collada2eus -I dual_panda.urdf -C dual_panda.yaml -O dual_panda.l
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/models
Expand All @@ -34,9 +35,27 @@ if(franka_description_FOUND
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/models
DEPENDS ${PROJECT_SOURCE_DIR}/models/dual_panda.urdf.xacro)

add_custom_target(generate_panda_lisp ALL DEPENDS ${PROJECT_SOURCE_DIR}/models/dual_panda.l)
add_custom_target(generate_dual_panda_lisp ALL DEPENDS ${PROJECT_SOURCE_DIR}/models/dual_panda.l)

###
### panda.l generation
###
set(_panda_xacro ${franka_description_SOURCE_PREFIX}/robots/panda/panda.urdf.xacro) # franka_description is installed from source
if(NOT EXISTS ${_panda_xacro})
set(_panda_xacro ${franka_description_PREFIX}/share/franka_description/robots/panda/panda.urdf.xacro) # franka_description is installed from apt
endif()
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/models/panda.l
COMMAND rosrun euscollada collada2eus -I panda.urdf -C panda.yaml -O panda.l
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/models
DEPENDS ${PROJECT_SOURCE_DIR}/models/panda.urdf ${PROJECT_SOURCE_DIR}/models/panda.yaml)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/models/panda.urdf
COMMAND rosrun xacro xacro --inorder ${_panda_xacro} hand:=true > ${PROJECT_SOURCE_DIR}/models/panda.urdf
DEPENDS ${_panda_xacro})

add_custom_target(generate_panda_lisp ALL DEPENDS ${PROJECT_SOURCE_DIR}/models/panda.l)

else()
message(WARNING "Dependency is not met, so skip generating dual_panda.l")
message(WARNING "Dependency is not met, so skip generating panda.l and dual_panda.l")
message(WARNING "franka_description version: ${franka_description_VERSION}, must be >= ${_franka_description_min_ver}")
message(WARNING "xacro version: ${xacro_VERSION}, must be >= ${_xacro_min_ver}")
endif()
Expand Down
Loading

0 comments on commit 455d005

Please sign in to comment.