mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 01:23:41 +08:00
ease wheel angle on ignition change (#39458)
This commit is contained in:
@@ -125,6 +125,7 @@ class HudRenderer(Widget):
|
||||
self._txt_exclamation_point: rl.Texture = gui_app.texture('icons_mici/exclamation_point.png', 9, 44)
|
||||
self._wheel_alpha_filter = FirstOrderFilter(0, 0.05, 1 / gui_app.target_fps)
|
||||
self._wheel_y_filter = FirstOrderFilter(0, 0.1, 1 / gui_app.target_fps)
|
||||
self._wheel_angle_filter = FirstOrderFilter(0, 0.1, 1 / gui_app.target_fps)
|
||||
|
||||
self._set_speed_alpha_filter = FirstOrderFilter(0.0, 0.1, 1 / gui_app.target_fps)
|
||||
|
||||
@@ -202,7 +203,8 @@ class HudRenderer(Widget):
|
||||
# pos
|
||||
pos_x = int(rect.x + 21 + wheel_txt.width / 2)
|
||||
pos_y = int(rect.y + rect.height - 14 - wheel_txt.height / 2 + self._wheel_y_filter.x)
|
||||
rotation = -ui_state.sm['carState'].steeringAngleDeg if ui_state.started and ui_state.received_since_started('carState') else 0.0
|
||||
live_angle = ui_state.started and ui_state.received_since_started('carState')
|
||||
rotation = -ui_state.sm['carState'].steeringAngleDeg * self._wheel_angle_filter.update(live_angle)
|
||||
|
||||
turn_intent_margin = 25
|
||||
self._turn_intent.render(rl.Rectangle(
|
||||
|
||||
Reference in New Issue
Block a user