Skip to content

Conversation

silanus23
Copy link
Contributor

@silanus23 silanus23 commented Oct 13, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5037
Primary OS tested on Ubuntu
Robotic platform tested on nav2 bringup
Does this PR contain AI generated software? util test
Was this PR description generated by AI software? nope

Description of contribution in a few bullet points

Description of documentation updates required from your changes

BT node addition
max_error parameter
If there is a document for it maybe upcoming xml

Description of how this change was tested

I tried to take inspiration from is_battery_low condition node. I created unit tests too.


Future work that may be required in bullet points

  • There is an upcoming xml I will put this in
<RateController hz="3.0">
          <Fallback name="PathTrackingRecoveryPlanner">
            <IsWithinPathTrackingBounds max_tracking_error="2.0" />
            <Fallback name="TieredReplanning">
              <ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
              <Sequence>
                <ClearEntireCostmap name="ClearGlobalCostmap-Tier2" service_name="global_costmap/clear_entirely_global_costmap"/>
                <RetryUntilSuccessful num_attempts="1">
                  <ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
                </RetryUntilSuccessful>
              </Sequence>
            </Fallback>
          </Fallback>
        </RateController>

place this in navigating path through pose xml.

Note:

I had to take out every file with copy paste to a new branch. Cause I had created this branch as a sub branch of the last messy branch. This was the only clean choice that can save me.
I think this will solve my cycling comments and confused commits problem.

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

Signed-off-by: silanus23 <[email protected]>
Signed-off-by: silanus23 <[email protected]>
Signed-off-by: silanus23 <[email protected]>
Signed-off-by: silanus23 <[email protected]>
Copy link
Contributor

mergify bot commented Oct 13, 2025

@silanus23, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

static BT::PortsList providedPorts()
{
return {
BT::InputPort<double>("max_error", 0.5, "Maximum allowed tracking error")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can set a default here really. I think this needs to be provided explicitly

<input_port name="battery_topic">Topic for battery info</input_port>
</Condition>

<Decorator ID="IsWithinPathTrackingBounds">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For docs: this needs to be having its configuration guide page + add to Navigation Plugins table + migration guide with the larger feature description

callback_group_executor_.add_callback_group(callback_group_, node_->get_node_base_interface());

tracking_feedback_sub_ = node_->create_subscription<nav2_msgs::msg::TrackingFeedback>(
"/tracking_feedback",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the forward slash, that messes with namespacing

: BT::ConditionNode(condition_name, conf),
last_error_(0.0)
{
node_ = config().blackboard->get<nav2::LifecycleNode::SharedPtr>("node");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think node needs to be stored in the class. Just the logger


if (!getInput("max_error", max_error_)) {
RCLCPP_ERROR(node_->get_logger(), "max_error parameter not provided");
max_error_ = 1.0; // Default fallback
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should return FAILURE. It must be set to use meaningfully

max_error_ = std::abs(max_error_);
}

if (last_error_ <= max_error_) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about left vs right different tolerances?

Comment on lines +42 to +43
RCLCPP_DEBUG(node_->get_logger(), "Initialized IsWithinPathTrackingBoundsCondition BT node");
RCLCPP_INFO_ONCE(node_->get_logger(), "Waiting for tracking error");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RCLCPP_DEBUG(node_->get_logger(), "Initialized IsWithinPathTrackingBoundsCondition BT node");
RCLCPP_INFO_ONCE(node_->get_logger(), "Waiting for tracking error");
RCLCPP_INFO(node_->get_logger(), "Initialized IsWithinPathTrackingBoundsCondition BT node");

RCLCPP_WARN(node_->get_logger(), "max_error should be positive, using absolute value");
max_error_ = std::abs(max_error_);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also check if we've recieved a path tracking error message yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants