Closed
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
Greptile SummaryThis PR refactors the navigation system by extracting controller logic into separate classes and improving replanning robustness. Key Changes:
Minor Issues:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant GlobalPlanner
participant ReplanLimiter
participant LocalPlanner
participant Controller
participant NavigationMap
User->>GlobalPlanner: handle_goal_request(goal)
GlobalPlanner->>ReplanLimiter: reset()
GlobalPlanner->>GlobalPlanner: _plan_path()
GlobalPlanner->>GlobalPlanner: _find_safe_goal(goal)
alt Goal in UNKNOWN cell
GlobalPlanner->>GlobalPlanner: return goal (skip safety check)
else Goal needs validation
GlobalPlanner->>NavigationMap: find_safe_goal()
end
GlobalPlanner->>GlobalPlanner: _find_wide_path()
GlobalPlanner->>LocalPlanner: start_planning(path)
loop Navigation Loop
LocalPlanner->>Controller: advance(lookahead, odom)
Controller->>Controller: compute yaw_error
alt Simulation
Controller->>Controller: PController (P control)
else Hardware
Controller->>Controller: PdController (PD control)
end
Controller-->>LocalPlanner: Twist command
LocalPlanner->>User: publish cmd_vel
alt Obstacle detected
LocalPlanner->>GlobalPlanner: stopped_navigating("obstacle_found")
GlobalPlanner->>ReplanLimiter: can_retry(position)
alt Traveled >= 2m from stuck position
ReplanLimiter->>ReplanLimiter: reset attempt counter
end
alt Attempts < max_attempts
ReplanLimiter-->>GlobalPlanner: true
GlobalPlanner->>GlobalPlanner: _replan_path()
else Too many attempts
ReplanLimiter-->>GlobalPlanner: false
GlobalPlanner->>GlobalPlanner: cancel_goal()
end
end
alt Robot veered off path
GlobalPlanner->>GlobalPlanner: _replan_path()
end
alt Robot stuck (no state change)
GlobalPlanner->>GlobalPlanner: _replan_path()
end
alt Goal reached
LocalPlanner->>GlobalPlanner: stopped_navigating("arrived")
GlobalPlanner->>User: goal_reached
end
end
|
Comment on lines
+346
to
+349
| can_pass_under: float = 0.6 | ||
| can_climb: float = 0.15 | ||
| ignore_noise: float = 0.05 | ||
| smoothing: float = 1.0 |
Contributor
There was a problem hiding this comment.
style: new config parameters added but not used anywhere in the code
Suggested change
| can_pass_under: float = 0.6 | |
| can_climb: float = 0.15 | |
| ignore_noise: float = 0.05 | |
| smoothing: float = 1.0 |
leshy
approved these changes
Dec 27, 2025
| import math | ||
|
|
||
|
|
||
| def angle_diff(a: float, b: float) -> float: |
Contributor
There was a problem hiding this comment.
Vector3 supports angle diffs, just noting, should add Vector2 eventually
Merged
Contributor
|
merged via #887 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
simple_occupancywent from0.01057to0.00166.height_cost_occupancywent from0.04679to0.01817.