Skip to content

Conversation

@robotechvision
Copy link
Contributor

@robotechvision robotechvision commented Dec 22, 2021


Basic Info

Info Please fill out this column
Ticket(s) this addresses #2498
Primary OS tested on Ubuntu
Robotic platform tested on (hardware RTV Caster, gazebo simulation of RTV Caster)

Description of contribution in a few bullet points

  • Original Ceres smoother from Smac planner put into operational state by simplifying to AutoDiff and fixing errors
  • Added support for forward/reverse motion (e.g. Reeds-Shepp model)
  • Added cubic interpolator for costmap cost
  • Curvature cost simplified and generalized to be valid for segments with non-equal lengths
  • Added option to add extra costmap cost near cusps (forward/reverse direction changes) which are difficult to be smoothed properly using basic cost parameters
  • Added option to read costmap cost from different points of robot, which can be useful for arbitrary robot shapes (e.g. diff-drive with caster wheels has footprint offset backwards against rotation center)
  • Added option to downsample path prior to smoothing (for speedup) and upsample back to original (or even higher) density using cubic bezier
  • Detailed tests written to check for smoother attributes to be maintained when optimizing/modifying smoother in the future
  • Added TruncatePathLocal BT action to pick a section from the global plan so that smoothing can be performed with a good quality in a reasonable time (can be used also for other purposes)

Note: We will check for reviews soonest on 2022-01-10 so no need to hurry with them. Merry Christmas

Description of documentation updates required from your changes

  • Added new smoother plugin (CeresCostawareSmoother), it should be added to docs
  • Added new BT plugin (TruncatePathLocal), it should be added to docs

Future work that may be required in bullet points

  • Try to find an optimizer configuration which converges faster
  • Try to write down proper derivatives which can speed up optimization significantly, maintaining (or improving) smoothing quality (see tests)

For Maintainers:

  • Check that any new parameters added are updated in navigation.ros.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
afrixs and others added 30 commits September 2, 2021 11:03
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.

