OMPL and Qt API update, bump cmake minimum version requirement#6136
Conversation
Signed-off-by: Maurice Alexander Purnawan <mauricepurnawan@gmail.com>
Signed-off-by: Maurice Alexander Purnawan <mauricepurnawan@gmail.com>
Temporarily comment this out Signed-off-by: Maurice Alexander Purnawan <mauricepurnawan@gmail.com>
Signed-off-by: Maurice Alexander Purnawan <mauricepurnawan@gmail.com>
Pin ros2/rviz to version 2cbba6bbeb32 to avoid Qt5 and Qt6 mismatch. Signed-off-by: Maurice Alexander Purnawan <mauricepurnawan@gmail.com>
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
|
I figured out that the EventsExecutor wasn't included in the last rolling sync, but we do have it in Lyrical, so it seems easier for me to test it in Lyrical :) This PR fixes all the compile errors but is not ready to review/merge, I am opening as draft to check the backward compatibility for Jazzy/Kilted. It also depends on ros2/message_filters#292, ros/rosdistro#51321, BehaviorTree/BehaviorTree.CPP#1139, and an upstream OMPL sync, we should probably merge this after we migrate to Ubuntu 26.04 (most fixes here are related to 26.04 using g++15) |
|
This pull request is in conflict. Could you fix it @mini-1235? |
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
|
Executor Performance Report.docx I finally found some time to generate those flamegraphs today. To speed things up, I had AI put together a quick summary report. I did a scan through it, and for the most part, the findings look pretty reasonable to me. The report also digs into the lifecycle_manager. We definitely see some performance gains there, but if you look closely at the flamegraph, it is still eating up a massive chunk of the CPU (compared to other components like the controller_server or planner_server). Also, like we discussed on slack earlier, if you download the EventsCBGExecutor flamegraph and search for "singlethreaded", you will still see it popping up all over the place. I suspect we are going to see another massive performance once absolutely everything is switched over to the event executor, but waiting for the ros2 core repos to merge those updates first |
|
My apologies for the delay. Saying I've simply been overwhelmed would be a misuse of the word. Can you summarize for me the actions or what you think should happen from the flamegraph? I'm reading from your phrasing you think some things still need to change so I'm not clear if this is ready or not (seems like there's some places the wrong executor is being used still?). Wrt the report: I see that it reduces CPU cycles, but what's the actual % improvement in terms of stable-runtime performance? As your report mentions, CPU cycles doesn't mean the % changes and the % is important to understand.
I disagree with this, we need fast detection failure for all deployments. Rather than simply reducing the rate, I think we should fix it (which AI may well help with) in code changes or in how its run (i.e. executor, in another process, etc).
Have you shown this is actually true? I would be open to moving that to another process if that's the case. I question though if AI is properly diagnosing this though. If this solves it, that seems easy enough. |
|
No worries, I marked this as draft because of the blocking issues I mentioned in the lyrical release ticket. I am also very busy at the moment, feel free to review now or wait until everything is ready :)
I thought your preference was to use SingleThreadedExecutor in the code until the ros2 team tests and agrees to switch everything to EventsExecutor by default. I also have a branch here mini-1235@d779849. Did you change your mind? For context we discussed this on Slack:
Could you take a quick look at the lifecycle manager flamegraph/report and let me know if you are satisfied with the improvement (and the potential improvement once everything switches to EventsExecutor)? If you are not satisfied with the current results, then my proposal in #6061 is probably in the wrong direction, and we will need to think of some alternative approaches
When you ask about % improvement, do you mean total CPU usage? I have been measuring with btop before and after, and it's around 1% as I mentioned on Slack(my CPU is much faster than typical onboard computers, so I would still consider the improvement meaningful)
I would ignore the AI-generated solutions in there, I didn't have time to polish the report. I generated the data by hand and had AI summarize it just to give you a rough before vs after picture. |
|
It is not building for me... Base docker image - "osrf/ros:lyrical-desktop-full" - June 1st 2026 FROM osrf/ros@sha256:e2850b225534d1c9b9f511a1d19ce45bbd632a4711a7f74ef4c466c808fdb909 AS base Relevant dockerfile snippet WORKDIR /opt/nav2_ws Error: |
|
Check the blockers I listed earlier, you might need to build some packages from source before a lyrical sync happens |
|
OK... just needed one more line - building BT from source and it all built on the lyrical image. |
I don't think we need to wait for the ROS team to make it default, but I would want to see testing that this works reliably and has a measurable performance improvement. Once we change it though, we can/should change it everywhere else too including the BT nodes and others you've mentioned in that branch. I think its an all-at-once thing so we can have consistent behavior across the board.
Yes, this is what I mean. And OK - its just not listed here anywhere and I've forgotten the context in Slack after this long :-)
This is what I'm not understanding. There's some potential plans, ideas, and options, but I'm not seeing a recommendation or what works and the analysis to show the impact. As you pointed out in the report, just having a large reduction in CPU cycles is not eq. to having a change in resource utilization. Not to say reducing cycles is bad, but if you're saying that the lifecycle manager is taking a ridiculous amount of compute %, then we should also be measuring CPU % of changes to know if they make an impact on the actual problem. I suspect you actually did a bunch of testing off those ideas and options and have a conclusion that perhaps I'm just missing or maybe you didn't communicate it yet. I might just be tired and missing something obvious between all of these sources. I am starting tomorrow able to get back into normal hours so my thought process will be alot less clouded, but I'm feeling like I'm missing some key details to make decisions or help answer your concerns. Can you be specific and let me know what you changed, tested, and measured -- or concisely what you are trying to get from me that I'm not giving & the context for that in one post? 😆 It seems like we're talking about the new executor for use in Nav2 as well as fixes for the lifecycle manager taking too much compute for what it rightfully does. I don't see a proposal in #6061 that you're referring to 🙃 There's just a flamegraph without context or comparison, so I'm not sure what to make of it honestly in isolation, i.e.:
Did you get to testing and that made the difference to fix the lifecycle manager high compute problem with the current bond rate? |
My previous testing shows it is pretty much stable (the rviz bug I mentioned is hard to reproduce and I am not even sure it is related to the new executor). I think real robot testing would be more reliable here, and that is probably not something I can lead, do you know anyone who might be interested? And should I cherry-pick the commit here?
Yeah that is more of an idea than a proposal. My initial assumption was that "switching to EventExecutor could bring a big reduction in lifecycle manager CPU usage", but from my preliminary testing that doesn't seem to be the case. Based on the flamegraphs, there is some improvement, but it is not that obvious. Right now we are also in a mixed state where SingleThreadedExecutor and EventExecutor are both used in lifecycle manager, I suspect even if we unified everything under EventExecutor (by modifying rclcpp/bond code), it wouldn't bring much more improvement based on what the flamegraphs are showing(but worth testing). Another thing I want to note: from the flamegraph, lifecycle manager is taking roughly 3-6x more CPU than the other individual components. If the goal is to get it closer to the same level as other components, that feels like it might need more fundamental changes beyond just switching the executor So my current take on #6061: there is some benefit, but probably not enough to be obvious. I would love to hear your thoughts as well before I do more testing, like, what kind of reduction would you want to see to consider this worthwhile? Next steps on my end would be to switch bond/rclcpp to EventExecutor as well and remeasure, then see if there is room to optimize further on the hottest paths. But realistically that can only happen around August/September when I am back home |
There was a problem hiding this comment.
Mostly just a few questions but LGTM! Interestinly Jazzy continues to work but Kilted doesn't.
Kilted is EOL in 6 months, non-LTS, and is now superseded by Lyrical, so I could also be convinced to simply drop compilation compatibility with it at this point if its too much a hassle to make it work.
| void Polygon::getPolygon(std::vector<Point> & poly) const | ||
| { | ||
| poly = poly_; | ||
| poly.assign(poly_.begin(), poly_.end()); |
There was a problem hiding this comment.
Why? This seems immensely silly if we cannot copy a vector
There was a problem hiding this comment.
This triggers the null dereference warning:
/root/nav2_ws/src/navigation2/nav2_collision_monitor/include/nav2_collision_monitor/types.hpp:51:8: error: potential null pointer dereference [-Werror=null-dereference]
51 | struct Point
| ^~~~~
/root/nav2_ws/src/navigation2/nav2_collision_monitor/include/nav2_collision_monitor/types.hpp:51:8: error: potential null pointer dereference [-Werror=null-dereference]
/root/nav2_ws/src/navigation2/nav2_collision_monitor/include/nav2_collision_monitor/types.hpp:51:8: error: potential null pointer dereference [-Werror=null-dereference]
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/collision_detector_core.dir/build.make:93: CMakeFiles/collision_detector_core.dir/src/polygon.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /root/nav2_ws/src/navigation2/nav2_collision_monitor/include/nav2_collision_monitor/polygon.hpp:32,
from /root/nav2_ws/src/navigation2/nav2_collision_monitor/src/polygon.cpp:15:
In member function ‘constexpr nav2_collision_monitor::Point& nav2_collision_monitor::Point::operator=(const nav2_collision_monitor::Point&)’,
inlined from ‘constexpr void std::__assign_one(_OutIter&, _InIter&) [with bool _IsMove = false; _OutIter = nav2_collision_monitor::Point*; _InIter = const nav2_collision_monitor::Point*]’ at /usr/include/c++/15/bits/stl_algobase.h:407:9,
inlined from ‘constexpr _OutIter std::__copy_move_a2(_InIter, _Sent, _OutIter) [with bool _IsMove = false; _InIter = const nav2_collision_monitor::Point*; _Sent = const nav2_collision_monitor::Point*; _OutIter = nav2_collision_monitor::Point*]’ at /usr/include/c++/15/bits/stl_algobase.h:462:28,
inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const nav2_collision_monitor::Point*; _OI = nav2_collision_monitor::Point*]’ at /usr/include/c++/15/bits/stl_algobase.h:492:42,
inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = __gnu_cxx::__normal_iterator<const nav2_collision_monitor::Point*, vector<nav2_collision_monitor::Point> >; _OI = __gnu_cxx::__normal_iterator<nav2_collision_monitor::Point*, vector<nav2_collision_monitor::Point> >]’ at /usr/include/c++/15/bits/stl_algobase.h:500:31,
inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<const nav2_collision_monitor::Point*, vector<nav2_collision_monitor::Point> >; _OI = __gnu_cxx::__normal_iterator<nav2_collision_monitor::Point*, vector<nav2_collision_monitor::Point> >]’ at /usr/include/c++/15/bits/stl_algobase.h:642:7,
inlined from ‘constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = nav2_collision_monitor::Point; _Alloc = std::allocator<nav2_collision_monitor::Point>]’ at /usr/include/c++/15/bits/vector.tcc:250:21,
inlined from ‘virtual void nav2_collision_monitor::Polygon::getPolygon(std::vector<nav2_collision_monitor::Point>&) const’ at /root/nav2_ws/src/navigation2/nav2_collision_monitor/src/polygon.cpp:229:10,
inlined from ‘bool nav2_collision_monitor::Polygon::configure()’ at /root/nav2_ws/src/navigation2/nav2_collision_monitor/src/polygon.cpp:98:15:
/root/nav2_ws/src/navigation2/nav2_collision_monitor/include/nav2_collision_monitor/types.hpp:51:8: error: potential null pointer dereference [-Werror=null-dereference]
51 | struct Point
| ^~~~~
/root/nav2_ws/src/navigation2/nav2_collision_monitor/include/nav2_collision_monitor/types.hpp:51:8: error: potential null pointer dereference [-Werror=null-dereference]
/root/nav2_ws/src/navigation2/nav2_collision_monitor/include/nav2_collision_monitor/types.hpp:51:8: error: potential null pointer dereference [-Werror=null-dereference]
gmake[1]: *** [CMakeFiles/Makefile2:234: CMakeFiles/collision_detector_core.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/collision_monitor_core.dir/build.make:93: CMakeFiles/collision_monitor_core.dir/src/polygon.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:202: CMakeFiles/collision_monitor_core.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
I believe a possible alternative is to check if poly is empty before assigning it:
if (poly.empty()) {
return;
}
Is that something you would prefer?
|
This pull request is in conflict. Could you fix it @mini-1235? |
|
Otherwise if you can just fix the conflict with those other changes I can merge |
|
Sorry for the delay, as I mentioned, I have been quite sick and still have some travel coming up, so it has been a lot to manage. I will get to the review items tomorrow Also, I noticed that rolling moved to 26.04 last week. Could we get #6262 merged before this PR? That way CI can run correctly against it |
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
|
f5f77ad is related to recent updates in ament/ament_index#120 |
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
|
Tick the box to add this pull request to the merge queue (same as
|
|
Merge as you see fit |
|
CI fails to compile, but I have never seen that error and I am not able to reproduce it locally. I will investigate tomorrow |
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
|
@mini-1235 change to |
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
Maybe because we are pushing at the same time?😄 I am going to sleep now, will fix again tomorrow if it is not green |
Added a check for num_of_nearest_nodes_ before performing nearest node search. Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
|
I had to fix another case, but building now. WIll merge once tests run and retrigger the docker build |
Basic Info
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:
backport-*.