Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fix_KXR_demo (amabe bthesis demo) #1363

Draft
wants to merge 129 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
e2158ad
made ws and base of amabe_screw.l
softyanija Jun 3, 2021
49e531f
made amabe_screw.l and _pre
softyanija Jun 4, 2021
58c23ad
tighten a screw twice
softyanija Jun 7, 2021
b013b99
made amabe_loosen_screw
softyanija Jun 7, 2021
6af496b
made amabe_pick_screw.l
softyanija Jun 7, 2021
ef38272
made amabe_plug.l
softyanija Jun 8, 2021
eedc288
made half of amabe_set_fix.l
softyanija Jun 8, 2021
ca01902
made amabe_set_kxr.l
softyanija Jun 11, 2021
227aa3a
add grasp_demo.l
softyanija Jun 14, 2021
6560926
making amabe_pub_posestamped.l
softyanija Jun 18, 2021
3fd9ace
success to publish /pose_stamped_rarm
softyanija Jun 18, 2021
56471a4
amabe_pub_pose_stamped.l can send posestamped of both hands
softyanija Jun 18, 2021
126ef90
changed topic name which amabe_pub_pose_stamped.l publishes
softyanija Jun 18, 2021
7e2252f
add cable-insertion_naive_init.l
softyanija Jun 25, 2021
770849e
delete amabe_pub_pose_stamped.l because I made same role program in j…
softyanija Jun 25, 2021
af18cf9
add cable-insertion_naive_grasp.l
softyanija Jun 25, 2021
50d83c9
modified name of *_grasp.l and some of content
softyanija Jun 25, 2021
e0cbcfd
changed stop-grasp width from 0.04 to 0.02
softyanija Jun 25, 2021
2768603
modified detail of *_grasp.l
softyanija Jun 25, 2021
d2b12c2
add cable-insertion_naive_insert.l
softyanija Jun 25, 2021
d288e5e
add cable-inserition_naive_demonstration_collector.py
softyanija Jun 28, 2021
afdfdd0
deleted unnecessary commentouts
softyanija Jun 28, 2021
7a7277e
add (exit) to end of init.l
softyanija Jun 28, 2021
2d4d092
add self.save_dir_base
softyanija Jun 28, 2021
715636d
set save_dir_base /home/amabe/rosbag/panda
softyanija Jun 28, 2021
7dc9cef
modified grasp.l and insert.l to made them conforming to demonstration
softyanija Jun 29, 2021
38bb961
modeified L63, start_rosbag_record
softyanija Jun 29, 2021
212a657
add setting_script_path in demonstration.py
softyanija Jun 29, 2021
9b8cf2f
add setting fase in demonstration
softyanija Jun 29, 2021
2eb8a1f
made loop which wait for Enter in init.l and adjast demonstration to it
softyanija Jun 29, 2021
9ef6ed3
made minor change to insert cable, but couldn't
softyanija Jun 29, 2021
01b943e
add :translation-axis t in init.l
softyanija Jul 1, 2021
3fb0735
add files to heuristic_insertion demo
softyanija Jul 1, 2021
7c8bf42
now we can choice success or fault or don't save
softyanija Jul 1, 2021
661fd87
commit the progress until midtermreport
softyanija Sep 24, 2021
b70089a
wrote repairdemo_init.l and place.l
softyanija Oct 7, 2021
0124b8c
completed repairdemo
softyanija Oct 8, 2021
fff14ed
organized files
softyanija Oct 11, 2021
08dae46
made check-pose.l
softyanija Oct 11, 2021
3b80c9c
made rarmcoop_test demo
softyanija Oct 12, 2021
b767852
wrote some files to packaging
softyanija Oct 20, 2021
de54706
made files for apriltag
softyanija Oct 20, 2021
cd36bb1
wrote timeout-joint-list func
softyanija Oct 22, 2021
6c49748
now KXR can move accoding to /panda_order
softyanija Oct 25, 2021
f3576fc
made outline of branch according to timeout servo
softyanija Oct 26, 2021
3004174
made and incorporate func to coop
softyanija Oct 27, 2021
801a371
made panda-kxr-coop demo
softyanija Oct 29, 2021
723352c
add larm mode
softyanija Nov 1, 2021
18f5f35
changed kxr.l
softyanija Nov 1, 2021
e38e9cd
made apriltag_dual_panda_second.launch
softyanija Nov 29, 2021
856b5f2
adjast tags' size
softyanija Nov 29, 2021
15bb56c
[fix_kxr] made marker_pickup.l
softyanija Dec 1, 2021
f45bd5a
[fix_kxr_apriltag] changed 'size' from diameter to radius
softyanija Dec 1, 2021
bddc32c
deleted maker_test/
softyanija Dec 2, 2021
29dc0d7
[fix_kxr] start to make grasp_cable demo
softyanija Dec 3, 2021
167a6c9
[fix_kxr] add ckeck-camera function
softyanija Dec 7, 2021
a47afc6
[fix_kxr_apriltag] change tag from 21circle to 36h11
softyanija Dec 8, 2021
da6731d
[fix_kxr_apriltag] 002 of tag36h11 can be recognized
softyanija Dec 8, 2021
4d5a205
[fix_kxr_apriltag] add max_hamming_dist
softyanija Dec 8, 2021
9dfddb7
[fix_kxr_apriltag] add some tag info
softyanija Dec 8, 2021
909c9b6
change name apriltag_setting/ to config/
softyanija Dec 9, 2021
417c132
write launch of both right and left
softyanija Dec 9, 2021
01e36c6
[euslisp/grasp_cable] start to make grasp_cable-demo
softyanija Dec 9, 2021
0fe3860
[grasp_cable] get parameters of grasp rarm-elbow-p from below
softyanija Dec 10, 2021
b1f7849
[euslisp/grasp_cable] make larm-grasp-rarm-elbow-p-servo-from-below f…
softyanija Dec 10, 2021
242465d
[euslisp/grasp_cable] make rarm-srearch-servo-tag and func which supp…
softyanija Dec 10, 2021
ad970d9
[euslisp/grasp_cable] complete rarm-search-servo-tag
softyanija Dec 13, 2021
82344f9
[euslisp/grasp_cable] preparing to grasp cable
softyanija Dec 13, 2021
ad57108
[euslisp/grasp_cable] fix typo in parameters.l
softyanija Dec 14, 2021
4e64ac4
[euslisp/grasp_cable] made rarm_grasp_cable
softyanija Dec 14, 2021
ac6c116
[euslisp] rename grasp_cable/ -> grasp_and_insert_cable/
softyanija Dec 14, 2021
6f8ff1f
[euslisp/grasp_and_insert_cable] adjust descriptions in files
softyanija Dec 14, 2021
6772120
[euslisp/grasp_and_insert_cable] changed name of grobal var of frame,…
softyanija Dec 14, 2021
228f9ab
[euslisp/grasp_and_insert_cable] deleted check_camera func
softyanija Dec 15, 2021
fa60e28
deleted #cable-insertion_heuristic_init.l#
softyanija Dec 15, 2021
187e5c2
[euslisp/grasp_and_insert_cable] start to make arrangement motion
softyanija Dec 15, 2021
32a0f12
[euslisp/grasp_and_insert_cable] completed arrangement motion
softyanija Dec 16, 2021
2ef5a41
[euslisp/grasn_and_insert_cable] now rarm can move around cable socke…
softyanija Dec 16, 2021
dbb1e31
[euslisp] make panda_commons/ and move utils.l and parameters.l to th…
softyanija Dec 17, 2021
30169ef
[config/apriltag] changed tag name of cables
softyanija Dec 17, 2021
0ca08a9
[euslisp/arrange_to_jig] start to write arrange_to_jig.l
softyanija Dec 17, 2021
72fd760
[config/apriltag] add new tags
softyanija Dec 17, 2021
da5977c
[euslisp/arrange_to_jig] made search-body func
softyanija Dec 18, 2021
cb54a01
[euslisp/grasp_and_insert_cable] write moving to above socket
softyanija Dec 20, 2021
285e371
[euslisp/grasp_and_insert_cable] start to make cable insert algorithm
softyanija Dec 21, 2021
108d9c5
[euslisp/grasp_and_insert_cable] made insert motion
softyanija Dec 21, 2021
0a3c450
[euslisp/grasp_and_insert_cable] adjusting to complete demo
softyanija Dec 22, 2021
fcb6b10
[euslisp/grasp_and_insert_cable] adjusting to complete demo 2
softyanija Dec 23, 2021
300db0b
[euslisp/grasp_and_insert_cable] rename func
softyanija Dec 23, 2021
9d8baf9
[euslisp/grasp_and_insert_cable] making move to set KXR to jig
softyanija Dec 23, 2021
e0e10bd
[euslisp/grasp_and_insert_cable] made mve to set KXR to jig, and reom…
softyanija Dec 24, 2021
ad7fc33
[euslisp/grasp_and_insert_cable] added larm-release-rarm-elbow-p-serv…
softyanija Dec 27, 2021
b51ca67
[euslisp/grasp_and_insert_cable] adjust detail to accurate insertion
softyanija Dec 28, 2021
1c71960
[euslisp/grasp_and_insert_cable] start to use color detection to accu…
softyanija Dec 28, 2021
63e800f
[euslisp/grasp_and_insert_cable] complete color recognition part
softyanija Dec 29, 2021
5c10378
[srv,euslisp] prepare RepairInfo service and wrote test program
softyanija Jan 3, 2022
a2fa2f2
[euslisp] add conditional branch
softyanija Jan 3, 2022
0976cf6
[euslisp/service-test] check communication with kxr
softyanija Jan 4, 2022
b4f7d44
[euslisp/main] push before change RepairInfo and do catkin build
softyanija Jan 4, 2022
46d7550
[euslisp/main] changed RepairInfo.srv and now we can send joint_state…
softyanija Jan 4, 2022
9ee45a9
[euslisp/main] start to write panda_main
softyanija Jan 4, 2022
dec1503
[euslisp/main] made decide-target-servo func
softyanija Jan 5, 2022
6e61d1d
[euslisp/main] made base
softyanija Jan 5, 2022
234efb4
[euslisp/main] wrote program for repairing rarm-elbow-p-servo
softyanija Jan 5, 2022
b8da80a
[launch] add cable_terminal_detection.launch
softyanija Jan 7, 2022
ee9b68a
[euslisp/main] add stand-pose func
softyanija Jan 7, 2022
2f07e36
[euslisp/main] wrote part of picking up KXR and release
softyanija Jan 7, 2022
208c2e7
[euslisp/main] prepared for repair rleg-ankle-r-servo demo
softyanija Jan 8, 2022
162442e
[euslisp/main] make poses for repairing rleg-ankle-r-servo
softyanija Jan 8, 2022
2d0af34
fix_kxr_detections.launch
softyanija Jan 10, 2022
7c526b0
[euslisp/main] fix typo
softyanija Jan 10, 2022
718a830
[euslisp/main] fixed details for demo
softyanija Jan 10, 2022
d996424
add show_grasp_param to visualize
softyanija Jan 16, 2022
a62c0e5
[euslisp/main] adjusted grasp-cable and add arange-cable
softyanija Jan 16, 2022
40ed93a
[euslisp] succesed insertion demo
softyanija Jan 20, 2022
7ad2a46
[euslisp] made progress
softyanija Jan 23, 2022
c370224
[euslisp] make rleg-ankle demo
softyanija Jul 8, 2022
f12075d
Merge branch 'fix_kxr_apriltag' into fix_kxr
softyanija Jul 8, 2022
b554da4
[launch] add comment which show apriltag_continuous_detection.launch …
softyanija Jul 8, 2022
945ac6e
[euslisp/repairdemo] detele tmp files
softyanija Jul 8, 2022
f4b371c
[euslisp] make experiment dir and move market_test to this
softyanija Jul 8, 2022
dff4fe7
[euslisp/move_test] detele tmp files
softyanija Jul 8, 2022
211cef0
[euslisp/move_test] delete amabe_screw_memo.xtx
softyanija Jul 8, 2022
e0dba2f
[launch/apriltag_doctor_panda_left&right] fix path to config files
softyanija Jul 11, 2022
2f2a17f
Writing README
softyanija Jul 22, 2022
16e9092
update README
softyanija Jul 22, 2022
6b89714
fix expression
softyanija Jul 22, 2022
5677ef3
Change camera topic name (/*arm_vision/camera -> /*arm_camera)
pazeshun Nov 24, 2022
2e8009b
Merge pull request #4 from pazeshun/fix_kxr_change_topic_name
softyanija Nov 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions jsk_2021_fix_kxr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 2.8.3)
project(jsk_2021_fix_kxr)

find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
sensor_msgs
message_generation
)

add_message_files(
FILES
Repair.msg
)

add_service_files(
FILES
RepairInfo.srv
)

generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
)

catkin_package(
# INCLUDE_DIRS include
# LIBRARIES ros_lecture
CATKIN_DEPENDS roscpp rospy std_msgs sensor_msgs message_runtime
# DEPENDS system_lib
)

install(DIRECTORY euslisp
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
48 changes: 48 additions & 0 deletions jsk_2021_fix_kxr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# jsk_2021_fix_kxr
Fix KXR whose connector was removal by dual_panda2.

## Installation
### Connecting KXR with your PC and starting communication
According to [here](https://www.google.com/url?sa=j&url=https%3A%2F%2Fgitlab.jsk.imi.i.u-tokyo.ac.jp%2Frcb4eus%2Frcb4eus%2F-%2Fwikis%2Fhome&uct=1649641403&usg=XDviwd1cl8Mh3gkoKqJNqcVi3k8.&source=chat), set up KXR and connect KXR to 133.x network through wifi.


After setting up KXR, connet to your pc
```
cd ~/prog/rcb4eus/Arduino/M5Stack/M5Stack_rcb4_rosserial
roslaunch rosserial_wifi.launch
```

In the other terminal, start communication with dual_panda2
```
cd ~/prog/rcb4eus
source ~/(ws)/devel/setup.bash
roseus ~/.../jsk_2021_fix_kxr/euslisp/main/kxr_main.l
```
### Launching dual_panda2
In leus@dual_panda2,
```
roslaunch jsk_panda_startup dual_panda2.launch
```

In your pc, launch detection nodes to recognize apriltag and terminal of connector
```
rossetdualpanda2
source ~/(ws)/devel/setup.bash
roslaunch jsk_2021_fix_kxr fix_kxr_detections.launch
```

## Execution
After setting KXR on workbench as shown in the figure below、start demo

<img src="https://user-images.githubusercontent.com/48650394/180359214-30ca4f64-6571-4abb-a6cf-ea169517f0cb.png" width="550px">

```
rossetdualpanda2
source ~/(ws)/devel/setup.bash
roseus jsk_2021_fix_kxr/euslisp/main/panda_main.l
```

## Video
See [here](https://drive.google.com/file/d/14vz8pw_OfTtmtCxj7IQx12pf1VkxYJls/view?usp=sharing)

##
12 changes: 12 additions & 0 deletions jsk_2021_fix_kxr/config/apriltag/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AprilTag 3 code parameters
# Find descriptions in apriltag/include/apriltag.h:struct apriltag_detector
# apriltag/include/apriltag.h:struct apriltag_family
tag_family: 'tag36h11' # options: tagStandard52h13, tagStandard41h12, tag36h11, tag25h9, tag16h5, tagCustom48h12, tagCircle21h7, tagCircle49h12
tag_threads: 2 # default: 2
tag_decimate: 1.0 # default: 1.0
tag_blur: 0.0 # default: 0.0
tag_refine_edges: 1 # default: 1
tag_debug: 1 # default: 0
max_hamming_dist: 2
# Other parameters
publish_tf: true # default: false
57 changes: 57 additions & 0 deletions jsk_2021_fix_kxr/config/apriltag/tags_for_left.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# # Definitions of tags to detect
#
# ## General remarks
#
# - All length in meters
# - Ellipsis (...) signifies that the previous element can be repeated multiple times.
#
# ## Standalone tag definitions
# ### Remarks
#
# - name is optional
#
# ### Syntax
#
# standalone_tags:
# [
# {id: ID, size: SIZE, name: NAME},
# ...
# ]
standalone_tags:
[
{id: 1, size: 0.0295, name: 'lpov-body_back'},
{id: 2, size: 0.0152, name: 'lpov-rarm_elbow_p_servo'},
{id: 3, size: 0.0152, name: 'lpov-rarm_shoulder_r_servo'},
{id: 4, size: 0.0152, name: 'lpov-rleg_ankle_r_servo'},
{id: 5, size: 0.0152, name: 'lpov-larm_elbow_p_servo'},
{id: 6, size: 0.0152, name: 'lpov-larm_shoulder_r_servo'},
{id: 7, size: 0.0152, name: 'lpov-lleg_ankle_r_servo'},
{id: 8, size: 0.0052, name: 'lpov-rarm_elbow_p_cable_r_f'},
{id: 9, size: 0.0052, name: 'lpov-rarm_elbow_p_cable_r_b'},
{id: 10, size: 0.0052, name: 'lpov-rarm_elbow_p_cable_l_f'},
{id: 11, size: 0.0052, name: 'lpov-rarm_elbow_p_cable_l_b'},
]
# ## Tag bundle definitions
# ### Remarks
#
# - name is optional
# - x, y, z have default values of 0 thus they are optional
# - qw has default value of 1 and qx, qy, qz have default values of 0 thus they are optional
#
# ### Syntax
#
# tag_bundles:
# [
# {
# name: 'CUSTOM_BUNDLE_NAME',
# layout:
# [
# {id: ID, size: SIZE, x: X_POS, y: Y_POS, z: Z_POS, qw: QUAT_W_VAL, qx: QUAT_X_VAL, qy: QUAT_Y_VAL, qz: QUAT_Z_VAL},
# ...
# ]
# },
# ...
# ]
tag_bundles:
[
]
57 changes: 57 additions & 0 deletions jsk_2021_fix_kxr/config/apriltag/tags_for_right.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# # Definitions of tags to detect
#
# ## General remarks
#
# - All length in meters
# - Ellipsis (...) signifies that the previous element can be repeated multiple times.
#
# ## Standalone tag definitions
# ### Remarks
#
# - name is optional
#
# ### Syntax
#
# standalone_tags:
# [
# {id: ID, size: SIZE, name: NAME},
# ...
# ]
standalone_tags:
[
{id: 1, size: 0.0295, name: 'rpov-body_back'},
{id: 2, size: 0.0152, name: 'rpov-rarm_elbow_p_servo'},
{id: 3, size: 0.0152, name: 'rpov-rarm_shoulder_r_servo'},
{id: 4, size: 0.0152, name: 'rpov-rleg_ankle_r_servo'},
{id: 5, size: 0.0152, name: 'rpov-larm_elbow_p_servo'},
{id: 6, size: 0.0152, name: 'rpov-larm_shoulder_r_servo'},
{id: 7, size: 0.0152, name: 'rpov-lleg_ankle_r_servo'},
{id: 8, size: 0.0052, name: 'rpov-rarm_elbow_p_cable_r_f'},
{id: 9, size: 0.0052, name: 'rpov-rarm_elbow_p_cable_r_b'},
{id: 10, size: 0.0052, name: 'rpov-rarm_elbow_p_cable_l_f'},
{id: 11, size: 0.0052, name: 'rpov-rarm_elbow_p_cable_l_b'},
]
# ## Tag bundle definitions
# ### Remarks
#
# - name is optional
# - x, y, z have default values of 0 thus they are optional
# - qw has default value of 1 and qx, qy, qz have default values of 0 thus they are optional
#
# ### Syntax
#
# tag_bundles:
# [
# {
# name: 'CUSTOM_BUNDLE_NAME',
# layout:
# [
# {id: ID, size: SIZE, x: X_POS, y: Y_POS, z: Z_POS, qw: QUAT_W_VAL, qx: QUAT_X_VAL, qy: QUAT_Y_VAL, qz: QUAT_Z_VAL},
# ...
# ]
# },
# ...
# ]
tag_bundles:
[
]
37 changes: 37 additions & 0 deletions jsk_2021_fix_kxr/euslisp/arrange_to_jig/arrange_to_jig.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env roseus

(require "package://panda_eus/euslisp/dual_panda-interface.l")
(require "package://jsk_2021_fix_kxr/euslisp/panda_commons/parameters.l")
(require "package://jsk_2021_fix_kxr/euslisp/panda_commons/utils.l")

(ros::roseus-add-msgs "franka_msgs")
(ros::roseus-add-msgs "franka_gripper")
(ros::roseus-add-msgs "std_msgs")
(ros::roseus-add-msgs "sensor_msgs")
(ros::roseus-add-msgs "geometry_msgs")

(ros::load-ros-manifest "franka_msgs")
(ros::load-ros-manifest "apriltag_ros")

(ros::roseus "grasp_and_insert_cable")

(dual_panda-init)

(objects (list *robot*))

(send *ri* :set-joint-pd-gain "larm_joint1" 1000 30)
(send *ri* :set-joint-pd-gain "larm_joint2" 1000 30)
(send *ri* :set-joint-pd-gain "larm_joint3" 1000 30)
(send *ri* :set-joint-pd-gain "larm_joint4" 1000 30)
(send *ri* :set-joint-pd-gain "larm_joint5" 500 15)
(send *ri* :set-joint-pd-gain "larm_joint6" 300 15)
(send *ri* :set-joint-pd-gain "larm_joint7" 100 10)
(send *ri* :set-joint-pd-gain "rarm_joint1" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint2" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint3" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint4" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint5" 500 15)
(send *ri* :set-joint-pd-gain "rarm_joint6" 300 15)
(send *ri* :set-joint-pd-gain "rarm_joint7" 100 10)

(setq search-body-result (search-body))
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env roseus

(require "package://panda_eus/euslisp/dual_panda-interface.l")
(ros::roseus-add-msgs "franka_msgs")
(ros::roseus-add-msgs "franka_gripper")
(dual_panda-init)

(objects (list *robot*))

(send *ri* :stop-grasp :rarm :width 0.006)

(send *ri* :set-joint-pd-gain "rarm_joint1" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint2" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint3" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint4" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint5" 500 15)
(send *ri* :set-joint-pd-gain "rarm_joint6" 300 15)
(send *ri* :set-joint-pd-gain "rarm_joint7" 100 10)

(send *robot* :reset-pose)
(send *robot* :larm :move-end-pos #f(-500 0 0))
(send *robot* :rarm :inverse-kinematics (send (send *robot* :copy-worldcoords) :transform (make-coords :pos #f(547 -18 825) :rpy (float-vector -3.14 1.57 1.57))) :translation-axis t :rotation-axis t)
(send *ri* :angle-vector (send *robot* :angle-vector) 3000)
(send *ri* :wait-interpolation)

(do-until-key
(print "waiting for Enter...")
(unix::sleep 1))

(send *ri* :start-grasp :rarm :effort 100)
(unix::sleep 1)

(exit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env roseus

(require "package://panda_eus/euslisp/dual_panda-interface.l")
(ros::roseus-add-msgs "franka_msgs")
(ros::roseus-add-msgs "franka_gripper")
(ros::roseus-add-msgs "std_msgs")
(ros::roseus-add-msgs "sensor_msgs")
(ros::roseus-add-msgs "geometry_msgs")
(ros::load-ros-manifest "franka_msgs")

(dual_panda-init)

(objects (list *robot*))

(ros::roseus "cable-insertion_heuristic_insert")

(send *ri* :set-joint-pd-gain "rarm_joint1" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint2" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint3" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint4" 1000 30)
(send *ri* :set-joint-pd-gain "rarm_joint5" 500 15)
(send *ri* :set-joint-pd-gain "rarm_joint6" 300 15)
(send *ri* :set-joint-pd-gain "rarm_joint7" 100 10)

(setq ee-pos #f(547 -18 825))
(setq ee-rpy #f(-3.14 1.57 1.57))
(setq wrench_init (send (one-shot-subscribe "/dual_panda/rarm_state_controller/franka_states" franka_msgs::FrankaState) :k_f_ext_hat_k))

(send *robot* :reset-pose)
(send *robot* :larm :move-end-pos #f(-500 0 0))
(send *robot* :rarm :inverse-kinematics (send (send *robot* :copy-worldcoords) :transform (make-coords :pos ee-pos :rpy ee-rpy)) :translation-axis t :rotation-axis t)
(send *ri* :angle-vector (send *robot* :angle-vector) 3000)
(send *ri* :wait-interpolation)

(setq i 0)
(while (< i 20)
(setq base_stroke #f(0.6 0 0))

(setq wrench (send (one-shot-subscribe "/dual_panda/rarm_state_controller/franka_states" franka_msgs::FrankaState) :k_f_ext_hat_k))
(setq wrench_diff (v- wrench wrench_init))
(setq d_x (elt wrench_diff 0))
(setq d_y (elt wrench_diff 1))

(if (> d_x 1.2)
(setq base_stroke #f(0.2 0.0 0.3)))
(if (< d_x -0.7)
(setq base_stroke #f(0.2 0.0 -0.3)))

(if (> d_y 1.2)
(setq base_stroke #f(0.2 -0.3 0)))
(if (< d_y -1.2)
(setq base_stroke #f(-0.05 0.5 0)))
(send *robot* :angle-vector (send *ri* :state :potentio-vector))
(send *robot* :rarm :move-end-pos base_stroke)
(send *ri* :angle-vector (send *robot* :angle-vector) 1000)
(send *ri* :wait-interpolation)
(setq i (+ i 1))
(ros::ros-info (format nil "i = ~A" i))
(ros::ros-info (format nil "stroke is ~A" base_stroke)))

(send *ri* :stop-grasp :rarm :width 0.003)

(send *robot* :rarm :move-end-pos #f(10 0 -3))
(send *ri* :angle-vector (send *robot* :angle-vector) 3000)
(send *ri* :wait-interpolation)

(send *robot* :rarm :move-end-pos #f(-15 0 0))
(send *ri* :angle-vector (send *robot* :angle-vector) 2000)
(send *ri* :wait-interpolation)

(exit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env roseus

(require "package://panda_eus/euslisp/dual_panda-interface.l")
(ros::roseus-add-msgs "franka_msgs")
(ros::roseus-add-msgs "franka_gripper")

(dual_panda-init)

(send *ri* :start-grasp :rarm)
(unix::sleep 1)

(exit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env roseus

(require "package://panda_eus/euslisp/dual_panda-interface.l")
(ros::roseus-add-msgs "franka_msgs")
(ros::roseus-add-msgs "franka_gripper")

(dual_panda-init)

(objects (list *robot*))

(send *ri* :stop-grasp :rarm :width 0.006)

(send *robot* :reset-pose)
(send *robot* :larm :move-end-pos #f(-500 0 0))
(send *robot* :rarm :inverse-kinematics (send (send *robot* :copy-worldcoords) :transform (make-coords :pos #f(547 -18 825) :rpy (float-vector -3.14 1.57 1.57))) :translation-axis t :rotation-axis t)
(send *ri* :angle-vector (send *robot* :angle-vector) 3000)
(send *ri* :wait-interpolation)

(do-until-key
(print "waiting for Enter...")
(unix::sleep 1))

(send *ri* :start-grasp :rarm :effort 100)
(unix::sleep 1)

(exit)
Loading