Skip to content

Commit

Permalink
Changed type annotations to follow PEP 604.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaTechRC committed Sep 17, 2024
1 parent 10936b7 commit 7be42ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions field_friend/localization/gnss.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from abc import ABC, abstractmethod
from copy import deepcopy
from dataclasses import dataclass
from typing import Any, Optional
from typing import Any

import numpy as np
import rosys
Expand All @@ -24,7 +24,7 @@ class GNSSRecord:
gps_qual: int = 0
altitude: float = 0.0
separation: float = 0.0
heading: Optional[float] = None
heading: float | None = None
speed_kmh: float = 0.0


Expand All @@ -49,7 +49,7 @@ def __init__(self, odometer: rosys.driving.Odometer, antenna_offset: float) -> N
self.GNSS_CONNECTION_LOST = rosys.event.Event()
"""the GNSS connection was lost"""

self.current: Optional[GNSSRecord] = None
self.current: GNSSRecord | None = None
self.device: str | None = None
self.antenna_offset = antenna_offset
self._is_paused = False
Expand Down Expand Up @@ -107,7 +107,7 @@ def is_paused(self) -> bool:
return self._is_paused

@abstractmethod
async def _create_new_record(self) -> Optional[GNSSRecord]:
async def _create_new_record(self) -> GNSSRecord | None:
pass

def _on_rtk_fix(self) -> None:
Expand Down Expand Up @@ -136,7 +136,7 @@ def _on_rtk_fix(self) -> None:
if not self._is_paused:
self._update_robot_pose()

async def wait_for_robot_pose_update(self, timeout: Optional[float] = None) -> None:
async def wait_for_robot_pose_update(self, timeout: float | None = None) -> None:
event = asyncio.Event()
def callback():
nonlocal event
Expand Down

0 comments on commit 7be42ae

Please sign in to comment.