Skip to content

Commit

Permalink
Avoid double waiting for service and add doc for return value in clea…
Browse files Browse the repository at this point in the history
…r-costmap
  • Loading branch information
YutoUchimi committed Oct 2, 2019
1 parent 766cd7f commit c728552
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pr2eus/robot-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -1741,10 +1741,9 @@ Return value is a list of interpolatingp for all controllers, so (null (some #'i
)
(:clear-costmap
()
"Send signal to clear costmap for obstacle avoidance to move_base."
"Send signal to clear costmap for obstacle avoidance to move_base and return t if succeeded."
(let ((srv-name (format nil "~A/clear_costmaps" (send move-base-action :name))))
(if (ros::wait-for-service srv-name 0)
(call-empty-service srv-name)))
(call-empty-service srv-name))
)
(:change-inflation-range
(&optional (range 0.2)
Expand Down Expand Up @@ -1879,14 +1878,13 @@ Return value is a list of interpolatingp for all controllers, so (null (some #'i
;;

(defun clear-costmap (&key (node-name "/move_base_node"))
"reset local costmap and clear unknown grid around robot"
"reset local costmap, clear unknown grid around robot and return t if succeeded"
(if (and (and (boundp '*ri*) (derivedp *ri* robot-move-base-interface))
(send *ri* :clear-costmap))
t
;; for backward compatibility
(let ((srv-name (format nil "/~A/clear_costmaps" node-name)))
(if (ros::wait-for-service srv-name 0)
(call-empty-service srv-name)))))
(call-empty-service srv-name))))

(defun change-inflation-range (&optional (range 0.2)
&key (node-name "/move_base_node")
Expand Down

0 comments on commit c728552

Please sign in to comment.