tessl install tessl/pypi-pynetworktables@2021.0.0A pure Python implementation of NetworkTables, used for robot communications in the FIRST Robotics Competition.
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.01x
Baseline
Agent success rate without this tile
74%
Expose a thin controller that interacts with a SmartDashboard chooser, allowing dashboard code to observe available options, read the current selection (falling back to a default), push a new selection, and stop listening cleanly.
get_choices returns an empty sequence and get_selection returns None. @testget_selection returns that default value. @teston_choices callback is invoked with the new options in order. @teston_selection callback is invoked with the new selection value. @testset_selection publishes the new selection to the chooser entries so subsequent reads return that value. @testclose is called, further dashboard updates do not trigger callbacks, but the last known selection can still be read. @test@generates
from typing import Callable, Optional, Sequence
class SmartDashboardChooserBridge:
def __init__(
self,
key: str,
on_choices: Optional[Callable[[Sequence[str]], None]] = None,
on_selection: Optional[Callable[[Optional[str]], None]] = None,
) -> None: ...
def get_choices(self) -> Sequence[str]: ...
def get_selection(self) -> Optional[str]: ...
def set_selection(self, selection: str) -> None: ...
def close(self) -> None: ...Use this dependency to connect to the SmartDashboard chooser entries and rely on its chooser integration utilities.