-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add a progress check so the controller can abort execution when it's stuck #6
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
Conversation
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.
Pull request overview
This PR adds a progress check feature to detect when the robot is stuck and also fixes a bug in the XTE cost function calculation.
Key Changes:
- Implements progress monitoring using translation distance and trajectory cost reduction thresholds over a configurable timeframe
- Fixes bug in
XTECostFunctionwhereplan_polyline_was incorrectly used instead ofref_and corrects distance calculation - Replaces
first_flag andreached_goal_boolean with a proper state machine (IDLE,MOVING,REACHED_GOAL,FAILED_GOAL)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| mesh_mppi/src/scoring/XTECostFunction.cpp | Fixes cost calculation bug by using correct reference polyline and distance method; adds documentation for edge case |
| mesh_mppi/src/controller/MeshMPPIBase.cpp | Adds progress check parameters, implements isMakingProgress() method, integrates state machine, and adds centralized logger |
| mesh_mppi/include/mesh_mppi/optimizer/MPPIOptimizer.inl | Updates Result initialization to include cost field using designated initializers |
| mesh_mppi/include/mesh_mppi/optimizer/MPPIOptimizer.hpp | Adds cost field to Result struct for progress tracking |
| mesh_mppi/include/mesh_mppi/controller/MeshMPPIBase.hpp | Adds StateMachine enum, progress check members, logger, and removes first_ and reached_goal_ flags |
| mesh_mppi/include/mesh_mppi/controller/MeshMPPI.inl | Integrates progress check, changes future handling logic, adds cost extraction, and updates to use centralized logger |
| mesh_mppi/include/mesh_mppi/controller/MeshMPPI.hpp | Implements resetFuture() method required by base class |
| README.md | Documents the three new progress check parameters with descriptions and default values |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
|
Fixes #4 |
Does what the title says.
Also fixes a bug in the cost function calculation.
This feature adds two 3 parameters:
A threshold for distance traveled
A threshold for % trajectory cost reduction
And a timeframe to monitor
If both thresholds are violated in the monitored timeframe the robot is considered stuck and an appropriate outcome is reported in the ExePath action.