Mantain sequence ID equal to the one of input message

asked 2021-10-01 09:11:32 -0500

texdade gravatar image

Hi everyone,

I'm currently using Cartographer and I'm looking for an easy way to keep the sequence ID from resetting. I'll explain myself better: since I'm running Cartographer ROS in a container, I'll be moving that container around, which means that the node will be deleted and re-created multiple times. The problem is that the sequence ID in the header of cartographer's messages will be resetting each time, which is a problem for my infrastructure. One solution would be to set the sequence ID = sequence ID of the input message, but I don't have enough expertise to change Cartographer's code (I don't even know where to start). Is there an easy way to do this using ROS' settings? Or in general to keep the sID from resetting?

Thank you in advance!

edit retag flag offensive close merge delete

Comments

2

Not an answer, just a quick comment.

If you're referring to header.seq, that's been deprecated for almost as long as I can remember. There is also no guarantee anyone sets it, nor is the behaviour between roscpp and rospy the same (not to mention any 3rd party client libraries).

Depending on it, or using it for anything doesn't sound like a good idea.

gvdhoorn gravatar image gvdhoorn  ( 2021-10-01 09:59:12 -0500 )edit

Well ok, looks like I'll have to find another way then... Thank you for your time :)

texdade gravatar image texdade  ( 2021-10-02 03:58:04 -0500 )edit

What are you trying to do for which you wanted to use seq?

gvdhoorn gravatar image gvdhoorn  ( 2021-10-02 07:21:59 -0500 )edit

Sync messages from two different topics, but I'll just put them in separate lists and use a more custom solution

texdade gravatar image texdade  ( 2021-10-02 09:30:08 -0500 )edit

Have you seen message_filters? Specifically the policy based synchronizers?

gvdhoorn gravatar image gvdhoorn  ( 2021-10-02 09:47:08 -0500 )edit

Yes, but since I could have varying delays it's a solution that doesn't really work. However, since the two nodes that I sync will output the same number of messages, I can just put the messages of the faster node in a queue and send everything we the messages from the slower one arrive.

texdade gravatar image texdade  ( 2021-10-02 10:03:56 -0500 )edit

since I could have varying delays it's a solution that doesn't really work

isn't that what the time-based synchronisers are supposed to solve? The 'window' in which two messages are considered to 'belong together' is configurable.

Additionally: synching is done based on header.stamp, not reception time. Those are two very different things.

One case where they really don't work easily is when there is a large difference in message rates. But you write:

the two nodes that I sync will output the same number of messages

so it sounds like that's not the case.

If you could describe what you really want to do in a bit more detail, perhaps we could see whether there is a solution available somewhere.

gvdhoorn gravatar image gvdhoorn  ( 2021-10-02 10:38:43 -0500 )edit