jsk-ros-pkg / jsk_aerial_robot

The platfrom for aerial robot (e.g. general multirotor, hydrus, di, dragon, etc)
http://www.jsk.t.u-tokyo.ac.jp/index-j.html
34 stars 34 forks source link

[Base] check the execution time of main loop #576

Closed Li-Jinjie closed 1 year ago

Li-Jinjie commented 1 year ago

What is this

The real execution time for the main loop is super critical. However, some optimization-based methods (e.g. MPC) might take longer time to execute the loop once. So I add some code to monitor this time, and if the real execution time is longer than tolerance, ROS_WARN will be printed.

The code refactoring is automatically triggered.

TODO

If there are other critical timers inside the system (e.g. estimator), please tell me and I will add the same function for them.

tongtybj commented 1 year ago

Very helpful contribution!

But, again, please separate the PR according to different purposes or functions.

Li-Jinjie commented 1 year ago

This formatting is automatically triggered by pre-commit. I need to formatting the code file first otherwise I cannot commit. Should I stop pre-commit when contributing to the old code? Maybe formatting the whole project someday will be helpful.

sugikazu75 commented 1 year ago

@Li-Jinjie In my opinion, diffs in PR should be easy to read. So I think the main purpose of the PR and formating codes should be separated. I would prefer to format all codes in one PR when we will do major updates.

Li-Jinjie commented 1 year ago

@Li-Jinjie In my opinion, diffs in PR should be easy to read. So I think the main purpose of the PR and formating codes should be separated. I would prefer to format all codes in one PR when we will do major updates.

Get it. I will stop the pre-commit when contributing to old code.

@sugikazu75 Could you please tell me other critical timers in our system that also need this function? I can add these functions in a new PR together.

sugikazu75 commented 1 year ago

@Li-Jinjie As far as I know, there is no other critical timer because almost processes are executed in aerial_robot_base_node.

Li-Jinjie commented 1 year ago

@Li-Jinjie As far as I know, there is no other critical timer because almost processes are executed in aerial_robot_base_node.

Get it. Thank you!