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

Revision history [back]

Hello, <br\&gt;< p="">

The message type of /dnn_objects is DetectedObjectArray and has a header field, which is I guess a constraint for message_filters.

True. However, if you try to rostopic echo /dnn_objects, you will see the timestamp is not filled in.

A simplest workaround I suppose (if you installed the dnn_detect pacakge from source) is to fill in the timestamp for /dnn_objects topic in dnn_detect.cpp.

If you installed dnn_detect from a binary package, you can use topic_tools/transform to transform /dnn_objects to a new topic /dnn_object_new (let’s say) by modifying the timestamp field.

So it would be something like this:

rosrun topic_tools transform /dnn_objects /dnn_objects_new dnn_detect/DetectedObjectArray 'dnn_detect.msg.DetectedObjectArray(header=std_msgs.msg.Header(seq=m.header.seq,stamp=rospy.Time.now(),frame_id=m.header.frame_id),objects=m.objects)' --import dnn_detect std_msgs rospy

I’ve tried this myself and it worked for me.

Of course, you can write a new node to achieve the same thing, but I find this topic_tools quite useful once you get the hang of it.

Hello, <br\&gt;< p="">


The message type of /dnn_objects is DetectedObjectArray and has a header field, which is I guess a constraint for message_filters.

True. However, if you try to rostopic echo /dnn_objects, you will see the timestamp is not filled in.

A simplest workaround I suppose (if you installed the dnn_detect pacakge from source) is to fill in the timestamp for /dnn_objects topic in dnn_detect.cpp.

If you installed dnn_detect from a binary package, you can use topic_tools/transform to transform /dnn_objects to a new topic /dnn_object_new (let’s say) by modifying the timestamp field.

So it would be something like this:

rosrun topic_tools transform /dnn_objects /dnn_objects_new dnn_detect/DetectedObjectArray 'dnn_detect.msg.DetectedObjectArray(header=std_msgs.msg.Header(seq=m.header.seq,stamp=rospy.Time.now(),frame_id=m.header.frame_id),objects=m.objects)' --import dnn_detect std_msgs rospy

I’ve tried this myself and it worked for me.

Of course, you can write a new node to achieve the same thing, but I find this topic_tools quite useful once you get the hang of it.

Hello,

The message type of /dnn_objects is DetectedObjectArray and has a header field, which is I guess a constraint for message_filters.

True. However, if you try to rostopic echo /dnn_objects, you will see the timestamp is not filled in.

A simplest workaround I suppose (if you installed the dnn_detect pacakge from source) is to fill in the timestamp for /dnn_objects topic in dnn_detect.cpp.

If you installed dnn_detect from a binary package, you can use topic_tools/transform to transform /dnn_objects to a new topic /dnn_object_new (let’s say) by modifying the timestamp field.field in header.

So it would be something like this:

rosrun topic_tools transform /dnn_objects /dnn_objects_new dnn_detect/DetectedObjectArray 'dnn_detect.msg.DetectedObjectArray(header=std_msgs.msg.Header(seq=m.header.seq,stamp=rospy.Time.now(),frame_id=m.header.frame_id),objects=m.objects)' --import dnn_detect std_msgs rospy

I’ve tried this myself and it worked for me.

Of course, you can write a new node to achieve the same thing, but I find this topic_tools quite useful once you get the hang of it.