Skip to content

Conversation

@silanus23
Copy link
Contributor

@silanus23 silanus23 commented Oct 13, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5037
Primary OS tested on Ubuntu
Robotic platform tested on nav2_bringup
Does this PR contain AI generated software? util tests
Was this PR description generated by AI software? nope definitely not

Description of contribution in a few bullet points

Description of documentation updates required from your changes

Critic additons and their parameter additions

Description of how this change was tested

Added util tests. I have succeded to create cases where turtlebot has to create a new path cause it's so out of bounds(done this on dwb).


Future work that may be required in bullet points

These can be added to default yaml

###Note:
I had to create a new branch cause the original branch was sub branch of my first PR. I had to carry it via copy paste couldn't find a better way.

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.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
  • Should this be backported to current distributions? If so, tag with backport-*.

Signed-off-by: silanus23 <[email protected]>
Signed-off-by: silanus23 <[email protected]>
@SteveMacenski
Copy link
Member

SteveMacenski commented Oct 13, 2025

Have you tested these critics in some way - in particular for MPPI? The TB4 world with some strategically placed obstacles in the way might be a good test case. The MPPI critic looks pretty complex. I would have intuitively started with something that simply:

  • Evaluates the distance from the path segments (using the utility function already merged) to a given trajectory sample. If outside, then penalize highly.
  • As an add on feature, add the option to also have a penalty that scales with the distance away from the path (with some margin before application so we don't overscore based on small adjustments).

I suspect (?) that it may be possible to instead strategically place this logic into the Path Align Critic and/or share some of its computations to make that critic more simple and concise. Is it possible to surgically place this into the Path Align logic and/or some of the computation is shared? Either we can share some functions and/or data, or put the Path Hug scoring inside of that critic as additional weight penalties (if we already have path-trajectory distances computed for its own scoring)

@silanus23
Copy link
Contributor Author

silanus23 commented Oct 13, 2025

@SteveMacenski I didn't try to get full results. I tried to solve the problem of the Planner can not keep up with the HZ (this part needed optimizations making this PR a lot complex). PathAlign integration is actually sounds a lot better than my solution.In addition PathFollow can be considered too. But I have to look it to be sure. There are plenty of path mppi critic that uses sampling strides etc. I don't know if it's too daring but maybe unification of path critics and keeping both versions.
BTW realized some of my additions to dwb after testing (ones I shared as visuals in previous PR) causing some problems took them back and will try to get visual results in this version too.
Regardless of the solution my initial proposal is deleting everything about MPPI. Making this PR only about DWB and handle MPPI in another sperate PR. What do you think about this approach?

@SteveMacenski
Copy link
Member

I think that makes sense - though I think MPPI is much higher priority than DWB as the default controller. DWB is more for legacy users.

@silanus23 silanus23 force-pushed the tracking-critics-dwb-and-mppi branch from 8f77cec to dd0faed Compare October 28, 2025 07:11
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.

Otherwise, I can't comment too too much on the formulation without you/I doing some some simulation testing to see how well functionally it works.

throw std::runtime_error{"Failed to lock node"};
}

nav2::declare_parameter_if_not_declared(
Copy link
Member

Choose a reason for hiding this comment

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

Should we also set a max allowable left/right deviation to score as invalid if any path of the path exceeds?

namespace dwb_critics
{

void PathHugCritic::onInit()
Copy link
Member

Choose a reason for hiding this comment

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

I actually rather like this name, but for the description docs / doxygen, can we mention cross tracking error (if not rename the critic to be more 'technical') so that this is clear the itention?

start_index_,
search_window_);
distance += search_result.distance;
start_index_ = search_result.closest_segment_index;
Copy link
Member

Choose a reason for hiding this comment

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

The trajectories can technically go backwards so I don't think we should reset the start index, no?

double scoreTrajectory(const dwb_msgs::msg::Trajectory2D & traj) override;

protected:
bool zero_scale_{false};
Copy link
Member

Choose a reason for hiding this comment

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

This isn't exposed as a parameter?

bool zero_scale_{false};
nav_msgs::msg::Path global_path_;
size_t start_index_{0};
geometry_msgs::msg::Pose current_pose_{};
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this needs to be a class member variable

protected:
bool zero_scale_{false};
nav_msgs::msg::Path global_path_;
size_t start_index_{0};
Copy link
Member

Choose a reason for hiding this comment

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

Nor this

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.

2 participants