Skip to content

Commit

Permalink
show 3d ray to the target object in Rviz when clicking Rviz Interacti…
Browse files Browse the repository at this point in the history
…veMarkers
  • Loading branch information
708yamaguchi committed May 13, 2020
1 parent b9b9d1d commit 22f38dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pr2eus_tutorials/euslisp/pr2-tabletop-object-grasp.l
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@
))

(defun grasp-target-callback (msg)
(grasp (send (bounding-box->cube msg) :worldpos)))
(let ((camera-to-base (send *tfl* :lookup-transform *camera-frame-id* *base-frame-id* (ros::time 0)))
(coords (make-coords :pos (send (bounding-box->cube msg) :worldpos))))
(send coords :transform camera-to-base :world)
(show-marker *camera-frame-id* (send coords :pos))
(grasp (send (bounding-box->cube msg) :worldpos))))

(defun grasp-target-2d-callback (msg)
(let ((base-to-camera (send *tfl* :lookup-transform *base-frame-id* *camera-frame-id* (ros::time 0)))
Expand Down Expand Up @@ -144,7 +148,7 @@
:rpy #f(0 0 0))
:rotation-axis t)
(publish-error "out of reach...")
(return-from grasp-target-callback nil))
(return-from grasp nil))
(publish-info "openning gripper...")

(setq *grasp-state* "reaching")
Expand Down Expand Up @@ -173,7 +177,7 @@
(send *ri* :stop-grasp *arm* :wait t)
(publish-info "back to pre grasp...")
(pr2-pregrasp-pose)
(return-from grasp-target-callback nil)))
(return-from grasp nil)))

(setq *grasp-state* "picking")
(publish-grasp-state)
Expand Down

0 comments on commit 22f38dc

Please sign in to comment.