Skip to content

Commit

Permalink
Add Field Navigation Developer UI to the dev page (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalzauberzeug authored Oct 22, 2024
1 parent bf52fed commit 3d296b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions field_friend/automations/navigation/field_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,13 @@ def developer_ui(self) -> None:
ui.number('Turn Step', step=1.0, min=1.0, max=180.0, format='%.2f', on_change=self.request_backup) \
.props('dense outlined') \
.classes('w-24') \
.bind_value(self, '_turn_step', forward=np.deg2rad, backward=np.rad2deg)
ui.number('Turn Step', step=0.1, min=0.1, max=20.0, format='%.2f', on_change=self.request_backup) \
.bind_value(self, '_turn_step', forward=np.deg2rad, backward=np.rad2deg) \
.tooltip(f'TURN_STEP (default: {np.rad2deg(self.TURN_STEP):.2f}°)')
ui.number('Max GNSS Waiting Time', step=0.1, min=0.1, max=20.0, format='%.2f', on_change=self.request_backup) \
.props('dense outlined') \
.classes('w-24') \
.bind_value(self, '_max_gnss_waiting_time')
.bind_value(self, '_max_gnss_waiting_time') \
.tooltip(f'MAX_GNSS_WAITING_TIME (default: {self.MAX_GNSS_WAITING_TIME:.2f}s)')

def _set_field(self, field_id: str) -> None:
field = self.field_provider.get_field(field_id)
Expand Down
3 changes: 3 additions & 0 deletions field_friend/interface/components/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def development(system: 'System') -> None:
rosys.simulation_ui()
hardware_control(system.field_friend, system.automator, system.puncher)
status_dev_page(system.field_friend, system)
with ui.card().style('background-color: #3E63A6; color: white;'):
ui.label('Field Navigation')
system.field_navigation.developer_ui()
with ui.row().style('width: calc(100vw - 2rem); flex-wrap: nowrap;'):
io_overview(system)
if isinstance(system.field_friend, rosys.hardware.RobotHardware):
Expand Down

0 comments on commit 3d296b2

Please sign in to comment.