Skip to content

Commit

Permalink
support latching topics, but because publishers are aggregated togeth…
Browse files Browse the repository at this point in the history
…er all but the most recent is lost- need to handle latching special for now until roslibrust can sort out multiple publishers
  • Loading branch information
lucasw committed Sep 9, 2024
1 parent 508611b commit 6400abc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mcap_tools/src/mcap_play.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,19 @@ async fn mcap_playback_init(
}
if !pubs.contains_key(&channel.topic) {
log::debug!("{mcap_name} topic {}, schema {:?}", channel.topic, schema);
let latching = {
match channel.metadata.get("latching") {
Some(latching) => latching == "1",
None => false,
}
};
let publisher = nh
.advertise_any(
&channel.topic,
&schema.name,
std::str::from_utf8(&schema.data.clone()).unwrap(),
10,
false,
latching,
)
.await?;
pubs.insert(channel.topic.clone(), publisher);
Expand Down

0 comments on commit 6400abc

Please sign in to comment.