Skip to content
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

Behaviors access result #3704

Merged
merged 3 commits into from Jul 27, 2023

Conversation

jwallace42
Copy link
Collaborator

@jwallace42 jwallace42 commented Jul 21, 2023


Basic Info

Info Please fill out this column
Ticket(s) this addresses NONE
Primary OS tested on Ubuntu
Robotic platform tested on turtlebot

Description of contribution in a few bullet points

Allow recoveries to have access to the result. This allows behaviors to set the result message.

Description of documentation updates required from your changes


Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in navigation.ros.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

@@ -90,7 +90,7 @@ class TimedBehavior : public nav2_core::Behavior
// Implement the behavior such that it runs some unit of work on each call
// and provides a status. The Behavior will finish once SUCCEEDED is returned
// It's up to the derived class to define the final commanded velocity.
virtual ResultStatus onCycleUpdate() = 0;
virtual ResultStatus onCycleUpdate(std::shared_ptr<typename ActionT::Result> result) = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this make alot more sense in onActionCompletion?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't really have a preference. I figured it would be easy to leave it in onCycleUpdate. I can move it over though :).

Copy link
Member

Choose a reason for hiding this comment

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

Please do. I dont think cycle updates should need to populate the result. The ‘action complete’ callback seems like the right place

@@ -77,7 +77,7 @@ void AssistedTeleop::onActionCompletion()
preempt_teleop_ = false;
}

ResultStatus AssistedTeleop::onCycleUpdate()
ResultStatus AssistedTeleop::onCycleUpdate(std::shared_ptr<AssistedTeleopActionResult>)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: but add the commented out name /*result*/ like we do elsewhere in the codebase for all eq.

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (96673e2) 90.41% compared to head (0c17db2) 90.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3704      +/-   ##
==========================================
- Coverage   90.41%   90.40%   -0.01%     
==========================================
  Files         411      411              
  Lines       17801    17804       +3     
==========================================
+ Hits        16095    16096       +1     
- Misses       1706     1708       +2     
Files Changed Coverage Δ
nav2_behaviors/plugins/assisted_teleop.hpp 100.00% <ø> (ø)
...ehaviors/include/nav2_behaviors/timed_behavior.hpp 98.78% <100.00%> (+0.04%) ⬆️
nav2_behaviors/plugins/assisted_teleop.cpp 92.50% <100.00%> (ø)

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

Overall, looks good to me. Docs update per usual + I tink we need to update the tutorial on behavior API to mention this (and perhaps your other recent update)

nav2_behaviors/plugins/assisted_teleop.cpp Show resolved Hide resolved
@SteveMacenski SteveMacenski merged commit 2f1f9e4 into ros-navigation:main Jul 27, 2023
6 of 7 checks passed
@jwallace42
Copy link
Collaborator Author

@SteveMacenski,

can I backport this into iron?

@SteveMacenski
Copy link
Member

No, this is an ABI breaking change

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.

None yet

2 participants