ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_OAPathPlanner: decrease planning period into 100ms

Open xianglunkai opened this issue 2 years ago • 7 comments

I suggest using static constexpr to replace const and define in all files

xianglunkai avatar May 08 '23 03:05 xianglunkai

@IamPete1 Txs, I will fix this!

xianglunkai avatar May 09 '23 03:05 xianglunkai

Is there any advantage to using a constexpr over just const?

rmackay9 avatar May 09 '23 06:05 rmackay9

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 :-)

peterbarker avatar May 10 '23 01:05 peterbarker

@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

xianglunkai avatar May 10 '23 01:05 xianglunkai

@peterbarker Txs! My negligence!

xianglunkai avatar May 10 '23 01:05 xianglunkai

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.

peterbarker avatar Feb 19 '24 22:02 peterbarker

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.

rmackay9 avatar Feb 19 '24 23:02 rmackay9