Skip to content

Commit

Permalink
Fix gnss navigation bug (#185)
Browse files Browse the repository at this point in the history
We had driving timeouts when starting an automation the first time,
because the target position was set before the robot updated it's
position. This PR fixes that.
  • Loading branch information
pascalzauberzeug authored Sep 25, 2024
1 parent 8d57a0e commit d36eb6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions field_friend/automations/navigation/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ async def prepare(self) -> bool:
if isinstance(self.detector, rosys.vision.DetectorSimulation) and not rosys.is_test:
self.detector.simulated_objects = []
self.log.info('clearing plant provider')
await self.gnss.update_robot_pose()
return True

async def finish(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions tests/test_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async def test_straight_line_with_high_angles(system: System):
await system.driver.wheels.stop()
assert isinstance(system.current_navigation, StraightLineNavigation)
system.current_navigation.length = 1.0
system.gnss.observed_poses.clear()
system.automator.start()
await forward(until=lambda: system.automator.is_running)
await forward(until=lambda: system.automator.is_stopped)
Expand Down

0 comments on commit d36eb6e

Please sign in to comment.