Skip to content

Commit 7dfb70d

Browse files
author
Tobias Juelg
committed
fix: satisfy teleop operator linting
1 parent 5d7fe97 commit 7dfb70d

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎python/rcs/operator/keyboard.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
except ImportError:
1111
HAS_PYNPUT = False
1212

13-
from rcs.envs.base import ControlMode, RelativeTo
13+
from rcs.envs.base import ArmWithGripper, ControlMode, RelativeTo
1414
from rcs.operator.interface import BaseOperator, BaseOperatorConfig, TeleopCommands
1515
from rcs.sim.sim import Sim
1616
from rcs.utils import SimpleFrameRate
@@ -68,7 +68,7 @@ def consume_commands(self) -> TeleopCommands:
6868
def reset_operator_state(self):
6969
pass
7070

71-
def consume_action(self) -> dict[str, object]:
71+
def consume_action(self) -> dict[str, ArmWithGripper]:
7272
return {}
7373

7474
def run(self):

‎python/rcs/operator/pedals.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
except ImportError:
1212
HAS_EVDEV = False
1313

14-
from rcs.envs.base import ControlMode, RelativeTo
14+
from rcs.envs.base import ArmWithGripper, ControlMode, RelativeTo
1515
from rcs.operator.interface import BaseOperator, BaseOperatorConfig, TeleopCommands
1616
from rcs.sim.sim import Sim
1717
from rcs.utils import SimpleFrameRate
@@ -82,7 +82,7 @@ def _evdev_read_loop(self):
8282
if event.type != ecodes.EV_KEY or event.value not in (1, 2):
8383
continue
8484

85-
key_name = event.keycode
85+
key_name = getattr(event, "keycode", None)
8686
if isinstance(key_name, list):
8787
key_name = key_name[0]
8888

@@ -102,7 +102,7 @@ def consume_commands(self) -> TeleopCommands:
102102
def reset_operator_state(self):
103103
pass
104104

105-
def consume_action(self) -> dict[str, object]:
105+
def consume_action(self) -> dict[str, ArmWithGripper]:
106106
return {}
107107

108108
def run(self):

‎python/rcs/operator/so101.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import Any, Callable
66

77
import numpy as np
8-
98
from rcs.envs.base import ControlMode, RelativeTo
109
from rcs.operator.interface import BaseOperator, BaseOperatorConfig, TeleopCommands
1110
from rcs.sim.sim import Sim

0 commit comments

Comments
 (0)