Skip to content

Commit

Permalink
Merge pull request #396 from YutoUchimi/fix_retval_clear-costmap
Browse files Browse the repository at this point in the history
Fix return value of clear-costmap function
  • Loading branch information
k-okada authored Dec 14, 2019
2 parents 793fefc + c728552 commit 5d30e29
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pr2eus/robot-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -1801,11 +1801,10 @@ 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)))
t)
(call-empty-service srv-name))
)
(:change-inflation-range
(&optional (range 0.2)
&key (node-name "/move_base_node")
Expand Down Expand Up @@ -1939,14 +1938,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"
(if (and (boundp '*ri*) (derivedp *ri* robot-move-base-interface))
(send *ri* :clear-costmap)
"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))))
t)
(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 5d30e29

Please sign in to comment.