Skip to content

Parallelize motion primitive generation and add trajectory_distinctness_ratio#5866

Merged
SteveMacenski merged 14 commits intoros-navigation:mainfrom
mini-1235:feat/lattice_generator-1
Jan 26, 2026
Merged

Parallelize motion primitive generation and add trajectory_distinctness_ratio#5866
SteveMacenski merged 14 commits intoros-navigation:mainfrom
mini-1235:feat/lattice_generator-1

Conversation

@mini-1235
Copy link
Collaborator

@mini-1235 mini-1235 commented Jan 15, 2026


Basic Info

Info Please fill out this column
Ticket(s) this addresses closes #4991
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-*.

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
@mini-1235 mini-1235 closed this Jan 15, 2026
@mini-1235 mini-1235 reopened this Jan 15, 2026
@mini-1235 mini-1235 force-pushed the feat/lattice_generator-1 branch from bf868af to cf1cb4c Compare January 15, 2026 13:28
@mini-1235
Copy link
Collaborator Author

I have to fix #5837 first, I am having mypy issue on this PR :(

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.

Feel free to merge once you're happy with mypy

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
# Loop through the local trajectories with the same target heading
for prev_pos, prev_len in trajectories_by_heading[target_heading]:
dist = np.linalg.norm(target_point - prev_pos)
if dist < self.trajectory_distinctness_ratio * min(current_length, prev_len):
Copy link
Member

Choose a reason for hiding this comment

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

Should this check happen in _is_minimal_trajectory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, like adding a new argument to _is_minimal_trajectory?

Copy link
Member

Choose a reason for hiding this comment

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

yeah

Copy link
Member

Choose a reason for hiding this comment

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

yeah

@mini-1235 mini-1235 marked this pull request as draft January 22, 2026 18:44
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
@mini-1235 mini-1235 marked this pull request as ready for review January 23, 2026 11:49
@mini-1235 mini-1235 changed the title Parallelize motion primitive generation Parallelize motion primitive generation and add trajectory_distinctness_ratio Jan 23, 2026
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 no notes!

Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
@SteveMacenski SteveMacenski merged commit 0d17014 into ros-navigation:main Jan 26, 2026
17 checks passed
Prathmesh2931 pushed a commit to Prathmesh2931/navigation2 that referenced this pull request Jan 27, 2026
…ss_ratio (ros-navigation#5866)

* Parallelize motion primitive generation

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Precommit

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Lint

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Add trajectory distinctness ratio

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Move check to is_minimal_trajectory

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Drop previous length

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Fix test

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Update readme

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* retrigger ci due to timeout

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Update nav2_smac_planner/lattice_primitives/README.md

Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>

* Update readme

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Add old_5cm_resolution

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Remove output.json

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

---------

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Pana1v pushed a commit to Arnav-panjla/navigation2 that referenced this pull request Feb 21, 2026
…ss_ratio (ros-navigation#5866)

* Parallelize motion primitive generation

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Precommit

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Lint

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Add trajectory distinctness ratio

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Move check to is_minimal_trajectory

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Drop previous length

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Fix test

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Update readme

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* retrigger ci due to timeout

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Update nav2_smac_planner/lattice_primitives/README.md

Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>

* Update readme

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Add old_5cm_resolution

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Remove output.json

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

---------

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
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.

Lattice generator hangs on big turning radius

2 participants