Skip to content

Conversation

@redvinaa
Copy link
Contributor

@redvinaa redvinaa commented Jan 3, 2025

Reopen #4812 against main

@mergify
Copy link
Contributor

mergify bot commented Jan 3, 2025

@redvinaa, 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).

@SteveMacenski
Copy link
Member

@redvinaa before you ask, no this CI failure is also not from you. Geometry2 just changed a bunch of headers from .h to .hpp and the Rolling release with those changes came out last night. #4732 resolves, but need to merge that in and you'll need to pull in those changes or rebase. Then any CI failures are real 😆

@SteveMacenski
Copy link
Member

Rebase with #4823 for CI

@redvinaa redvinaa force-pushed the mppi-goal-to-critic branch from 07c373c to b9c3055 Compare January 6, 2025 09:41
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.

This breaks a MPPI unit test - please make sure that this works properly. You may need to broadcast a transformation in that test so that the getTransformedGoal method can function. Likewise in your other PR.

Otherwise, LGTM

@mergify
Copy link
Contributor

mergify bot commented Jan 9, 2025

@redvinaa, 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).

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.

Waiting on CI to turn over - sorry you've hit landmine after landmine in our usually very stable CI. I'm not sure why circle's not cloning but its not your fault. I'm asking our CI guru to investigate :-)

@mergify
Copy link
Contributor

mergify bot commented Jan 10, 2025

@redvinaa, 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).

@ruffsl
Copy link
Member

ruffsl commented Jan 10, 2025

Cloning git repository - [email protected]:ros-navigation/navigation2.git
Cloning into '.'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error running git clone "[email protected]:ros-navigation/navigation2.git": exit status 128

Hmm, it failed to even clone the repo. That is strange...

Looks like the CircleCI Deploy key got deleted from GitHub for this GitHub repo.
Did anyone purge this repo's Deploy keys

Seems to be cloning the repo just fine now after re-adding a new deploy key!

@SteveMacenski
Copy link
Member

@redvinaa you have a test failing:

/opt/overlay_ws/src/navigation2/nav2_mppi_controller/test/controller_state_transition_test.cpp:67
Expected: controller->computeVelocityCommands(pose, velocity, {}) doesn't throw an exception.
  Actual: it throws nav2_core::ControllerTFError with description "Unable to transform goal pose into costmap frame".

/opt/overlay_ws/src/navigation2/nav2_mppi_controller/test/controller_state_transition_test.cpp:67
Expected: controller->computeVelocityCommands(pose, velocity, {}) doesn't throw an exception.
  Actual: it throws nav2_core::ControllerTFError with description "Unable to transform goal pose into costmap frame".

@SteveMacenski SteveMacenski linked an issue Jan 14, 2025 that may be closed by this pull request
@redvinaa
Copy link
Contributor Author

I'm not sure what's the best way to go here, because the dummy path is generated with "odom" frame, while the costmap is in "map" frame. @SteveMacenski if you have a better solution than mine, do tell me.

The test now fails because of docking. :D Could you maybe rerun it? It passed on my machine on humble.

@SteveMacenski SteveMacenski merged commit d11de56 into ros-navigation:main Jan 14, 2025
9 of 10 checks passed
mergify bot pushed a commit that referenced this pull request Jan 14, 2025
* Add goal pose to CriticData

Signed-off-by: redvinaa <[email protected]>

* Pass goal pose directly to withinPositionGoalTolerance

Signed-off-by: redvinaa <[email protected]>

* Fix condition not

Signed-off-by: redvinaa <[email protected]>

* Add goal positions to tests

Signed-off-by: redvinaa <[email protected]>

* Use plan stamp

Signed-off-by: redvinaa <[email protected]>

* Use float instead of auto

Signed-off-by: redvinaa <[email protected]>

* Throw nav2_core exceptions

Signed-off-by: redvinaa <[email protected]>

* Set pose frame id in test

Signed-off-by: redvinaa <[email protected]>

* Fix frame id in test vol 2

Signed-off-by: redvinaa <[email protected]>

---------

Signed-off-by: redvinaa <[email protected]>
(cherry picked from commit d11de56)

# Conflicts:
#	nav2_mppi_controller/include/nav2_mppi_controller/tools/utils.hpp
@SteveMacenski
Copy link
Member

I'm not sure what's the best way to go here, because the dummy path is generated with "odom" frame, while the costmap is in "map" frame. @SteveMacenski if you have a better solution than mine, do tell me.

Fine by me - that test is a really basic exercising of the lifecycle and functions to make sure it can come up, do work, and shut down cleanly. Its not really doing any "work" in that test and each method have their own extensive test cases below.

The test now fails because of docking. :D Could you maybe rerun it? It passed on my machine on humble.

Something's going on with that test right now, not your fault. Merging! Thanks for the great contribution, as always 😄

