Skip to content

Commit

Permalink
Spin the node from the blackboard before calling getCurrentPose (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Jeronimo authored Jun 6, 2019
1 parent 916a6ee commit c6490ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions nav2_tasks/include/nav2_tasks/goal_reached_condition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class GoalReachedCondition : public BT::ConditionNode
{
auto current_pose = std::make_shared<geometry_msgs::msg::PoseWithCovarianceStamped>();

rclcpp::spin_some(node_);
if (!robot_->getCurrentPose(current_pose)) {
RCLCPP_DEBUG(node_->get_logger(), "Current robot pose is not available.");
return false;
Expand Down
1 change: 1 addition & 0 deletions nav2_tasks/include/nav2_tasks/is_localized_condition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class IsLocalizedCondition : public BT::ConditionNode
{
auto current_pose = std::make_shared<geometry_msgs::msg::PoseWithCovarianceStamped>();

rclcpp::spin_some(node_);
if (!robot_->getCurrentPose(current_pose)) {
RCLCPP_DEBUG(node_->get_logger(), "Current robot pose is not available.");
return false;
Expand Down

0 comments on commit c6490ea

Please sign in to comment.