Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

[rosbag] Errors playing bags that contain latched and non-latched publishers of the same topic #1966

@mikepurvis

Description

@mikepurvis

We're experiencing an issue where we have multiple nodes publishing a topic, and when we go to play it back with rosbag, we get the error message that was introduced in #1544 when latched and unlatched publishers are created within the same process.

I think the fix should be in rosbag— to basically force all instances of a publisher to be latched if any of them are:

bool isLatching(const ConnectionInfo* c)
{
ros::M_string::const_iterator header_iter = c->header->find("latching");
return (header_iter != c->header->end() && header_iter->second == "1");
}
ros::AdvertiseOptions createAdvertiseOptions(const ConnectionInfo* c, uint32_t queue_size, const std::string& prefix) {
ros::AdvertiseOptions opts(prefix + c->topic, queue_size, c->md5sum, c->datatype, c->msg_def);
opts.latch = isLatching(c);
return opts;
}
ros::AdvertiseOptions createAdvertiseOptions(MessageInstance const& m, uint32_t queue_size, const std::string& prefix) {
return ros::AdvertiseOptions(prefix + m.getTopic(), queue_size, m.getMD5Sum(), m.getDataType(), m.getMessageDefinition());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions