Skip to content

SS-814 Revert "add intial_pose_is_ready flag" - Fix: robot localized with rviz, but keeps doing initialization behaviour #66

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

Open
wants to merge 1 commit into
base: humble-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 0 additions & 5 deletions nav2_amcl/include/nav2_amcl/amcl_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,7 @@ class AmclNode : public nav2_util::LifecycleNode
*/
void handleInitialPose(geometry_msgs::msg::PoseWithCovarianceStamped & msg);
bool init_pose_received_on_inactive{false};

// Flag signaling that the initial pose has been set
bool initial_pose_is_known_{false};

// Flag signaling that the initial pose has been received
bool initial_pose_is_ready_{false};
bool set_initial_pose_{false};
bool always_reset_initial_pose_;
double initial_pose_x_;
Expand Down
18 changes: 8 additions & 10 deletions nav2_amcl/src/amcl_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ AmclNode::getInitialPoseStatusCallback(
{
response->status = response->STATUS_NOT_READY;

if(initial_pose_is_ready_) response->status = response->STATUS_OK;
if(initial_pose_is_known_) response->status = response->STATUS_OK;
}

void
Expand Down Expand Up @@ -653,15 +653,13 @@ AmclNode::initialPoseReceived(geometry_msgs::msg::PoseWithCovarianceStamped::Sha
// Overriding last published pose to initial pose
last_published_pose_ = *msg;

if (!active_) {
init_pose_received_on_inactive = true;
RCLCPP_WARN(
get_logger(), "Received initial pose request, "
"but AMCL is not yet in the active state");
return;
}

initial_pose_is_ready_ = true;
if (!active_) {
init_pose_received_on_inactive = true;
RCLCPP_WARN(
get_logger(), "Received initial pose request, "
"but AMCL is not yet in the active state");
return;
}
}

handleInitialPose(*msg);
Expand Down