1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ROS 処理速度を測る

Last updated at Posted at 2021-11-14

ROS C++で処理速度を計測するときは以下のように書きます。

ros::init(argc, argv, "delay");
ros::NodeHandle node_handle = new ros::NodeHandle();

ros::Time start = ros::Time::now();

/* 計測したい処理 */

ros::Time finish = ros::Time::now();

double delay = (finish - start).toSec();

std::cout << "Delay[/s]:" << delay << std::endl;

また,topicの遅延や周期などを測る場合は,rostopic delayrostopic hzを使用します。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?