ardupilot
ardupilot copied to clipboard
AP_OAPathPlanner: decrease planning period into 100ms
I suggest using static constexpr to replace const and define in all files
@IamPete1 Txs, I will fix this!
Is there any advantage to using a constexpr over just const?
Just a note that a PR with a title of "static-constexpr instead of const or #define` has no business changing the value of those constants.
Please choose a better PR title :-)
@rmackay9 Const is used to represent read-only, constexpr represents constant。 I think it is best to maintain consistency with the c++11 standard, and it is also best to use static to limit the range of variables. Furthermore, I suggest trying to rewrite macro definitions like # define to static constexpr mode as much as possible
@peterbarker Txs! My negligence!
I have extracted teh make-things-constexpr into a different PR and merged it (https://github.com/ArduPilot/ardupilot/pull/26240).
I've retitled this PR as that's not what this does now.
@xianglunkai that just leaves arguing about decreasing the planning period and timeout. @rmackay9 had concerns about whether a very large path might not be computable within the new limits.
I wonder if updating the target at more than 1hz actually helps. I suspect this change is based on an assumption that faster is better but doesn't actually perform significantly better in practice. I'd like to see some testing results.