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

Message filter headerless warning with custom message type

asked 2021-11-07 18:57:32 -0500

kidpaul gravatar image

updated 2021-11-07 18:59:16 -0500

I generated my custom message as following:

uint32 num_object
nav_msgs/Odometry custom

This is a part of the output when echoing a topic using my custom message:

---
num_object: 1
custom:
    header:
        seq: 0
        stamp:
            secs: 1636331652
            nsecs: 425379753
        frame_id: "base_footprint"
     child_frame_id: 'base_link'
    pose:
        pose:
          position:
.......

Here, the only part I'm not updating is a seq value. I provide the stamps using rospy.Time.now()

I'm using ApproximateTimeSynchronizer to synchronize the custom message with another nav_msgs/Odometry message which has a header information:

pose_sub = message_filters.Subscriber('/something', Pose)
odom_sub = message_filters.Subscriber('/odom', Odometry)
ts = message_filters.ApproximateTimeSynchronizer([pose_sub, odom_sub], 5, 0.2)
ts.registerCallback(self._callback)

When I run the code, it shows a following warning:

[WARN] [1636331628.465729]: Cannot use message filters with non-stamped messages. Use the 'allow_headerless' constructor option to auto-assign ROS time to headerless messages.

I'm not sure what is causing this issue even if I provided most data in the header. Does seq value also matter when using the ApproximateTimeSynchronizer?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-08 01:32:52 -0500

gvdhoorn gravatar image

updated 2021-11-08 10:55:56 -0500

I generated my custom message as following:

uint32 num_object
nav_msgs/Odometry custom

I'm not sure what is causing this issue even if I provided most data in the header.

The header field needs to be in the root of the message.

The fact that your custom field is of type nav_msgs/Odometry and has a header field does not help here. The ApproximateTimeSynchronizer will not look for a std_msgs/Header somewhere as a child of a child (ie: it won't see custom.header).

Does seq value also matter when using the ApproximateTimeSynchronizer?

No, it doesn't.

As the name implies, the ApproximateTimeSynchronizer considers only time.

edit flag offensive delete link more

Comments

That makes sense. I should probably reorganize my message.

kidpaul gravatar image kidpaul  ( 2021-11-08 10:34:48 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-11-07 18:57:32 -0500

Seen: 784 times

Last updated: Nov 08 '21