Skip to content

Commit 7f735fc

Browse files
kaiaaiclaude
andcommitted
wall_clean: default arc_omega 0.1, drive the first leg straight
Two cleaning tweaks: - Bump the default cruise arc rate from 0.05 to 0.1 rad/s (launch built-in default and the node's declared default, kept in sync). - Skip the arc on the very first cruise leg. The workflow is to aim the robot at the target wall with teleop and then launch wall_clean; arcing during that approach forces you to pre-aim off-axis to compensate. A new _first_leg flag makes the initial approach dead straight and clears on the first bump, so the wall-hugging arc engages only once we're actually following a wall. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8acd061 commit 7f735fc

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/oomwoo_clean/launch/wall_clean.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# name -> built-in default; each is overridable by kaia (clean.<name>) then :=
3434
CLEAN_PARAMS = {
3535
'v_cruise': 0.15, # forward cleaning speed (m/s)
36-
'arc_omega': 0.05, # gentle right-arc rate while cruising (rad/s)
36+
'arc_omega': 0.1, # gentle right-arc rate while cruising (rad/s)
3737
'v_back': 0.10, # backoff reverse speed (m/s)
3838
'backoff_s': 0.5, # backoff duration (s)
3939
'turn_speed': 0.7, # angular speed while turning left (rad/s)

src/oomwoo_clean/oomwoo_clean/wall_clean_node.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class WallClean(Node):
7474
def __init__(self) -> None:
7575
super().__init__('wall_clean')
7676
self.v_cruise = self.declare_parameter('v_cruise', 0.15).value
77-
self.arc_omega = self.declare_parameter('arc_omega', 0.05).value
77+
self.arc_omega = self.declare_parameter('arc_omega', 0.1).value
7878
self.v_back = self.declare_parameter('v_back', 0.10).value
7979
self.backoff_s = self.declare_parameter('backoff_s', 0.5).value
8080
self.turn_speed = self.declare_parameter('turn_speed', 0.7).value
@@ -98,6 +98,10 @@ def __init__(self) -> None:
9898
self._bump_left_t = None
9999
self._bump_right_t = None
100100
self._side = 'both'
101+
# First leg: I aim the robot at the wall with teleop and launch this, so
102+
# the approach should be a STRAIGHT line (no arc to compensate for). The
103+
# arc kicks in only after the first bump, once we're following the wall.
104+
self._first_leg = True
101105
self.state = CRUISE
102106
self.until = self.get_clock().now()
103107
self.create_timer(1.0 / hz, self._tick)
@@ -149,11 +153,14 @@ def _drive(self, lin, ang) -> None:
149153
def _tick(self) -> None:
150154
now = self.get_clock().now()
151155
if self.state == CRUISE:
152-
# forward + gentle RIGHT arc, drifting toward the wall on the right
153-
self._drive(self.v_cruise, -self.arc_omega)
156+
# forward + gentle RIGHT arc, drifting toward the wall on the right;
157+
# the very first leg (teleop-aimed approach) drives dead straight
158+
arc = 0.0 if self._first_leg else -self.arc_omega
159+
self._drive(self.v_cruise, arc)
154160
left = self._pressed(self._bump_left_t, now)
155161
right = self._pressed(self._bump_right_t, now)
156162
if left or right:
163+
self._first_leg = False # from here on, arc toward the wall
157164
self._side = 'both' if left and right else (
158165
'left' if left else 'right')
159166
self.state = BACKOFF

0 commit comments

Comments
 (0)