Skip to content

Commit

Permalink
new optional syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Aug 29, 2024
1 parent 6cb7851 commit c0aa729
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opendbc/car/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import tomllib
from abc import abstractmethod, ABC
from enum import StrEnum
from typing import Any, NamedTuple, Optional
from typing import Any, NamedTuple
from collections.abc import Callable
from functools import cache

Expand Down Expand Up @@ -102,7 +102,7 @@ def __init__(self, CP: structs.CarParams, CarController, CarState):
dbc_name = "" if self.cp is None else self.cp.dbc_name
self.CC: CarControllerBase = CarController(dbc_name, CP)

def apply(self, c: structs.CarControl, now_nanos: Optional[int] = None) -> tuple[structs.CarControl.Actuators, list[CanData]]:
def apply(self, c: structs.CarControl, now_nanos: int | None = None) -> tuple[structs.CarControl.Actuators, list[CanData]]:
if now_nanos is None:
now_nanos = int(time.monotonic() * 1e9)
return self.CC.update(c, self.CS, now_nanos)
Expand Down

0 comments on commit c0aa729

Please sign in to comment.