-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
45-50% performance improvement in MPPI controller using Eigen library for computation. #4621
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
… files Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
This pull request is in conflict. Could you fix it @Ayush1285? |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a pretty fast review, so far from complete on each detail, but a good starting point!
nav2_mppi_controller/include/nav2_mppi_controller/tools/noise_generator.hpp
Outdated
Show resolved
Hide resolved
nav2_mppi_controller/include/nav2_mppi_controller/tools/noise_generator.hpp
Outdated
Show resolved
Hide resolved
nav2_mppi_controller/include/nav2_mppi_controller/tools/utils.hpp
Outdated
Show resolved
Hide resolved
…ator Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Let me know here when you want me to take a look again! I'm quite excited for this work - even if for no reason than to move to Eigen + 10% performance boost, since Eigen's release and support is much more known than xtensor's |
Sure, I'm trying a few optimizations and will push changes once I'm done. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
I've completed the migration to Eigen. But we need to make sure that functionality-wise everything is correct or not. I'll run tests and ensure that all of them are passing. Meanwhile, you can take a look at the latest changes. |
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a first look through (didn't analyze in detail the math in the critics, but higher level programming items first), but generally looks good to me with some details to answer!
nav2_mppi_controller/include/nav2_mppi_controller/controller.hpp
Outdated
Show resolved
Hide resolved
nav2_mppi_controller/include/nav2_mppi_controller/optimizer.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
This pull request is in conflict. Could you fix it @Ayush1285? |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Great, thanks!!.
Done. |
I have 1 report from an ARM user that the path align critic is having issues, but no other critics / issues in the general solution. I took a look at path align and don't see anything weird, but it might be worth giving that another look if you had 15-20 minutes to re-scrutinize it or any unique APIs we use there that may be having ARM issues. I don't see anything but the strides. To be noted, for the default bringup, the PathAlign critic and Cost critic are the only that use strides. The only thing I noted was that The other use in the cost critic makes sure this isn't possible with
|
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
You're correct. Problem was in the calculation of |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Ah, glad we caught that! I just sent that update to the ARM user that was testing this -- lets see what they say (we're all getting back on the horse from the Holidays, so I imagine it'll be next week at this point) |
@Ayush1285 FYI I took a crack at building the
This was in a Docker container created from image |
I think it is due to because you're trying to build rolling branch of nav2 on Jazzy machine. More precisely, there are lot of C style headers, which were deprecated after launch of Jazzy. For example error that you are facing is due this PR: ros2/message_filters#135 |
From the ARM testing folks at Kiwibot:
It looks like that fix did the job. I'm helping them with some more tests and metrics gathering but its looking good :-) |
Thanks for this PR! We (Kiwibot) tested it on one of our robots running ROS 2 Iron on Ubuntu 22.04 (Jetson AGX, ARM64). The compilation issues we previously encountered with xtensor are now resolved. Using the default bringup parameters, we observed the following performance metrics: 17.1 ms average controller execution time |
I've heard enough good news at this point (only 2 weeks late from EOY)! @Ayush1285 please rebase / pull in main. If CI looks good, I'll merge! Thanks so much for your tireless work and effort here, this is a big improvement in performance and long term maintainability. Even better, this enables this to work well and effectively on Jetson board which were not previously possible due to their relatively weak CPUs. The metrics that @jdgalviss reports from Kiwibot are a major improvement and make it possible to use MPPI even on those boards for production without using insane amount of resources or only able to run at sub-20hz. I can't be happier with how this came out and I look forward to any other contributions you'd be interested in helping out with in Nav2! 😄 |
I've merged it with the latest main. There are two unrelated test failures. One in collision monitor test:
Sure, I'm open to more contributions. |
This pull request is in conflict. Could you fix it @Ayush1285? |
Ugh, I'm sorry to do this to you, but it looks like there are merge conflicts from #4812 which changed the use of Otherwise, I tested and this is good to go 😄
This was a pretty big undertaking - what's your feeling about working on MPPI some more or switching gears into another part of the codebase / new algorithms? On the MPPI front, there are a few open tickets that would be really nice to hvae someone look at:
On other fronts:
|
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
I've fixed the merge conflicts. Let's wait for the CI to run. The optimizer_benchmark was missing a change; it was not updated with the latest evalControl() API changes.
I would like to contribute on other fronts. Playing with new control algorithms and improvising the costmap layer seems exciting ideas to me. Currently, I'm a little short on bandwidth but we can discuss/explore potential ideas for now. |
@Ayush1285, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Ayush1285 <ayush.singhftw@gmail.com>
Understood - want to chat a bit on the Nav2 Slack? By no means feel limited to those thoughts, the world's our oyster 😆 |
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Future work that may be required in bullet points
For Maintainers: