豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

[DRAFT] New geomteric planner package for viapoint based spline generators#6083

Draft
sbadamikar-research wants to merge 6 commits intoros-navigation:mainfrom
sbadamikar-research:feature/geometric_planner
Draft

[DRAFT] New geomteric planner package for viapoint based spline generators#6083
sbadamikar-research wants to merge 6 commits intoros-navigation:mainfrom
sbadamikar-research:feature/geometric_planner

Conversation

@sbadamikar-research
Copy link
Copy Markdown
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses (add tickets here #1)
Primary OS tested on (Ubuntu, MacOS, Windows)
Robotic platform tested on (Steve's Robot, gazebo simulation of Tally, hardware turtlebot)
Does this PR contain AI generated software? (No; Yes and it is marked inline in the code)
Was this PR description generated by AI software? Out of respect for maintainers, AI for human-to-human communications are banned

Description of contribution in a few bullet points

Description of documentation updates required from your changes

Description of how this change was tested


Future work that may be required in bullet points

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-*.

@sbadamikar-research sbadamikar-research changed the title [DRAFT] Feature/geometric planner [DRAFT] New geomteric planner package for viapoint based spline generators Apr 13, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there are some test suites for exercising the planners, can you add your new planners to these?

@@ -0,0 +1,56 @@
// Copyright (c) 2025 Nav2 Contributors
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Update the copyright please

@SteveMacenski
Copy link
Copy Markdown
Member

OK - before I give this a look over, can you update the description to point to the ticket & add some consequential documentation about what this does, what algorithms you chose to implement, trade offs, and use-case intentions?

This is all kind of out of context for not just myself but future readers. This is alot of code to parse without context of understanding which you chose, why, why not others, performance, and use cases.

--- stderr: nav2_geometric_planners           
In file included from /opt/overlay_ws/src/navigation2/nav2_geometric_planner/CubicSplinePlanner/src/cubic_spline_planner.cpp:17:
/opt/overlay_ws/src/navigation2/nav2_geometric_planner/utils/geometric_planner_utils.hpp:22:10: fatal error: tf2/LinearMath/Quaternion.h: No such file or directory
   22 | #include "tf2/LinearMath/Quaternion.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This just needs to be hpp for main. Also check out the linting job, though that's the least of our concerns right now :-)

@sbadamikar-research
Copy link
Copy Markdown
Contributor Author

@SteveMacenski Absolutely. This is just V(-1) to keep you in the loop if you'd like to have a look. There is a lot of work to be done on my end. I'll update you once I have something objectively reviewable.

@SteveMacenski
Copy link
Copy Markdown
Member

SteveMacenski commented Apr 15, 2026

Thanks -- but in general I'm liking the starting point! My only high-level armchair suggestion is to see if there's alot of redundancy between these planner implementations. Maybe some utilities can be abstracted and/or making this into 1 planner that has run-time selection of which geometric algorithm to use. It looks from my last glance this morning you started on that path. If you create abstractions for createPlan for the geometric technique's common inputs, you can have non-ROS spline/clothoid/etc basic planner APIs that this plugin calls for the selected geometric curve generator model.

i.e. the only custom part of the bezier plugin is:

  const auto control_pts = buildControlPoints(start, viapoints, goal);
  const double resolution = costmap_->getResolution();

  nav_msgs::msg::Path path = sampleBezier(control_pts, resolution, start.header);

if you make a

class BaseGeometricPlanner
{
...

  virtual createPath(...) = 0;  // does the control points build / sample for the bezier derived implementation. One of the imputs is resolution.
}

Then the plugin can hold a std::unique_ptr<BaseGeometricPlanner> which calls that API in the high level ROS plugin's createPlan and does the general stuff like validation / collision checking. Then the selection of which base planner is simply a parameterization and we keep the geometric planners abstracted fully from ROS. New geometryic algorithms can be added very easily with little code more than the basic implementation of the algorithm + updating the parameter parser to load create it in the factory.


I'd also suggest adding in a straight-line and Dubins/Reed-Shepp/SE2 model for shits and giggles. OMPL gives you Dubins/Reed-Shepp/SE2 for free and we already have a dependency on it for Smac Planner (also with examples of how to work with those 3) so its an easy-add. Point Claude at the Analytic Expansion of Smac Planner and I'm sure it'll just do it for you.

sbadamikar-research and others added 6 commits April 20, 2026 12:38
…rt of API

The ComputePlanToPose action now incorporates a list of stamped poses as intermediate viapoints that are forwarded to the planner plugin.

Signed-off-by: Sanchit B <researchbadamikar@gmail.com>
Signed-off-by: Sanchit B <researchbadamikar@gmail.com>
Pass non-empty viapoints vectors in planner unit tests to exercise
the RCLCPP_WARN branch in createPlan() for planners that ignore
viapoints (smac_2d, smac_hybrid, smac_lattice, theta_star, navfn).

Signed-off-by: Sanchit B <researchbadamikar@gmail.com>
… InvalidViapoints end-to-end

Add two new planner exception types, corresponding error codes in both
ComputePathToPose and ComputePathThroughPoses actions, and catch blocks
in PlannerServer for both action handlers.
extractYaw, makePose, poseDistance, validateStartGoal, isStateValid,
and checkPathCollisions; used by all three planners.
Internal G1 clothoid solver using Gauss-Legendre Fresnel integrals and
Newton-Raphson iteration; replaces external Clothoids library dependency.
Supports 0+ viapoints; throws NoValidPathCouldBeFound on collision.

Natural cubic spline parameterised by ROS timestamps; requires >= 1
viapoint (InsufficientViapoints) and valid non-zero monotonic stamps
(InvalidViapoints); path sampled at costmap resolution.

de Casteljau evaluation of arbitrary-degree Bezier curves; viapoints
serve as control points; requires >= 1 viapoint (InsufficientViapoints);
path sampled at costmap resolution.
@sbadamikar-research sbadamikar-research force-pushed the feature/geometric_planner branch from fb453d0 to 7f47928 Compare April 20, 2026 19:36
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