0
$\begingroup$

Rosanswers logo

I have set a loop rate in the following way:

ros::Rate r(100)
while(ros::Ok()){
    ros::SpinOnce();
    function();
    r.sleep();
}

Is there anyway to verify if I am accomplish this rate or if the function is taking longer than that? Thank you.


Originally posted by Carollour on ROS Answers with karma: 33 on 2015-03-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi! If you publish a topic you can verify the loop rate with:

rostopic hz /your_topic_name

Originally posted by Chaos with karma: 396 on 2015-03-24

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Carollour on 2015-03-24:
thank you, that was it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.