SteveMacenski added a commit that referenced this pull request Jan 14, 2025
* Mppi goal to critic (#4822)

* Add goal pose to CriticData

Signed-off-by: redvinaa <[email protected]>

* Pass goal pose directly to withinPositionGoalTolerance

Signed-off-by: redvinaa <[email protected]>

* Fix condition not

Signed-off-by: redvinaa <[email protected]>

* Add goal positions to tests

Signed-off-by: redvinaa <[email protected]>

* Use plan stamp

Signed-off-by: redvinaa <[email protected]>

* Use float instead of auto

Signed-off-by: redvinaa <[email protected]>

* Throw nav2_core exceptions

Signed-off-by: redvinaa <[email protected]>

* Set pose frame id in test

Signed-off-by: redvinaa <[email protected]>

* Fix frame id in test vol 2

Signed-off-by: redvinaa <[email protected]>

---------

Signed-off-by: redvinaa <[email protected]>
(cherry picked from commit d11de56)

# Conflicts:
#	nav2_mppi_controller/include/nav2_mppi_controller/tools/utils.hpp

* Update utils.hpp

Signed-off-by: Steve Macenski <[email protected]>

---------

Signed-off-by: Steve Macenski <[email protected]>
Co-authored-by: Vince Reda <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
@redvinaa redvinaa mentioned this pull request Jan 15, 2025
7 tasks
@mergify mergify bot mentioned this pull request Jan 15, 2025
7 tasks
RBT22 pushed a commit to EnjoyRobotics/navigation2 that referenced this pull request Jan 22, 2025
* Add goal pose to CriticData

Signed-off-by: redvinaa <[email protected]>

* Pass goal pose directly to withinPositionGoalTolerance

Signed-off-by: redvinaa <[email protected]>

* Fix condition not

Signed-off-by: redvinaa <[email protected]>

* Add goal positions to tests

Signed-off-by: redvinaa <[email protected]>

* Use plan stamp

Signed-off-by: redvinaa <[email protected]>

* Use float instead of auto

Signed-off-by: redvinaa <[email protected]>

* Throw nav2_core exceptions

Signed-off-by: redvinaa <[email protected]>

* Set pose frame id in test

Signed-off-by: redvinaa <[email protected]>

* Fix frame id in test vol 2

Signed-off-by: redvinaa <[email protected]>

---------

Signed-off-by: redvinaa <[email protected]>
Signed-off-by: RBT22 <[email protected]>
@BriceRenaudeau
Copy link
Contributor

This MR seems to break the enforce_path_inversion behavior.
The robot doesn't care for local goals anymore and is more attracted by the final goal.

Mppi_goal_to_critic_inversion_fail.webm

@SteveMacenski
Copy link
Member

@BriceRenaudeau how so, specifically? I'm looking over the PR and I think you're referring to the change in the GoalCritic, but that shouldn't have been triggering before approaching the final goal anyway. Doesn't the PathFollow critic handle this situation OK?

Is this happening when the inversion is with in the threshold to consider for the other critics to pass off for on-goal-approach behavior?

The only 2 changes I see in this PR are:

  • For all critics, use the global goal to evaluate bypass conditions like withinPositionGoalTolerance
  • The GoalCritic uses the global goal to score (and also its bypass condition) rather than the end of the pruned path

Which of those (or both) are an issue?

@alex-roba
Copy link

alex-roba commented Mar 17, 2025

@SteveMacenski

Which of those (or both) are an issue?

I am facing the same issue.
I believe the problem occurs because GoalCritic scores based on the global goal (and its bypass condition) rather than the end of the pruned path. In some cases, inversion can be close to the goal where GoalCritic is active, causing the controller to ignore the inversion and focus only on the final goal pose.

Additionally, with the default parameters, when the robot is outside the GoalCritic threshold, the parameters may not be sufficient to guide the robot toward inversion. However, when GoalCritic considers the pruned path, it helps the robot converge within the inversion tolerances.

@BriceRenaudeau
Copy link
Contributor

In our case, the GoalCritic is always active to perform TEB like behavior hence cutting the inversion point.

@BriceRenaudeau
Copy link
Contributor

BriceRenaudeau commented Mar 20, 2025

Here is another example of the problem. We want the robot in the opposite direction in a narrow aisle, it should go out of the aisle to make the half turn and then come into the aisle again.

MPPI_inversion_point_ok.webm

But with this MR, the robot totally bypasses the path and just moves to the endpoint in the wrong direction.

MPPI_inversion_point_failed.webm

@SteveMacenski
Copy link
Member

@BriceRenaudeau this keeps falling off of my radar by accident. Can you file a ticket for this with your context and we can take it from there? There are some Nav2 contributors around that are looking for projects and if we provide a detailed explanation of the issue and possible solutions, I'm sure we can find a contributor that would be willing to work on this to fix the issue.

I think possibly we should use the 'real' goal unless there's a path inversion and we are caring about the path inversions. If so, use the intermediary goal. We can add in the parameter similar to that we have for the path follower if we should consider inversions / path pose orientations.

Does that seem reasonable?

My apologies for the delay

stevedanomodolor pushed a commit to stevedanomodolor/navigation2 that referenced this pull request Apr 29, 2025
* Add goal pose to CriticData

Signed-off-by: redvinaa <[email protected]>

* Pass goal pose directly to withinPositionGoalTolerance

Signed-off-by: redvinaa <[email protected]>

* Fix condition not

Signed-off-by: redvinaa <[email protected]>

* Add goal positions to tests

Signed-off-by: redvinaa <[email protected]>

* Use plan stamp

Signed-off-by: redvinaa <[email protected]>

* Use float instead of auto

Signed-off-by: redvinaa <[email protected]>

* Throw nav2_core exceptions

Signed-off-by: redvinaa <[email protected]>

* Set pose frame id in test

Signed-off-by: redvinaa <[email protected]>

* Fix frame id in test vol 2

Signed-off-by: redvinaa <[email protected]>

---------

Signed-off-by: redvinaa <[email protected]>
Signed-off-by: stevedanomodolor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MPPI GoalCritic bug

5 participants