Skip to content
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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Li-Jinjie
Copy link
Collaborator

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.

@tongtybj tongtybj self-requested a review November 27, 2023 07:59
@@ -87,6 +84,17 @@ AerialRobotBase::~AerialRobotBase()

void AerialRobotBase::mainFunc(const ros::TimerEvent & e)
{
if (~e.last_real.isZero())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Li-Jinjie

Because isZero returns a boolean value, please use ! (exclamation mark) for negation. ~ (tilde mark) is for bit-wise operation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix this in the newest commit

aerial_robot_base/src/aerial_robot_base.cpp Outdated Show resolved Hide resolved
@tongtybj
Copy link
Collaborator

@Li-Jinjie

Could you respond the review comment?

@Li-Jinjie
Copy link
Collaborator Author

@Li-Jinjie

Could you respond the review comment?

Sorry, I will check it tonight. Don't know why I missed the reminder from GitHub...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants