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

[pr2eus_moveit] Add timeout arg for computing IK and increase timeout for test #438

Merged
merged 2 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
9 changes: 5 additions & 4 deletions pr2eus_moveit/euslisp/robot-moveit.l
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,15 @@
consts))
(:planning-make-trajectory-to-coords ;; use-ik
(cds confkey &rest args &key (end-coords) ;; (list :rarm :end-coords)
(planning-time 5.0) (scene) (frame-id default-frame-id)
(planning-time 5.0) (scene) (frame-id default-frame-id) (timeout 0.05)
(planning-attempts 3) (retry) (use-scene t)
(multi-dof-joint-constraints)
&allow-other-keys)
"Solve inverse-kinematics for constructing joint constraints and request a plan"
(let (ret consts)
(unless scene (setq scene (send self :get-planning-scene)))
(setq ret (send self :get-ik-for-pose cds confkey :end-coords end-coords
:use-actual-seed t :retry retry :frame-id frame-id :scene scene :use-multi-dof t)) ;; (av . multi-dof-js) or nil
:use-actual-seed t :retry retry :frame-id frame-id :scene scene :timeout timeout :use-multi-dof t)) ;; (av . multi-dof-js) or nil
(unless ret (return-from :planning-make-trajectory-to-coords nil))
(when multi-dof-joint-constraints
(if (member :extra-goal-constraints args)
Expand Down Expand Up @@ -433,13 +433,14 @@
))
(:planning-move-arm-to-coords
(cds confkey &key (end-coords) ;; (list :rarm :end-coords)
(planning-time 5.0) (scene) (frame-id default-frame-id)
(planning-time 5.0) (scene) (frame-id default-frame-id) (timeout 0.05)
(planning-attempts 3) (retry) (use-scene t) (wait t)
&allow-other-keys)
(let (ret)
(unless scene (setq scene (send self :get-planning-scene)))
(unless (send self :get-ik-for-pose cds confkey :end-coords end-coords
:use-actual-seed t :retry retry :frame-id frame-id :scene scene)
:use-actual-seed t :retry retry :frame-id frame-id :scene scene
:timeout timeout)
(return-from :planning-move-arm-to-coords nil))
(send self :planning-move-arm confkey
:planning-time planning-time :planning-attempts planning-attempts
Expand Down
8 changes: 4 additions & 4 deletions pr2eus_moveit/test/test-pr2eus-moveit.l
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@

;; send target coords
(deftest test-move-end-coords-plan ()
(let (tm-0 tm-1 tm-diff)
(send *ri* :move-end-coords-plan (make-coords :pos #f(700 0 750)) :move-arm :rarm)
(send *ri* :move-end-coords-plan (make-coords :pos #f(700 0 500)) :move-arm :larm)
(let (tm-0 tm-1 tm-diff (timeout 0.5))
(send *ri* :move-end-coords-plan (make-coords :pos #f(700 0 750)) :move-arm :rarm :timeout timeout)
(send *ri* :move-end-coords-plan (make-coords :pos #f(700 0 500)) :move-arm :larm :timeout timeout)
(send *ri* :wait-interpolation)
(send *ri* :move-end-coords-plan (make-coords :pos #f(700 0 1000)) :move-arm :larm-torso)
(send *ri* :move-end-coords-plan (make-coords :pos #f(700 0 1000)) :move-arm :larm-torso :timeout timeout)
(setq tm-0 (ros::time-now))
(send *ri* :wait-interpolation)
(setq tm-1 (ros::time-now))
Expand Down