A pure Python implementation of NetworkTables, used for robot communications in the FIRST Robotics Competition.
75
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.
Install with Tessl CLI
npx tessl i tessl/pypi-pynetworktablesdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10