Overall, LGTM, I skimmed over [nav2_ceres_costaware_smoother/smoother.hpp](https://github.com/ros-planning/navigation2/pull/2753/files#diff-d237e6158151d23832965fb29cd112aa21aa3f09a966907ab7b1aca076a56a46) since alot of that logic is related to the cusp handling I requested some clarification regarding. Not worth trying to pull that apart without more context. It may be worth adding some more inline comments regarding this since its a bit different.

But otherwise, I went through the rest of the files and except where noted, this is really nice looking and not much I would ask for change -- mostly superficial.

Can you also mention in the readme a few examples of paths being smoothed with the costmap being shown & runtime / length metrics alongside that? Pictures / metrics tell a thousand words

@SteveMacenski
Copy link
Member

I merged your docs PR, I'll fix the remaining items from the last review and add in the "simple" smoother plugin from #2875, which is just a port from the simple Smac smoother into this plugin form.

@SteveMacenski
Copy link
Member

OK - we can do the BT node at the same time, reviewed that and went deeper into the code after you explained the cusp stuff to me

@SteveMacenski
Copy link
Member

SteveMacenski commented Apr 4, 2022

Glancing over the open review comments, there aren't many really significant change requests - mostly just documentation / clarification in comments and a few little changes based on utilities we have in nav2_utils that would make it easier to understand / use the same methods for similar actions. Great work on improving this! I really wanted to get this with analytical derivatives, but I suppose as you found as well it was difficult to get that to work well.

I re-read the code again this afternoon and have no new comments to make. I think once these are done this is good to go (with docs, of course)

@SteveMacenski
Copy link
Member

The remaining comments are w.r.t. documentation for the website / readme and the Truncate BT node. The smoother is A-OK with me now.

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 has gotten pretty convoluted in the truncation node. I think it would be better if we handled the BT node in another PR so that we can ship the actual smoother work which is completed except for the documentation elements on navigation.ros.org. There are probably going to be a few more iterations required given the current state of this BT node but the smoother is approved.

If only all users wanted to do roughly-exact path tracking instead of dynamic behaviors... it would make all of our lives so much easier... 😆

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.

LGTM, I think at this point its just on documentation / adding in the diagrams / descriptions we've previously discussed in the still-open discussion points (you may need to expand the shortened view git has due to the number of comments on the PR). The check list on the top of the PR for maintainers goes through the documentation elements that be updated + the diagrams we previously discussed.

I did another run through of the smoother code and I have no new comments / requests. This all looks ready to go to me!

If you rebase to main / pull it in, CI should turn over with fewer errors.

@SteveMacenski
Copy link
Member

Any update? I think its just about an hour of writing up the documentation around this for the website! Docs help other users and gives you a better platform for users to use this work if they can understand how it works / what dials they have to play with (more users = more people to find issues = more fixes without our explicit effort)

@afrixs
Copy link
Contributor

afrixs commented May 2, 2022

Agreed, I'll get to it today or tomorrow

@SteveMacenski SteveMacenski merged commit af3ff35 into ros-navigation:main May 10, 2022
@SteveMacenski
Copy link
Member

SteveMacenski commented May 10, 2022

Thanks for your dedication and help in getting this in! It's much appreciated and one of the new crown jewels in Nav2! I'll make an announcement on Discourse today on its inclusion

@afrixs
Copy link
Contributor

afrixs commented May 10, 2022

Thank you very much for your notes and experiences, I think we've together found a solution I'm satisfied with much more than with our original version.

redvinaa pushed a commit to EnjoyRobotics/navigation2 that referenced this pull request Jun 30, 2022
* old version of smoother server with path truncation and without collision checker and footprint subscriber

* Removed path truncation from smoother server, added footprint subscriber
and path collision checking

* smoother code styling fixes

* Update nav2_tree_nodes.xml

* added TruncatePathLocal BT action

* truncate_path_local_action bt plugin code styling

* WIP: PR ros-navigation#2569 fixes

* smoother server changes as requested in PR ros-navigation#2569, tests added

* cpplint fixes

* added TruncatePathLocal into bt configs

* added nav2_smoother to composed bringup

* smoother server: improved test coverage, details fixed

* removed smoother from composed bringup lifecycle nodes as it fails on
non-existing plugins

* removed smoother server default plugin since it's not merged yet, readded into bringup

* nav2_smoother tests: added mocked class loader to improve
nav2_smoother.cpp test coverage

* nav2_smoother 100% test coverage

* test_smoother_server cpplint fix

* test_smoother_server added cleanup transition

* nav2_smoother added default plugin type autoconfig test

* added nav2_ceres_costaware_smoother

* changed rtv_ to nav2_

* Update nav2_smoother/README.md

* nav2_ceres_costaware_smoother cleanup

* removed smoother_server_rclcpp_node from nav2_params.yaml, added
smoother_server to other config YAML files

* registered nav2_smoother component

* registered nav2_smoother component

* fixed header uniquity macros

* fixed nav2_smoother_core to be shared

* fixed nav2_smoother build

* minor cleanup, test interface added

* added smoothness, distance and curvature tests

* added more tests

* ceres smoother cleanup, minor optimizations

* ceres smoother: fixed interpolator cleanup bug, added tests, more code cleanup

* ceres smoother fixes and tests

* truncate_path_local bt node: changed API to be more similar to other
nav2 bt nodes, tests written
nav2_ceres_costaware_smoother: changed ASSERT to EXPECT in tests

* ceres smoother uncrustified, fixed linting errors

* updated readme

* ceres smoother: updated readme

* fixed signed-unsigned comparison error

* removing obsolete max_time parameter since max_time is specified in
smooth action goal

* ceres smoother: updated readme

* Update options.hpp

* by-passing path orientations approximation when skipping smac smoother

* moved smac smoother by-pass directly to smooth method

* fixed smac smoother tests

* removed debug logger

* Removed merge bug from nav2_smoother/package.xml

* ceres smoother: added keep start/goal orientation parameters

* ceres smoother: added tests for start/goal orientations

* ceres smoother: resolved requested details (name will be changed in
following commit to prevent git clutter)

* unified point variable names, added tests for edge-cases

* ceres smoother: added comments, made parameters more intuitive, improved
tests

* ceres smoother: adding coments and cost check point weights
normalization

* ceres smoother: renamed to constrained smoother

* TruncatePathLocal BT node: cleaned up, added max_robot_pose_search_dist

* TruncatePathLocal: improved readability, added comments

* constrained smoother: added readme note about not supporting cusp
detection without pose orientations assigned

* constrained smoother: updated readme

* Constrained smoother: fixed readme and comments

* Constrained smoother ReadMe: added recommended usage note

Co-authored-by: afrixs <matej.vargovcik@gmail.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Matej Vargovcik <vargovcik@robotechvision.com>
savalena pushed a commit to savalena/navigation2 that referenced this pull request Jul 5, 2024
* old version of smoother server with path truncation and without collision checker and footprint subscriber

* Removed path truncation from smoother server, added footprint subscriber
and path collision checking

* smoother code styling fixes

* Update nav2_tree_nodes.xml

* added TruncatePathLocal BT action

* truncate_path_local_action bt plugin code styling

* WIP: PR ros-navigation#2569 fixes

* smoother server changes as requested in PR ros-navigation#2569, tests added

* cpplint fixes

* added TruncatePathLocal into bt configs

* added nav2_smoother to composed bringup

* smoother server: improved test coverage, details fixed

* removed smoother from composed bringup lifecycle nodes as it fails on
non-existing plugins

* removed smoother server default plugin since it's not merged yet, readded into bringup

* nav2_smoother tests: added mocked class loader to improve
nav2_smoother.cpp test coverage

* nav2_smoother 100% test coverage

* test_smoother_server cpplint fix

* test_smoother_server added cleanup transition

* nav2_smoother added default plugin type autoconfig test

* added nav2_ceres_costaware_smoother

* changed rtv_ to nav2_

* Update nav2_smoother/README.md

* nav2_ceres_costaware_smoother cleanup

* removed smoother_server_rclcpp_node from nav2_params.yaml, added
smoother_server to other config YAML files

* registered nav2_smoother component

* registered nav2_smoother component

* fixed header uniquity macros

* fixed nav2_smoother_core to be shared

* fixed nav2_smoother build

* minor cleanup, test interface added

* added smoothness, distance and curvature tests

* added more tests

* ceres smoother cleanup, minor optimizations

* ceres smoother: fixed interpolator cleanup bug, added tests, more code cleanup

* ceres smoother fixes and tests

* truncate_path_local bt node: changed API to be more similar to other
nav2 bt nodes, tests written
nav2_ceres_costaware_smoother: changed ASSERT to EXPECT in tests

* ceres smoother uncrustified, fixed linting errors

* updated readme

* ceres smoother: updated readme

* fixed signed-unsigned comparison error

* removing obsolete max_time parameter since max_time is specified in
smooth action goal

* ceres smoother: updated readme

* Update options.hpp

* by-passing path orientations approximation when skipping smac smoother

* moved smac smoother by-pass directly to smooth method

* fixed smac smoother tests

* removed debug logger

* Removed merge bug from nav2_smoother/package.xml

* ceres smoother: added keep start/goal orientation parameters

* ceres smoother: added tests for start/goal orientations

* ceres smoother: resolved requested details (name will be changed in
following commit to prevent git clutter)

* unified point variable names, added tests for edge-cases

* ceres smoother: added comments, made parameters more intuitive, improved
tests

* ceres smoother: adding coments and cost check point weights
normalization

* ceres smoother: renamed to constrained smoother

* TruncatePathLocal BT node: cleaned up, added max_robot_pose_search_dist

* TruncatePathLocal: improved readability, added comments

* constrained smoother: added readme note about not supporting cusp
detection without pose orientations assigned

* constrained smoother: updated readme

* Constrained smoother: fixed readme and comments

* Constrained smoother ReadMe: added recommended usage note

Co-authored-by: afrixs <matej.vargovcik@gmail.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Matej Vargovcik <vargovcik@robotechvision.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants