From cbd60aa266ae1bf87de73a11236c289ff5baa46d Mon Sep 17 00:00:00 2001 From: "Johannes T." <119115663+Johannes-Thiel@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:00:16 +0200 Subject: [PATCH] Fix for lizard issue 66 (#174) * fix bug in d1 axis * fix for the lizard issue * remove logs --- field_friend/hardware/axis_D1.py | 2 +- field_friend/hardware/safety.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/field_friend/hardware/axis_D1.py b/field_friend/hardware/axis_D1.py index 9332e768..aa61f62c 100644 --- a/field_friend/hardware/axis_D1.py +++ b/field_friend/hardware/axis_D1.py @@ -88,7 +88,7 @@ async def stop(self): async def move_to(self, position: float, speed: int | None = None) -> None: if self.is_referenced: - await self.robot_brain.send(f'{self.name}_motor.profile_position({self.compute_steps(position)});') + await self.robot_brain.send(f'{self.name}_motor.profile_position({self._compute_steps(position)});') if not self.is_referenced: self.log.error(f'AxisD1 {self.name} is not refernced') return diff --git a/field_friend/hardware/safety.py b/field_friend/hardware/safety.py index 2ddf4e56..eead4380 100644 --- a/field_friend/hardware/safety.py +++ b/field_friend/hardware/safety.py @@ -88,9 +88,9 @@ def __init__(self, robot_brain: rosys.hardware.RobotBrain, *, for name in estop.pins: lizard_code += f'when estop_{name}.level == 0 then stop(); end\n' if isinstance(bumper, rosys.hardware.BumperHardware): - lizard_code += 'when ' + \ - ' or '.join(f'{bumper.name}_{pin}.level == 1' for pin in bumper.pins) + \ - f' then {wheels.name}.off(); end\n' + for name in bumper.pins: + lizard_code += f'bumper_{name}.level = 0\n' + lizard_code += f'when bumper_{name}.level == 1 then stop(); end\n' # implement stop call for "ground check" reference sensors if isinstance(y_axis, ChainAxisHardware):