No matching constructor for rosbag::View

asked 2017-09-04 08:43:33 -0500

Albtech gravatar image

Hi guys,

I am trying to follow the rosbag API guideline to create a rosbag viewer as follows:

rosbag::View view(myBag, rosbag::TopicQuery("velodyne_points"));

but I am getting a "No matching constructor" error message. Could you please help me to sort this problem?

Thank you!

edit retag flag offensive close merge delete

Comments

It seems like myBag might be the wrong type. It would be helpful if you could edit your question to include the full error message and the full code that you're trying to compile (or a link to the sample if you're trying to compile some sample code).

ahendrix gravatar image ahendrix  ( 2017-09-04 15:19:51 -0500 )edit

I am following line by line instructions from here http://wiki.ros.org/rosbag/Code%20API . myBag is rosbag::Bag type, it shouldnt be a problem. I am having no compile time error even though my CLion IDE gives underlying redline with "No matching constructor" error message. It fails during runtime

Albtech gravatar image Albtech  ( 2017-09-05 04:02:02 -0500 )edit

C++ is a statically typed language; errors like No Matching Constructor cannot happen at runtime, so it just sounds like your IDE is confused. There's probably a different error when you try to run your program; can you include that in your question?

ahendrix gravatar image ahendrix  ( 2017-09-05 13:27:29 -0500 )edit