ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to subscribe visp_auto_tracker to /usb_cam/image_raw/compressed?

asked 2014-07-16 14:15:47 -0500

Alvin gravatar image

Hi all,

I am wondering if this is possible, since just subscribing to /usb_cam/image_raw causes a lot of lag, and the visp_auto_tracker debug display window will freeze up. Here is my launch file to run visp_auto_tracker (where I try to subscribe to /usb_cam/image_raw/compressed):

  <!-- Launch the tracking node -->
  <node pkg="visp_auto_tracker" type="visp_auto_tracker" name="visp_auto_tracker" output="screen">
    <param name="model_path" type="string" value="$(find visp_auto_tracker)/models" />
    <param name="model_name" type="string" value="pattern" />
    <param name="debug_display" type="bool" value="True" />

    <remap from="/visp_auto_tracker/camera_info" to="/usb_cam/camera_info"/>
    <remap from="/visp_auto_tracker/image_raw" to="/usb_cam/image_raw/compressed"/>

But when I run this, I get this error in the terminal where I am running the usb_cam node:

[ERROR] [1405534682.215726942]: Client [/visp_auto_tracker] wants topic /usb_cam/image_raw/compressed to have datatype/md5sum [sensor_msgs/Image/060021388200f6f0f447d0fcd9c64743], but our version has [sensor_msgs/CompressedImage/8f7a12909da2c9d3332d540a0977563f]. Dropping connection.

So, is there a way to properly subscribe the visp_auto_tracker to /usb_cam/image_raw/compression? Appreciate any help, thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-16 14:39:06 -0500

McMurdo gravatar image

updated 2014-07-16 14:40:57 -0500

Please post relevant code. There is a type mismatch. The topic is posting the message with a particular data-type and you are subscribing to another data-type.

I think the topic by-default uses sensor_msgs/CompressedImage while your callback has type sensor_msgs/Image.

If your callback has arguments

const sensor_msgs::ImageConstPtr& _msg

change that to

const sensor_msgs::CompressedImageConstPtr& _msg

But, of course, you should change the code inside the callback to be sure you are doing the right things with that message.

If you are using a default ros executable and then using that remap, it won't work at all. Because the topic types are different.

Have a great day!


edit flag offensive delete link more


Thank you for the response! Currently, I am not running any code, just rosrun usb_cam usb_cam_node and visp_auto_tracker via the above launch I'm not sure where I can do the changes as you suggested.

Alvin gravatar image Alvin  ( 2014-07-18 11:34:07 -0500 )edit

That means you mus provide the topic that the node you are running requires. So remove the remaps. They won't work.

McMurdo gravatar image McMurdo  ( 2014-07-19 03:36:22 -0500 )edit

Question Tools

1 follower


Asked: 2014-07-16 14:15:47 -0500

Seen: 1,178 times

Last updated: Jul 16 '14