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

tf::MessageFilter CPU usage / clean up problem #913

Closed
conqualifaction opened this issue Oct 13, 2016 · 2 comments
Closed

tf::MessageFilter CPU usage / clean up problem #913

conqualifaction opened this issue Oct 13, 2016 · 2 comments

Comments

@conqualifaction
Copy link

The following code creates additional CPU usage if "testMethod" is called. The problem seems to be connected to the creation of MessageFilter. This can be tested by removing the MessageFilter creation code line.

The additional CPU usage is 4 % on my system.
I could not find a way to clean up in a way to avoid this (e.g. call clear(), unsubscribe(), etc. have no effect).

Tested on ROS Indigo.

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <tf/transform_listener.h>
#include <tf/message_filter.h>
#include <message_filters/subscriber.h>

void testMethod(ros::NodeHandle node)
{
  tf::TransformListener tf_listener(node, ros::Duration(40));
  message_filters::Subscriber<sensor_msgs::Image> img_subscriber(node, "/topic", 400);
  tf::MessageFilter<sensor_msgs::Image> msg_filter(img_subscriber, tf_listener, "/frame", 400);
}

int main(int argc, char** argv)
{
  ros::init(argc, argv, "test_node");
  ros::NodeHandle node;

  testMethod(node);

  ROS_INFO("Going to spin...");
  ros::spin();
  return 0;
}
@dirk-thomas
Copy link
Member

dirk-thomas commented Oct 14, 2016

Your descriptions seems to indicate a problem with tf::MessageFilter. Please consider filling an issue in the repository which contains that class instead: https://github.com/ros/geometry/blob/indigo-devel/tf/include/tf/message_filter.h

@conqualifaction
Copy link
Author

conqualifaction commented Oct 14, 2016

Done. ros/geometry#132

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

No branches or pull requests

2 participants