Skip to content

Commit d6a76d3

Browse files
committed
announce odometry only when publishing
1 parent a98c9ce commit d6a76d3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • crates/nodes/odometry/src

crates/nodes/odometry/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ async fn run(ctx: Arc<Context>) -> Result<()> {
4646
let parameters = parameters.snapshot().typed().clone();
4747
let imu_state = imu_state_sub.recv_with_metadata().await?;
4848
let imu_time = imu_state.source_time;
49-
let odometry_pub = odometry_pub.announce(imu_time).await?;
5049
let maybe_robot_kinematics_wrapper = robot_kinematics_cache.get_nearest(imu_time);
5150
let maybe_fall_down_state = fall_down_state_cache.get_nearest(imu_time);
5251
let imu_state = imu_state.into_message();
@@ -62,7 +61,11 @@ async fn run(ctx: Arc<Context>) -> Result<()> {
6261
},
6362
&parameters,
6463
) {
65-
odometry_pub.publish(&pose).await?;
64+
odometry_pub
65+
.announce(imu_time)
66+
.await?
67+
.publish(&pose)
68+
.await?;
6669
}
6770
}
6871
}

0 commit comments

Comments
 (0)