|
215 | 215 | (ros::ros-info "manipulator-state-is-gripper-holding-item ~A" s) |
216 | 216 | s)) |
217 | 217 | (:pick-object-in-image |
218 | | - (image-source x y &optional (max-duration 15)) |
| 218 | + (image-source x y |
| 219 | + &key (max-duration 15) (wait t) grasp_constraint grasp_palm_to_fingertip axis_on_gripper_ewrt_gripper axis_to_align_with_ewrt_vo) |
| 220 | + (send pick-object-in-image-client :wait-for-server) |
219 | 221 | (let ((goal (instance spot_msgs::PickObjectInImageActionGoal :init))) |
220 | 222 | (print (list image-source x y max-duration)) |
221 | 223 | (send goal :goal :image_source image-source) |
222 | 224 | (send goal :goal :center (instance geometry_msgs::Point :init :x x :y y)) |
| 225 | + (case grasp_constraint |
| 226 | + (:FORCE_TOP_DOWN_GRASP (send goal :goal :grasp_constraint 1)) |
| 227 | + (:FORCE_HORIZONTAL_GRASP (send goal :goal :grasp_constraint 2)) |
| 228 | + (:FORCE_45_ANGLE_GRASP (send goal :goal :grasp_constraint 3)) |
| 229 | + (:FORCE_SQUEEZE_GRASP (send goal :goal :grasp_constraint 4)) |
| 230 | + (t (ros::ros-info "No grasp constraint"))) |
| 231 | + (if grasp_palm_to_fingertip (send goal :goal :grasp_palm_to_fingertip grasp_palm_to_fingertip)) |
| 232 | + (cond (axis_on_gripper_ewrt_gripper |
| 233 | + (send goal :goal :axis_on_gripper_ewrt_gripper :x (elt axis_on_gripper_ewrt_gripper 0)) |
| 234 | + (send goal :goal :axis_on_gripper_ewrt_gripper :y (elt axis_on_gripper_ewrt_gripper 1)) |
| 235 | + (send goal :goal :axis_on_gripper_ewrt_gripper :z (elt axis_on_gripper_ewrt_gripper 2)))) |
| 236 | + (cond (axis_to_align_with_ewrt_vo |
| 237 | + (send goal :goal :axis_to_align_with_ewrt_vo :x (elt axis_to_align_with_ewrt_vo 0)) |
| 238 | + (send goal :goal :axis_to_align_with_ewrt_vo :y (elt axis_to_align_with_ewrt_vo 1)) |
| 239 | + (send goal :goal :axis_to_align_with_ewrt_vo :z (elt axis_to_align_with_ewrt_vo 2)))) |
223 | 240 | (send goal :goal :max_duration (instance ros::duration :init max-duration)) |
224 | 241 | (send pick-object-in-image-client :send-goal goal :feedback-cb `(lambda (msg) (send ,self :pick-object-in-image-feedback-cb msg))) |
| 242 | + (if wait (send (send self :pick-object-in-image-wait-for-result) :success)) |
225 | 243 | )) |
226 | 244 | (:pick-object-in-image-feedback-cb |
227 | 245 | (msg) |
|
0 commit comments