Skip to content

Commit 5fe71b5

Browse files
kaiaaiclaude
andcommitted
coverage: republish the RViz plan on a slow timer (reliable late-join)
A single latched (transient_local) publish of /coverage_planner/plan often does not reach a subscriber that connects after it was sent — RViz Path displays default to Volatile QoS, and some DDS setups don't deliver the retained sample to a late transient_local subscriber either (observed: `ros2 topic echo --qos-durability transient_local` returns nothing while the planner runs, and an RViz Path display added after cleaning starts shows nothing). Republish the plan every 2 s (in addition to the latched publish + the on-change republish), so any subscriber gets it within a couple seconds regardless of QoS or join time. Cheap: a few hundred poses every 2 s. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8ecdd57 commit 5fe71b5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/oomwoo_coverage/oomwoo_coverage/coverage_planner_node.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,15 @@ def __init__(self) -> None:
250250

251251
self.active_pub = self.create_publisher(
252252
Bool, '~/cleaning_active', latched_qos())
253-
# the full boustrophedon plan, latched, for RViz — add a Path display on
254-
# /coverage_planner/plan (fixed frame = map). Republished whenever the
255-
# plan changes (gap-fill), so the display always shows the current plan.
253+
# the full boustrophedon plan, for RViz — add a Path display on
254+
# /coverage_planner/plan (fixed frame = map). Latched for early joiners,
255+
# AND republished on a slow timer: a single transient-local sample often
256+
# fails to reach a late-joining subscriber (RViz Path displays default to
257+
# Volatile QoS, and some DDS setups don't deliver the retained sample), so
258+
# the periodic refresh makes the path show up regardless of QoS or when
259+
# RViz connects. Cheap (a few hundred poses every 2 s).
256260
self.plan_pub = self.create_publisher(Path, '~/plan', latched_qos())
261+
self.create_timer(2.0, self._publish_plan)
257262
# only used by the wedge escape, while no Nav2 goal is active
258263
self.cmd_pub = self.create_publisher(Twist, 'cmd_vel', 10)
259264
# which bumper is pressed decides which way to peel off (_escape_angular)

0 commit comments

Comments
 (0)