From 8f65bf53220b70642e684e4993c4deb2772029d7 Mon Sep 17 00:00:00 2001 From: Pascal Schade Date: Wed, 4 Dec 2024 17:37:31 +0100 Subject: [PATCH] add buttons for debug turning --- field_friend/interface/components/development.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/field_friend/interface/components/development.py b/field_friend/interface/components/development.py index dbec4e3b..198adcde 100644 --- a/field_friend/interface/components/development.py +++ b/field_friend/interface/components/development.py @@ -1,3 +1,4 @@ +import math from typing import TYPE_CHECKING import rosys @@ -42,6 +43,9 @@ def create_development_ui(system: 'System') -> None: ui.label().bind_text_from(system.field_friend.wheels.pose, 'x', lambda x: f'x: {x}') ui.label().bind_text_from(system.field_friend.wheels.pose, 'y', lambda y: f'y: {y}') ui.label().bind_text_from(system.field_friend.wheels.pose, 'yaw_deg', lambda yaw: f'yaw: {yaw}') + with ui.card(): + ui.button('0°', on_click=lambda: system.field_navigation.turn_to_yaw(0.0)) + ui.button('90°', on_click=lambda: system.field_navigation.turn_to_yaw(math.radians(90))) with ui.card(): system.field_navigation.developer_ui() if isinstance(system.field_friend, rosys.hardware.RobotHardware):