-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Path trackin conditon node #5602
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
base: main
Are you sure you want to change the base?
Path trackin conditon node #5602
Conversation
Signed-off-by: silanus23 <[email protected]>
Signed-off-by: silanus23 <[email protected]>
Signed-off-by: silanus23 <[email protected]>
Signed-off-by: silanus23 <[email protected]>
@silanus23, your PR has failed to build. Please check CI outputs and resolve issues. |
static BT::PortsList providedPorts() | ||
{ | ||
return { | ||
BT::InputPort<double>("max_error", 0.5, "Maximum allowed tracking error") |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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_) { |
There was a problem hiding this comment.
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?
RCLCPP_DEBUG(node_->get_logger(), "Initialized IsWithinPathTrackingBoundsCondition BT node"); | ||
RCLCPP_INFO_ONCE(node_->get_logger(), "Waiting for tracking error"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_); | ||
} | ||
|
There was a problem hiding this comment.
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.
Basic Info
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
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: