diff --git a/external_samples/color_range_sensor.py b/external_samples/color_range_sensor.py index 11e45bf8..2f271872 100644 --- a/external_samples/color_range_sensor.py +++ b/external_samples/color_range_sensor.py @@ -16,8 +16,8 @@ # @fileoverview This is a sample for a color/range sensor # @author alan@porpoiseful.com (Alan Smith) -from typing import Protocol, Self -from component import Component, InvalidPortException +from typing import Protocol +from component import Component from port import Port, PortType class DistanceCallable(Protocol): @@ -32,29 +32,9 @@ def __call__(self, hue : int, saturation : int, value : int) -> None: class ColorRangeSensor(Component): def __init__(self, port : Port): + '''REV Robotics Color Sensor v3. Part number REV-31-1557. https://www.revrobotics.com/rev-31-1557''' super().__init__( port, expectedType = PortType.I2C_PORT) - def get_manufacturer(self) -> str: - return "REV Robotics" - - def get_name(self) -> str: - return "Color Sensor v3" - - def get_part_number(self) -> str: - return "REV-31-1557" - - def get_url(self) -> str: - return "https://www.revrobotics.com/rev-31-1557" - - def get_version(self) -> tuple[int, int, int]: - return (1, 0, 0) - - def reset(self) -> None: - pass - - def periodic(self) -> None: - pass - # Component specific methods def get_color_rgb(self) -> tuple[int, int, int]: diff --git a/external_samples/component.py b/external_samples/component.py index f0da9e0a..b55dc0ea 100644 --- a/external_samples/component.py +++ b/external_samples/component.py @@ -16,7 +16,7 @@ # @fileoverview This is an abstract class for all components # @author alan@porpoiseful.com (Alan Smith) -from abc import ABC, abstractmethod +from abc import ABC from typing import Protocol from port import Port, PortType @@ -38,47 +38,14 @@ def __init__(self, port : Port, expectedType : PortType): self.port = port - # Returns the manufacturer of the component - @abstractmethod - def get_manufacturer(self) -> str: + def opmode_start(self) -> None: pass - # Returns the name of the component - @abstractmethod - def get_name(self) -> str: + def opmode_periodic(self) -> None: pass - # Returns the part number of the component - @abstractmethod - def get_part_number(self) -> str: - pass - - # Returns the URL of the component - @abstractmethod - def get_url(self) -> str: - pass - - # Returns the version of the software (returned as a (major, minor, patch) tuple where - # major, minor and patch are all positive integers - # This MUST follow semantic versioning as described here: https://semver.org/ - @abstractmethod - def get_version(self) -> tuple[int, int, int]: - pass - - def start(self) -> None: - pass - - def update(self) -> None: - pass - - # This stops all movement (if any) for the component - def stop(self) -> None: - pass - - # This performs any reset required (if any) at the beginning of each opmode - # This might remove any registered callbacks - @abstractmethod - def reset(self) -> None: + # Subclasses should override opmode_end to stop all movement (if any) for the component + def opmode_end(self) -> None: pass # Returns the port this connects to of the PortType enumeration @@ -86,9 +53,3 @@ def get_connection_port_type(self) -> PortType | None: if self.port: return self.port.get_type() return None - - # This is called periodically when an opmode is running. The component might use this - # to talk to hardware and then call callbacks - @abstractmethod - def periodic(self) -> None: - pass diff --git a/external_samples/expansion_hub_motor.py b/external_samples/expansion_hub_motor.py index e9fadc5c..5d66d028 100644 --- a/external_samples/expansion_hub_motor.py +++ b/external_samples/expansion_hub_motor.py @@ -20,45 +20,20 @@ __author__ = "lizlooney@google.com (Liz Looney)" -from typing import Self -from component import Component, InvalidPortException +from component import Component from port import Port, PortType -import expansion_hub +from wpilib_placeholders import expansion_hub import wpimath class ExpansionHubMotor(Component): def __init__(self, port : Port): + '''REV Robotics Expansion Hub Motor''' super().__init__(port, PortType.EXPANSION_HUB_MOTOR) self.expansion_hub_motor = expansion_hub.ExpansionHubMotor(self.port.port1.location, self.port.port2.location) - def get_manufacturer(self) -> str: - return "REV Robotics" - - def get_name(self) -> str: - return "Expansion Hub Motor" - - def get_part_number(self) -> str: - return "" - - def get_url(self) -> str: - return "" - - def get_version(self) -> tuple[int, int, int]: - return (1, 0, 0) - - def start(self) -> None: + def opmode_start(self) -> None: self.expansion_hub_motor.setEnabled(True) - def stop(self) -> None: - # TODO: Send stop command to motor. - pass - - def reset(self) -> None: - pass - - def periodic(self) -> None: - pass - # Component specific methods # Methods from expansion_hub.ExpansionHubMotor diff --git a/external_samples/expansion_hub_servo.py b/external_samples/expansion_hub_servo.py index 7ebae626..4928bcc3 100644 --- a/external_samples/expansion_hub_servo.py +++ b/external_samples/expansion_hub_servo.py @@ -20,47 +20,19 @@ __author__ = "lizlooney@google.com (Liz Looney)" -from typing import Self -from component import Component, PortType, InvalidPortException +from component import Component from port import Port, PortType -import expansion_hub +from wpilib_placeholders import expansion_hub +import wpimath class ExpansionHubServo(Component): def __init__(self, port : Port): + '''REV Robotics Expansion Hub Servo''' super().__init__(port, PortType.EXPANSION_HUB_SERVO) self.expansion_hub_servo = expansion_hub.ExpansionHubServo(self.port.port1.location, self.port.port2.location) - def get_manufacturer(self) -> str: - return "REV Robotics" - - def get_name(self) -> str: - return "Expansion Hub Servo" - - def get_part_number(self) -> str: - return "" - - def get_url(self) -> str: - return "" - - def get_version(self) -> tuple[int, int, int]: - return (1, 0, 0) - - def start(self) -> None: + def opmode_start(self) -> None: self.expansion_hub_servo.setEnabled(True) - pass - - def stop(self) -> None: - # TODO: Send stop command to servo. - pass - - def reset(self) -> None: - pass - - def get_connection_port_type(self) -> list[PortType]: - return [PortType.USB_PORT, PortType.USB_PORT] - - def periodic(self) -> None: - pass # Component specific methods @@ -78,7 +50,7 @@ def setEnabled(self, enabled: bool): def isHubConnected(self) -> bool: return self.expansion_hub_servo.isHubConnected() - def setFramePeriod(self, framePeriod: int): + def setFramePeriod(self, framePeriod: wpimath.units.microseconds): self.expansion_hub_servo.setFramePeriod(framePeriod) def setPulseWidth(self, pulseWidth: int): diff --git a/external_samples/port.py b/external_samples/port.py index 8b463ff6..2bbf33a7 100644 --- a/external_samples/port.py +++ b/external_samples/port.py @@ -17,7 +17,7 @@ # @author alan@porpoiseful.com (Alan Smith) from abc import ABC, abstractmethod from enum import Enum -from typing import Final, Self +from typing import Final _BASE_COMPOUND: Final[int] = 256 diff --git a/external_samples/rev_touch_sensor.py b/external_samples/rev_touch_sensor.py index ead03b60..393fee69 100644 --- a/external_samples/rev_touch_sensor.py +++ b/external_samples/rev_touch_sensor.py @@ -16,36 +16,20 @@ # @fileoverview This is a sample for a touch sensor # @author alan@porpoiseful.com (Alan Smith) -from typing import Self -from component import Component, PortType, InvalidPortException, EmptyCallable +from component import Component, EmptyCallable from port import Port, PortType class RevTouchSensor(Component): def __init__(self, port : Port): + '''REV Robotics Touch Sensor. Part number REV-31-1425. https://www.revrobotics.com/rev-31-1425''' super().__init__(port, PortType.SMART_IO_PORT) self._is_pressed = None - def get_manufacturer(self) -> str: - return "REV Robotics" - - def get_name(self) -> str: - return "Touch Sensor" - - def get_part_number(self) -> str: - return "REV-31-1425" - - def get_url(self) -> str: - return "https://www.revrobotics.com/rev-31-1425/" - - def get_version(self) -> tuple[int, int, int]: - return (1, 0, 0) - - def reset(self) -> None: + def opmode_stop(self) -> None: self.pressed_callback = None self.released_callback = None - pass - def periodic(self) -> None: + def opmode_periodic(self) -> None: old = self._is_pressed self._read_hardware() if old != self._is_pressed: @@ -57,7 +41,7 @@ def periodic(self) -> None: # Component specific methods def _read_hardware(self): - # here read hardware to get the current value of the sensor and set self._is_pressed + # TODO: Read hardware to get the current value of the sensor and set self._is_pressed pass def is_pressed(self) -> bool: diff --git a/external_samples/smart_motor.py b/external_samples/smart_motor.py index 5f8c0c17..aa33d9ca 100644 --- a/external_samples/smart_motor.py +++ b/external_samples/smart_motor.py @@ -16,8 +16,7 @@ # @fileoverview This is a sample for a smart motor # @author alan@porpoiseful.com (Alan Smith) -from typing import Self -from component import Component, PortType, InvalidPortException +from component import Component from port import Port, PortType class SmartMotor(Component): @@ -39,16 +38,10 @@ def get_url(self) -> str: def get_version(self) -> tuple[int, int, int]: return (1, 0, 0) - def stop(self) -> None: + def opmode_end(self) -> None: # TODO: send stop command to motor pass - def reset(self) -> None: - pass - - def periodic(self) -> None: - pass - # Component specific methods def set_speed(self, speed: float) -> None: diff --git a/external_samples/spark_mini.py b/external_samples/spark_mini.py index 9d55ef7a..5fd8ad2e 100644 --- a/external_samples/spark_mini.py +++ b/external_samples/spark_mini.py @@ -20,8 +20,7 @@ __author__ = "lizlooney@google.com (Liz Looney)" -from typing import Self -from component import Component, PortType, InvalidPortException +from component import Component from port import Port, PortType import wpilib @@ -51,16 +50,10 @@ def get_url(self) -> str: def get_version(self) -> tuple[int, int, int]: return (1, 0, 0) - def stop(self) -> None: + def opmode_end(self) -> None: # TODO: send stop command to motor pass - def reset(self) -> None: - pass - - def periodic(self) -> None: - pass - # Component specific methods # Methods from wpilib.PWMMotorController diff --git a/external_samples/sparkfun_led_stick.py b/external_samples/sparkfun_led_stick.py index 62868602..04669bd2 100644 --- a/external_samples/sparkfun_led_stick.py +++ b/external_samples/sparkfun_led_stick.py @@ -14,8 +14,7 @@ __author__ = "lizlooney@google.com (Liz Looney)" -from typing import Self -from component import Component, PortType, InvalidPortException +from component import Component from port import Port, PortType import wpilib @@ -38,15 +37,9 @@ def get_url(self) -> str: def get_version(self) -> tuple[int, int, int]: return (1, 0, 0) - def stop(self) -> None: + def opmode_end(self) -> None: self.turn_all_off() - def reset(self) -> None: - pass - - def periodic(self) -> None: - pass - # SparkFunLEDStick methods def set_color(self, position: int, color: wpilib.Color) -> None: diff --git a/python/wpilib_placeholders/__init__.py b/python/wpilib_placeholders/__init__.py new file mode 100644 index 00000000..4b18bfba --- /dev/null +++ b/python/wpilib_placeholders/__init__.py @@ -0,0 +1,14 @@ +"""Placeholder classes for future wpilib.""" + +from .expansion_hub import ExpansionHubPidConstants, ExpansionHubMotor, ExpansionHubServo, ExpansionHub +from .op_mode_robot import OpModeRobot +from .periodic_op_mode import PeriodicOpMode + +__all__ = [ + 'ExpansionHubPidConstants', + 'ExpansionHubMotor', + 'ExpansionHubServo', + 'ExpansionHub', + 'OpModeRobot', + 'PeriodicOpMode', +] diff --git a/server_python_scripts/expansion_hub.py b/python/wpilib_placeholders/expansion_hub.py similarity index 100% rename from server_python_scripts/expansion_hub.py rename to python/wpilib_placeholders/expansion_hub.py diff --git a/python/wpilib_placeholders/op_mode_robot.py b/python/wpilib_placeholders/op_mode_robot.py new file mode 100644 index 00000000..dda7dbf1 --- /dev/null +++ b/python/wpilib_placeholders/op_mode_robot.py @@ -0,0 +1,23 @@ +import wpilib + +class OpModeRobot: + def __init__(self): + pass + + def StartCompetition(self): + pass + + def EndCompetition(self): + pass + + def DriverStationConnected(self): + pass + + def NonePeriodic(self): + pass + + def AddOpMode(self, mode, name: str, group: str, description: str, textColor: wpilib.Color, backgroundColor: wpilib.Color): + pass + + def AddOpMode(self, mode, name: str, group: str, description: str): + pass diff --git a/python/wpilib_placeholders/periodic_op_mode.py b/python/wpilib_placeholders/periodic_op_mode.py new file mode 100644 index 00000000..c152207b --- /dev/null +++ b/python/wpilib_placeholders/periodic_op_mode.py @@ -0,0 +1,38 @@ +import wpimath + +class PeriodicOpMode: + def __init__(self): + pass + + def DisabledPeriodic(self): + pass + + def Start(self): + pass + + def Periodic(self): + pass + + def End(self): + pass + + def GetLoopStartTime(self) -> int: + pass + + def AddPeriodic(self): + pass + + def GetPeriod(self) -> wpimath.units.seconds: + pass + + def PrintWatchdogEpochs(self): + pass + + def OpModeRun(self, opModeId: int): + pass + + def OpModeStop(self): + pass + + def LoopFunc(self): + pass diff --git a/python_tools/generate_json.py b/python_tools/generate_json.py index 80c75272..8d09b564 100644 --- a/python_tools/generate_json.py +++ b/python_tools/generate_json.py @@ -49,11 +49,12 @@ import wpimath.units import wpinet import wpiutil +sys.path.append("../python") +import wpilib_placeholders # Server python scripts sys.path.append("../server_python_scripts") import blocks_base_classes -import expansion_hub # TODO(lizlooney): update this when it is built into robotpy. # External samples sys.path.append("../external_samples") @@ -87,9 +88,9 @@ def main(argv): pathlib.Path(f'{FLAGS.output_directory}/generated/').mkdir(parents=True, exist_ok=True) robotpy_modules = [ - expansion_hub, # TODO(lizlooney): update this when it is built into robotpy. ntcore, wpilib, + wpilib_placeholders, wpilib.counter, wpilib.drive, wpilib.event, diff --git a/server_python_scripts/blocks_base_classes/__init__.py b/server_python_scripts/blocks_base_classes/__init__.py index edf87662..b546dcca 100644 --- a/server_python_scripts/blocks_base_classes/__init__.py +++ b/server_python_scripts/blocks_base_classes/__init__.py @@ -1,16 +1,13 @@ """Base classes for SystemCore blocks interface.""" -from .opmode import OpMode, Teleop, Auto, Test, Name, Group +from .decorators import Teleop, Auto, Test, Name, Group from .mechanism import Mechanism -from .robot_base import RobotBase __all__ = [ - 'OpMode', 'Teleop', 'Auto', 'Test', 'Name', 'Group', 'Mechanism', - 'RobotBase', ] diff --git a/server_python_scripts/blocks_base_classes/decorators.py b/server_python_scripts/blocks_base_classes/decorators.py new file mode 100644 index 00000000..7cdaccde --- /dev/null +++ b/server_python_scripts/blocks_base_classes/decorators.py @@ -0,0 +1,16 @@ + +# For now this does nothing but it lets the decorator work +def Teleop(cls): + return cls + +def Auto(cls): + return cls + +def Test(cls): + return cls + +def Name(cls, str): + return cls + +def Group(cls, str): + return cls diff --git a/server_python_scripts/blocks_base_classes/mechanism.py b/server_python_scripts/blocks_base_classes/mechanism.py index 18d32f49..f3b2e78b 100644 --- a/server_python_scripts/blocks_base_classes/mechanism.py +++ b/server_python_scripts/blocks_base_classes/mechanism.py @@ -26,14 +26,14 @@ def fire_event(self, event_name: str, *args) -> None: for event_handler in self.event_handlers[event_name]: event_handler(*args) - def start(self) -> None: + def opmode_start(self) -> None: for hardware in self.hardware: - hardware.start() + hardware.opmode_start() - def update(self) -> None: + def opmode_periodic(self) -> None: for hardware in self.hardware: - hardware.update() + hardware.opmode_periodic() - def stop(self) -> None: + def opmode_end(self) -> None: for hardware in self.hardware: - hardware.stop() + hardware.opmode_end() diff --git a/server_python_scripts/blocks_base_classes/opmode.py b/server_python_scripts/blocks_base_classes/opmode.py deleted file mode 100644 index de597e53..00000000 --- a/server_python_scripts/blocks_base_classes/opmode.py +++ /dev/null @@ -1,28 +0,0 @@ -from .robot_base import RobotBase - -# This is the base class that all OpModes derive from -class OpMode: - def __init__(self, robot: RobotBase): - self.robot = robot - def start(self) -> None: - self.robot.start() - def loop(self) -> None: - self.robot.update() - def stop(self) -> None: - self.robot.stop() - -# For now this does nothing but it lets the decorator work -def Teleop(OpMode): - return OpMode - -def Auto(OpMode): - return OpMode - -def Test(OpMode): - return OpMode - -def Name(OpMode, str): - return OpMode - -def Group(OpMode, str): - return OpMode diff --git a/server_python_scripts/blocks_base_classes/robot_base.py b/server_python_scripts/blocks_base_classes/robot_base.py deleted file mode 100644 index 51b10ed3..00000000 --- a/server_python_scripts/blocks_base_classes/robot_base.py +++ /dev/null @@ -1,43 +0,0 @@ -# This is the class all robots derive from - -from typing import Callable - -class RobotBase: - def __init__(self): - self.hardware = [] - # In self.event_handlers, the keys are the event names, the values are a list of handlers. - self.event_handlers = {} - self.define_hardware() - - def define_hardware(self): - pass - - def register_event_handler(self, event_name: str, event_handler: Callable) -> None: - if event_name in self.event_handlers: - self.event_handlers[event_name].append(event_handler) - else: - self.event_handlers[event_name] = [event_handler] - - def unregister_event_handler(self, event_name: str, event_handler: Callable) -> None: - if event_name in self.event_handlers: - if event_handler in self.event_handlers[event_name]: - self.event_handlers[event_name].remove(event_handler) - if not self.event_handlers[event_name]: - del self.event_handlers[event_name] - - def fire_event(self, event_name: str, *args) -> None: - if event_name in self.event_handlers: - for event_handler in self.event_handlers[event_name]: - event_handler(*args) - - def start(self) -> None: - for hardware in self.hardware: - hardware.start() - - def update(self) -> None: - for hardware in self.hardware: - hardware.update() - - def stop(self) -> None: - for hardware in self.hardware: - hardware.stop() diff --git a/server_python_scripts/run_opmode.py b/server_python_scripts/run_opmode.py index 4b42ee4a..39ff1b4f 100755 --- a/server_python_scripts/run_opmode.py +++ b/server_python_scripts/run_opmode.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 """ -Script to run an opmode class derived from the OpMode base class. +Script to run an opmode class derived from the PeriodicOpMode base class. Usage: python run_opmode.py -The opmode file should contain a class that inherits from OpMode. +The opmode file should contain a class that inherits from PeriodicOpMode. """ import sys @@ -16,23 +16,23 @@ import traceback from pathlib import Path -from blocks_base_classes import OpMode +from wpilib_placeholders import PeriodicOpMode from robot import Robot def find_opmode_class(module): """ - Find the first class in the module that inherits from OpMode. + Find the first class in the module that inherits from PeriodicOpMode. Args: module: The imported Python module Returns: - The OpMode-derived class, or None if not found + The PeriodicOpMode-derived class, or None if not found """ for name, obj in inspect.getmembers(module, inspect.isclass): - if obj != OpMode and issubclass(obj, OpMode): + if obj != PeriodicOpMode and issubclass(obj, PeriodicOpMode): return obj return None @@ -45,17 +45,17 @@ def load_opmode_from_file(file_path): file_path: Path to the Python file containing the opmode class Returns: - The OpMode-derived class + The PeriodicOpMode-derived class Raises: FileNotFoundError: If the file doesn't exist ImportError: If the file can't be imported - ValueError: If no OpMode-derived class is found + ValueError: If no PeriodicOpMode-derived class is found """ file_path = Path(file_path) if not file_path.exists(): - raise FileNotFoundError(f"OpMode file not found: {file_path}") + raise FileNotFoundError(f"PeriodicOpMode file not found: {file_path}") if not file_path.suffix == '.py': raise ValueError(f"File must be a Python file (.py): {file_path}") @@ -68,10 +68,10 @@ def load_opmode_from_file(file_path): module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) - # Find the OpMode-derived class + # Find the PeriodicOpMode-derived class opmode_class = find_opmode_class(module) if opmode_class is None: - raise ValueError(f"No class derived from OpMode found in {file_path}") + raise ValueError(f"No class derived from PeriodicOpMode found in {file_path}") return opmode_class @@ -89,8 +89,8 @@ def run_opmode(opmode_file, duration=None, loop_frequency=50): try: # Load the opmode class - OpModeClass = load_opmode_from_file(opmode_file) - print(f"Found opmode class: {OpModeClass.__name__}") + PeriodicOpModeClass = load_opmode_from_file(opmode_file) + print(f"Found opmode class: {PeriodicOpModeClass.__name__}") # Create robot instance print("Creating robot instance...") @@ -98,11 +98,11 @@ def run_opmode(opmode_file, duration=None, loop_frequency=50): # Create opmode instance print("Initializing opmode...") - opmode = OpModeClass(robot) + opmode = PeriodicOpModeClass(robot) # Call start method print("Starting opmode...") - opmode.start() + opmode.Start() # Calculate loop timing loop_period = 1.0 / loop_frequency @@ -117,7 +117,7 @@ def run_opmode(opmode_file, duration=None, loop_frequency=50): loop_start = time.time() # Call the loop method - opmode.loop() + opmode.Periodic() loop_count += 1 # Check if we should stop based on duration @@ -139,7 +139,7 @@ def run_opmode(opmode_file, duration=None, loop_frequency=50): # Call stop method print("Stopping opmode...") - opmode.stop() + opmode.End() # Print statistics total_time = time.time() - start_time @@ -159,7 +159,7 @@ def run_opmode(opmode_file, duration=None, loop_frequency=50): def main(): """Main entry point.""" parser = argparse.ArgumentParser( - description="Run an opmode class derived from OpMode", + description="Run an opmode class derived from PeriodicOpMode", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: diff --git a/src/blocks/mrc_class_method_def.ts b/src/blocks/mrc_class_method_def.ts index d6c5225f..e34ab297 100644 --- a/src/blocks/mrc_class_method_def.ts +++ b/src/blocks/mrc_class_method_def.ts @@ -386,6 +386,30 @@ const CLASS_METHOD_DEF = { this.mrcReturnType = UNTYPED_RETURN_VALUE; } }, + upgrade_006_to_007: function(this: ClassMethodDefBlock) { + // This function is called to upgrade ClassMethodDefBlocks in an opmode module. + if (this.getFieldValue('NAME') === 'loop' && + !this.isOwnEditable() && + !this.mrcCanChangeSignature && + !this.mrcCanBeCalledWithinClass && + !this.mrcCanBeCalledOutsideClass && + this.mrcReturnType === 'None' && + this.mrcParameters.length === 0) { + this.setFieldValue('Periodic', FIELD_METHOD_NAME); + } + }, + upgrade_007_to_008: function(this: ClassMethodDefBlock) { + // This function is called to upgrade ClassMethodDefBlocks in a mechanism module. + if (this.getFieldValue('NAME') === 'update' && + !this.isOwnEditable() && + !this.mrcCanChangeSignature && + !this.mrcCanBeCalledWithinClass && + !this.mrcCanBeCalledOutsideClass && + this.mrcReturnType === 'None' && + this.mrcParameters.length === 0) { + this.setFieldValue('opmode_periodic', FIELD_METHOD_NAME); + } + }, }; export const setup = function () { @@ -625,3 +649,23 @@ export function upgrade_004_to_005(workspace: Blockly.Workspace): void { (block as ClassMethodDefBlock).upgrade_004_to_005(); }); } + +/** + * Upgrades the ClassMethodDefBlocks in the given workspace from version 006 to 007. + * This function should only be called when upgrading old projects. + */ +export function upgrade_006_to_007(workspace: Blockly.Workspace): void { + workspace.getBlocksByType(BLOCK_NAME).forEach(block => { + (block as ClassMethodDefBlock).upgrade_006_to_007(); + }); +} + +/** + * Upgrades the ClassMethodDefBlocks in the given workspace from version 007 to 008. + * This function should only be called when upgrading old projects. + */ +export function upgrade_007_to_008(workspace: Blockly.Workspace): void { + workspace.getBlocksByType(BLOCK_NAME).forEach(block => { + (block as ClassMethodDefBlock).upgrade_007_to_008(); + }); +} diff --git a/src/blocks/mrc_component.ts b/src/blocks/mrc_component.ts index 89b9e3bd..dafd286e 100644 --- a/src/blocks/mrc_component.ts +++ b/src/blocks/mrc_component.ts @@ -58,8 +58,7 @@ type ConstructorArg = { type ComponentExtraState = { componentId?: string, importModule?: string, - // If staticFunctionName is not present, generate the constructor. - staticFunctionName?: string, + tooltip?: string, params?: ConstructorArg[], /** * The module type. Note that this is only present when blocks are created for the toolbox. It is not @@ -73,7 +72,7 @@ interface ComponentMixin extends ComponentMixinType { mrcComponentId: string, mrcArgs: ConstructorArg[], mrcImportModule: string, - mrcStaticFunctionName: string, + mrcTooltip: string, /** * mrcHasNotInHolderWarning is set to true if we set the NOT_IN_HOLDER warning text on the block. @@ -93,6 +92,9 @@ const COMPONENT = { init: function (this: ComponentBlock): void { this.mrcHasNotInHolderWarning = false; this.setStyle(MRC_STYLE_COMPONENTS); + this.setTooltip(() => { + return this.mrcTooltip; + }); const nameField = new Blockly.FieldTextInput('') nameField.setValidator(this.mrcNameFieldValidator.bind(this, nameField)); this.appendDummyInput() @@ -123,8 +125,8 @@ const COMPONENT = { if (this.mrcImportModule) { extraState.importModule = this.mrcImportModule; } - if (this.mrcStaticFunctionName) { - extraState.staticFunctionName = this.mrcStaticFunctionName; + if (this.mrcTooltip) { + extraState.tooltip = this.mrcTooltip; } return extraState; }, @@ -134,7 +136,7 @@ const COMPONENT = { loadExtraState: function (this: ComponentBlock, extraState: ComponentExtraState): void { this.mrcComponentId = extraState.componentId ? extraState.componentId : this.id; this.mrcImportModule = extraState.importModule ? extraState.importModule : ''; - this.mrcStaticFunctionName = extraState.staticFunctionName ? extraState.staticFunctionName : ''; + this.mrcTooltip = extraState.tooltip ? extraState.tooltip : ''; this.mrcArgs = []; if (extraState.params) { @@ -328,8 +330,7 @@ function createComponentBlock( moduleType: storageModule.ModuleType): toolboxItems.Block { const extraState: ComponentExtraState = { importModule: classData.moduleName, - //TODO(ags): Remove this because we know what the constructor name is - staticFunctionName: constructorData.functionName, + tooltip: constructorData.tooltip, params: [], moduleType: moduleType, }; diff --git a/src/blocks/mrc_mechanism_component_holder.ts b/src/blocks/mrc_mechanism_component_holder.ts index 35ca635b..bc88f569 100644 --- a/src/blocks/mrc_mechanism_component_holder.ts +++ b/src/blocks/mrc_mechanism_component_holder.ts @@ -337,8 +337,11 @@ function pythonFromBlockInRobot(block: MechanismComponentHolderBlock, generator: const body = mechanisms + components; if (body) { code += body; - generator.addClassMethodDefinition('define_hardware', code); + } else { + code += generator.INDENT + 'pass\n'; } + + generator.addClassMethodDefinition('define_hardware', code); } function pythonFromBlockInMechanism(block: MechanismComponentHolderBlock, generator: ExtendedPythonGenerator) { diff --git a/src/blocks/mrc_opmode_details.ts b/src/blocks/mrc_opmode_details.ts index ab08ff83..43c4e754 100644 --- a/src/blocks/mrc_opmode_details.ts +++ b/src/blocks/mrc_opmode_details.ts @@ -68,6 +68,8 @@ const OPMODE_DETAILS = { }, ...NONCOPYABLE_BLOCK, checkOpMode(this: OpmodeDetailsBlock, editor: Editor): void { + // Check that a Steps block is in the workspace or the Periodic method is overridden. + // It's ok to have both. if (editor.isStepsInWorkspace() || editor.getMethodNamesAlreadyOverriddenInWorkspace().includes(PERIODIC_METHOD_NAME)) { // Remove the previous warning. diff --git a/src/blocks/utils/generated/external_samples_data.json b/src/blocks/utils/generated/external_samples_data.json index 7f589f1d..5230100a 100644 --- a/src/blocks/utils/generated/external_samples_data.json +++ b/src/blocks/utils/generated/external_samples_data.json @@ -27,7 +27,7 @@ "expectedPortType": "I2C_PORT", "functionName": "__init__", "returnType": "color_range_sensor.ColorRangeSensor", - "tooltip": "" + "tooltip": "REV Robotics Color Sensor v3. Part number REV-31-1557. https://www.revrobotics.com/rev-31-1557" } ], "enums": [], @@ -93,47 +93,8 @@ } ], "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "get_manufacturer", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "color_range_sensor.ColorRangeSensor" - } - ], - "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "get_name", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "color_range_sensor.ColorRangeSensor" - } - ], - "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "get_part_number", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "color_range_sensor.ColorRangeSensor" - } - ], - "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "get_url", - "returnType": "str", + "functionName": "opmode_end", + "returnType": "None", "tooltip": "" }, { @@ -145,8 +106,8 @@ } ], "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "get_version", - "returnType": "tuple[int, int, int]", + "functionName": "opmode_periodic", + "returnType": "None", "tooltip": "" }, { @@ -158,7 +119,7 @@ } ], "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "periodic", + "functionName": "opmode_start", "returnType": "None", "tooltip": "" }, @@ -240,58 +201,6 @@ "functionName": "register_when_saturation_in_range", "returnType": "None", "tooltip": "Event when saturation is in range" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "color_range_sensor.ColorRangeSensor" - } - ], - "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "reset", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "color_range_sensor.ColorRangeSensor" - } - ], - "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "color_range_sensor.ColorRangeSensor" - } - ], - "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "color_range_sensor.ColorRangeSensor" - } - ], - "declaringClassName": "color_range_sensor.ColorRangeSensor", - "functionName": "update", - "returnType": "None", - "tooltip": "" } ], "instanceVariables": [], @@ -355,72 +264,7 @@ } ], "declaringClassName": "component.Component", - "functionName": "get_manufacturer", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "component.Component" - } - ], - "declaringClassName": "component.Component", - "functionName": "get_name", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "component.Component" - } - ], - "declaringClassName": "component.Component", - "functionName": "get_part_number", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "component.Component" - } - ], - "declaringClassName": "component.Component", - "functionName": "get_url", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "component.Component" - } - ], - "declaringClassName": "component.Component", - "functionName": "get_version", - "returnType": "tuple[int, int, int]", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "component.Component" - } - ], - "declaringClassName": "component.Component", - "functionName": "periodic", + "functionName": "opmode_end", "returnType": "None", "tooltip": "" }, @@ -433,7 +277,7 @@ } ], "declaringClassName": "component.Component", - "functionName": "reset", + "functionName": "opmode_periodic", "returnType": "None", "tooltip": "" }, @@ -446,33 +290,7 @@ } ], "declaringClassName": "component.Component", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "component.Component" - } - ], - "declaringClassName": "component.Component", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "component.Component" - } - ], - "declaringClassName": "component.Component", - "functionName": "update", + "functionName": "opmode_start", "returnType": "None", "tooltip": "" } @@ -536,7 +354,7 @@ "expectedPortType": "EXPANSION_HUB_MOTOR", "functionName": "__init__", "returnType": "expansion_hub_motor.ExpansionHubMotor", - "tooltip": "" + "tooltip": "REV Robotics Expansion Hub Motor" } ], "enums": [], @@ -590,7 +408,7 @@ ], "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", "functionName": "getPositionPidConstants", - "returnType": "expansion_hub.ExpansionHubPidConstants", + "returnType": "wpilib_placeholders.ExpansionHubPidConstants", "tooltip": "" }, { @@ -603,7 +421,7 @@ ], "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", "functionName": "getVelocityPidConstants", - "returnType": "expansion_hub.ExpansionHubPidConstants", + "returnType": "wpilib_placeholders.ExpansionHubPidConstants", "tooltip": "" }, { @@ -628,60 +446,8 @@ } ], "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "get_manufacturer", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_motor.ExpansionHubMotor" - } - ], - "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "get_name", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_motor.ExpansionHubMotor" - } - ], - "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "get_part_number", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_motor.ExpansionHubMotor" - } - ], - "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "get_url", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_motor.ExpansionHubMotor" - } - ], - "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "get_version", - "returnType": "tuple[int, int, int]", + "functionName": "isHubConnected", + "returnType": "bool", "tooltip": "" }, { @@ -693,8 +459,8 @@ } ], "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "isHubConnected", - "returnType": "bool", + "functionName": "opmode_end", + "returnType": "None", "tooltip": "" }, { @@ -706,7 +472,7 @@ } ], "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "periodic", + "functionName": "opmode_periodic", "returnType": "None", "tooltip": "" }, @@ -719,7 +485,7 @@ } ], "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "reset", + "functionName": "opmode_start", "returnType": "None", "tooltip": "" }, @@ -879,45 +645,6 @@ "functionName": "setVoltage", "returnType": "None", "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_motor.ExpansionHubMotor" - } - ], - "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_motor.ExpansionHubMotor" - } - ], - "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_motor.ExpansionHubMotor" - } - ], - "declaringClassName": "expansion_hub_motor.ExpansionHubMotor", - "functionName": "update", - "returnType": "None", - "tooltip": "" } ], "instanceVariables": [], @@ -940,7 +667,7 @@ "expectedPortType": "EXPANSION_HUB_SERVO", "functionName": "__init__", "returnType": "expansion_hub_servo.ExpansionHubServo", - "tooltip": "" + "tooltip": "REV Robotics Expansion Hub Servo" } ], "enums": [], @@ -955,72 +682,7 @@ ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", "functionName": "get_connection_port_type", - "returnType": "list[port.PortType]", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_servo.ExpansionHubServo" - } - ], - "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "get_manufacturer", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_servo.ExpansionHubServo" - } - ], - "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "get_name", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_servo.ExpansionHubServo" - } - ], - "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "get_part_number", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_servo.ExpansionHubServo" - } - ], - "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "get_url", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_servo.ExpansionHubServo" - } - ], - "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "get_version", - "returnType": "tuple[int, int, int]", + "returnType": "port.PortType | None", "tooltip": "" }, { @@ -1045,7 +707,7 @@ } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "periodic", + "functionName": "opmode_end", "returnType": "None", "tooltip": "" }, @@ -1058,7 +720,7 @@ } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "reset", + "functionName": "opmode_periodic", "returnType": "None", "tooltip": "" }, @@ -1068,15 +730,10 @@ "defaultValue": "", "name": "self", "type": "expansion_hub_servo.ExpansionHubServo" - }, - { - "defaultValue": "", - "name": "value", - "type": "float" } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "set", + "functionName": "opmode_start", "returnType": "None", "tooltip": "" }, @@ -1089,48 +746,12 @@ }, { "defaultValue": "", - "name": "degrees", + "name": "value", "type": "float" } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "setAngle", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_servo.ExpansionHubServo" - }, - { - "defaultValue": "", - "name": "enabled", - "type": "bool" - } - ], - "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "setEnabled", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub_servo.ExpansionHubServo" - }, - { - "defaultValue": "", - "name": "framePeriod", - "type": "int" - } - ], - "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "setFramePeriod", + "functionName": "set", "returnType": "None", "tooltip": "" }, @@ -1143,12 +764,12 @@ }, { "defaultValue": "", - "name": "pulseWidth", - "type": "int" + "name": "degrees", + "type": "float" } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "setPulseWidth", + "functionName": "setAngle", "returnType": "None", "tooltip": "" }, @@ -1158,10 +779,15 @@ "defaultValue": "", "name": "self", "type": "expansion_hub_servo.ExpansionHubServo" + }, + { + "defaultValue": "", + "name": "enabled", + "type": "bool" } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "start", + "functionName": "setEnabled", "returnType": "None", "tooltip": "" }, @@ -1171,10 +797,15 @@ "defaultValue": "", "name": "self", "type": "expansion_hub_servo.ExpansionHubServo" + }, + { + "defaultValue": "", + "name": "framePeriod", + "type": "float" } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "stop", + "functionName": "setFramePeriod", "returnType": "None", "tooltip": "" }, @@ -1184,10 +815,15 @@ "defaultValue": "", "name": "self", "type": "expansion_hub_servo.ExpansionHubServo" + }, + { + "defaultValue": "", + "name": "pulseWidth", + "type": "int" } ], "declaringClassName": "expansion_hub_servo.ExpansionHubServo", - "functionName": "update", + "functionName": "setPulseWidth", "returnType": "None", "tooltip": "" } @@ -1380,7 +1016,7 @@ "expectedPortType": "SMART_IO_PORT", "functionName": "__init__", "returnType": "rev_touch_sensor.RevTouchSensor", - "tooltip": "" + "tooltip": "REV Robotics Touch Sensor. Part number REV-31-1425. https://www.revrobotics.com/rev-31-1425" } ], "enums": [], @@ -1407,22 +1043,9 @@ } ], "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "get_manufacturer", - "returnType": "str", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "rev_touch_sensor.RevTouchSensor" - } - ], - "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "get_name", - "returnType": "str", - "tooltip": "" + "functionName": "is_pressed", + "returnType": "bool", + "tooltip": "Returns if the touch sensor is pressed or not" }, { "args": [ @@ -1433,8 +1056,8 @@ } ], "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "get_part_number", - "returnType": "str", + "functionName": "opmode_end", + "returnType": "None", "tooltip": "" }, { @@ -1446,8 +1069,8 @@ } ], "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "get_url", - "returnType": "str", + "functionName": "opmode_periodic", + "returnType": "None", "tooltip": "" }, { @@ -1459,8 +1082,8 @@ } ], "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "get_version", - "returnType": "tuple[int, int, int]", + "functionName": "opmode_start", + "returnType": "None", "tooltip": "" }, { @@ -1472,20 +1095,7 @@ } ], "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "is_pressed", - "returnType": "bool", - "tooltip": "Returns if the touch sensor is pressed or not" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "rev_touch_sensor.RevTouchSensor" - } - ], - "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "periodic", + "functionName": "opmode_stop", "returnType": "None", "tooltip": "" }, @@ -1524,58 +1134,6 @@ "functionName": "register_when_released", "returnType": "None", "tooltip": "Event when touch sensor is released (after being pressed)" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "rev_touch_sensor.RevTouchSensor" - } - ], - "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "reset", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "rev_touch_sensor.RevTouchSensor" - } - ], - "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "rev_touch_sensor.RevTouchSensor" - } - ], - "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "rev_touch_sensor.RevTouchSensor" - } - ], - "declaringClassName": "rev_touch_sensor.RevTouchSensor", - "functionName": "update", - "returnType": "None", - "tooltip": "" } ], "instanceVariables": [], @@ -1716,7 +1274,7 @@ } ], "declaringClassName": "smart_motor.SmartMotor", - "functionName": "periodic", + "functionName": "opmode_end", "returnType": "None", "tooltip": "" }, @@ -1729,7 +1287,7 @@ } ], "declaringClassName": "smart_motor.SmartMotor", - "functionName": "reset", + "functionName": "opmode_periodic", "returnType": "None", "tooltip": "" }, @@ -1742,9 +1300,9 @@ } ], "declaringClassName": "smart_motor.SmartMotor", - "functionName": "reset_relative_encoder", + "functionName": "opmode_start", "returnType": "None", - "tooltip": "Reset the relative encoder value to 0" + "tooltip": "" }, { "args": [ @@ -1752,17 +1310,12 @@ "defaultValue": "", "name": "self", "type": "smart_motor.SmartMotor" - }, - { - "defaultValue": "", - "name": "angle", - "type": "float" } ], "declaringClassName": "smart_motor.SmartMotor", - "functionName": "set_angle_degrees", + "functionName": "reset_relative_encoder", "returnType": "None", - "tooltip": "Set the motor to an angle between 0 and 360" + "tooltip": "Reset the relative encoder value to 0" }, { "args": [ @@ -1773,27 +1326,14 @@ }, { "defaultValue": "", - "name": "speed", + "name": "angle", "type": "float" } ], "declaringClassName": "smart_motor.SmartMotor", - "functionName": "set_speed", - "returnType": "None", - "tooltip": "Set the motor to a speed between -1 and 1" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "smart_motor.SmartMotor" - } - ], - "declaringClassName": "smart_motor.SmartMotor", - "functionName": "start", + "functionName": "set_angle_degrees", "returnType": "None", - "tooltip": "" + "tooltip": "Set the motor to an angle between 0 and 360" }, { "args": [ @@ -1801,25 +1341,17 @@ "defaultValue": "", "name": "self", "type": "smart_motor.SmartMotor" - } - ], - "declaringClassName": "smart_motor.SmartMotor", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ + }, { "defaultValue": "", - "name": "self", - "type": "smart_motor.SmartMotor" + "name": "speed", + "type": "float" } ], "declaringClassName": "smart_motor.SmartMotor", - "functionName": "update", + "functionName": "set_speed", "returnType": "None", - "tooltip": "" + "tooltip": "Set the motor to a speed between -1 and 1" } ], "instanceVariables": [], @@ -2131,7 +1663,7 @@ } ], "declaringClassName": "spark_mini.SparkMini", - "functionName": "periodic", + "functionName": "opmode_end", "returnType": "None", "tooltip": "" }, @@ -2144,7 +1676,20 @@ } ], "declaringClassName": "spark_mini.SparkMini", - "functionName": "reset", + "functionName": "opmode_periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "spark_mini.SparkMini" + } + ], + "declaringClassName": "spark_mini.SparkMini", + "functionName": "opmode_start", "returnType": "None", "tooltip": "" }, @@ -2238,32 +1783,6 @@ "returnType": "None", "tooltip": "Sets the voltage output of the PWMMotorController. Compensates for\nthe current bus voltage to ensure that the desired voltage is output even\nif the battery voltage is below 12V - highly useful when the voltage\noutputs are \"meaningful\" (e.g. they come from a feedforward calculation).\n\nNOTE: This function *must* be called regularly in order for voltage\ncompensation to work properly - unlike the ordinary set function, it is not\n\"set it and forget it.\"\n\n:param output: The voltage to output." }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "spark_mini.SparkMini" - } - ], - "declaringClassName": "spark_mini.SparkMini", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "spark_mini.SparkMini" - } - ], - "declaringClassName": "spark_mini.SparkMini", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, { "args": [ { @@ -2276,19 +1795,6 @@ "functionName": "stop_motor", "returnType": "None", "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "spark_mini.SparkMini" - } - ], - "declaringClassName": "spark_mini.SparkMini", - "functionName": "update", - "returnType": "None", - "tooltip": "" } ], "instanceVariables": [], @@ -2411,7 +1917,7 @@ } ], "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", - "functionName": "periodic", + "functionName": "opmode_end", "returnType": "None", "tooltip": "" }, @@ -2424,7 +1930,20 @@ } ], "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", - "functionName": "reset", + "functionName": "opmode_periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "opmode_start", "returnType": "None", "tooltip": "" }, @@ -2482,32 +2001,6 @@ "returnType": "None", "tooltip": "Change the color of all LEDs using a list." }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "sparkfun_led_stick.SparkFunLEDStick" - } - ], - "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "sparkfun_led_stick.SparkFunLEDStick" - } - ], - "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, { "args": [ { @@ -2520,19 +2013,6 @@ "functionName": "turn_all_off", "returnType": "None", "tooltip": "Turn all LEDs off." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "sparkfun_led_stick.SparkFunLEDStick" - } - ], - "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", - "functionName": "update", - "returnType": "None", - "tooltip": "" } ], "instanceVariables": [], diff --git a/src/blocks/utils/generated/robotpy_data.json b/src/blocks/utils/generated/robotpy_data.json index 733c6bc5..8306fd98 100644 --- a/src/blocks/utils/generated/robotpy_data.json +++ b/src/blocks/utils/generated/robotpy_data.json @@ -304,21 +304,38 @@ }, "classes": [ { - "className": "expansion_hub.ExpansionHub", - "classVariables": [], + "className": "wpilib.ADXL345_I2C", + "classVariables": [ + { + "name": "kAddress", + "tooltip": "", + "type": "int", + "writable": false + } + ], "constructors": [ { "args": [ { "defaultValue": "", - "name": "hubNumber", - "type": "int" + "name": "port", + "type": "wpilib.I2C.Port" + }, + { + "defaultValue": "", + "name": "range", + "type": "wpilib.ADXL345_I2C.Range" + }, + { + "defaultValue": "29", + "name": "deviceAddress", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHub", + "declaringClassName": "wpilib.ADXL345_I2C", "functionName": "__init__", - "returnType": "expansion_hub.ExpansionHub", - "tooltip": "" + "returnType": "wpilib.ADXL345_I2C", + "tooltip": "Constructs the ADXL345 Accelerometer over I2C.\n\n:param port: The I2C port the accelerometer is attached to\n:param range: The range (+ or -) that the accelerometer will measure\n:param deviceAddress: The I2C address of the accelerometer (0x1D or 0x53)" } ], "enums": [], @@ -328,48 +345,43 @@ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHub" + "type": "wpilib.ADXL345_I2C" + }, + { + "defaultValue": "", + "name": "axis", + "type": "wpilib.ADXL345_I2C.Axes" } ], - "declaringClassName": "expansion_hub.ExpansionHub", - "functionName": "getBatteryVoltage", + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "getAcceleration", "returnType": "float", - "tooltip": "" + "tooltip": "Get the acceleration of one axis in Gs.\n\n:param axis: The axis to read from.\n\n:returns: Acceleration of the ADXL345 in Gs." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHub" - }, - { - "defaultValue": "", - "name": "motorNumber", - "type": "int" + "type": "wpilib.ADXL345_I2C" } ], - "declaringClassName": "expansion_hub.ExpansionHub", - "functionName": "getMotor", - "returnType": "expansion_hub.ExpansionHubMotor", - "tooltip": "" + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "getAccelerations", + "returnType": "wpilib.ADXL345_I2C.AllAxes", + "tooltip": "Get the acceleration of all axes in Gs.\n\n:returns: An object containing the acceleration measured on each axis of the\n ADXL345 in Gs." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHub" - }, - { - "defaultValue": "", - "name": "servoNumber", - "type": "int" + "type": "wpilib.ADXL345_I2C" } ], - "declaringClassName": "expansion_hub.ExpansionHub", - "functionName": "getServo", - "returnType": "expansion_hub.ExpansionHubServo", + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "getI2CDeviceAddress", + "returnType": "int", "tooltip": "" }, { @@ -377,81 +389,69 @@ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHub" + "type": "wpilib.ADXL345_I2C" } ], - "declaringClassName": "expansion_hub.ExpansionHub", - "functionName": "isConnected", - "returnType": "bool", + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "getI2CPort", + "returnType": "wpilib.I2C.Port", "tooltip": "" - } - ], - "instanceVariables": [], - "moduleName": "expansion_hub", - "staticMethods": [] - }, - { - "className": "expansion_hub.ExpansionHubMotor", - "classVariables": [], - "constructors": [ + }, { "args": [ { "defaultValue": "", - "name": "hubNumber", - "type": "int" - }, - { - "defaultValue": "", - "name": "motorNumber", - "type": "int" + "name": "self", + "type": "wpilib.ADXL345_I2C" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "__init__", - "returnType": "expansion_hub.ExpansionHubMotor", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [ + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "getX", + "returnType": "float", + "tooltip": "Returns the acceleration along the X axis in g-forces.\n\n:returns: The acceleration along the X axis in g-forces." + }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.ADXL345_I2C" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "getCurrent", + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "getY", "returnType": "float", - "tooltip": "" + "tooltip": "Returns the acceleration along the Y axis in g-forces.\n\n:returns: The acceleration along the Y axis in g-forces." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.ADXL345_I2C" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "getEncoder", + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "getZ", "returnType": "float", - "tooltip": "" + "tooltip": "Returns the acceleration along the Z axis in g-forces.\n\n:returns: The acceleration along the Z axis in g-forces." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.ADXL345_I2C" + }, + { + "defaultValue": "", + "name": "builder", + "type": "ntcore.NTSendableBuilder" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "getEncoderVelocity", - "returnType": "float", + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "initSendable", + "returnType": "None", "tooltip": "" }, { @@ -459,227 +459,432 @@ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.ADXL345_I2C" + }, + { + "defaultValue": "", + "name": "range", + "type": "wpilib.ADXL345_I2C.Range" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "getPositionPidConstants", - "returnType": "expansion_hub.ExpansionHubPidConstants", + "declaringClassName": "wpilib.ADXL345_I2C", + "functionName": "setRange", + "returnType": "None", + "tooltip": "Set the measuring range of the accelerometer.\n\n:param range: The maximum acceleration, positive or negative, that the\n accelerometer will measure." + } + ], + "instanceVariables": [], + "moduleName": "wpilib", + "staticMethods": [] + }, + { + "className": "wpilib.ADXL345_I2C.AllAxes", + "classVariables": [], + "constructors": [ + { + "args": [], + "declaringClassName": "wpilib.ADXL345_I2C.AllAxes", + "functionName": "__init__", + "returnType": "wpilib.ADXL345_I2C.AllAxes", "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [], + "instanceVariables": [ + { + "name": "XAxis", + "tooltip": "Acceleration along the X axis in g-forces.", + "type": "float", + "writable": true + }, + { + "name": "YAxis", + "tooltip": "Acceleration along the Y axis in g-forces.", + "type": "float", + "writable": true + }, + { + "name": "ZAxis", + "tooltip": "Acceleration along the Z axis in g-forces.", + "type": "float", + "writable": true + } + ], + "moduleName": "wpilib", + "staticMethods": [] + }, + { + "className": "wpilib.ADXL345_I2C.Axes", + "classVariables": [ + { + "name": "kAxis_X", + "tooltip": "", + "type": "wpilib.ADXL345_I2C.Axes", + "writable": false + }, + { + "name": "kAxis_Y", + "tooltip": "", + "type": "wpilib.ADXL345_I2C.Axes", + "writable": false }, + { + "name": "kAxis_Z", + "tooltip": "", + "type": "wpilib.ADXL345_I2C.Axes", + "writable": false + } + ], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "name": "value", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "getVelocityPidConstants", - "returnType": "expansion_hub.ExpansionHubPidConstants", + "declaringClassName": "wpilib.ADXL345_I2C.Axes", + "functionName": "__init__", + "returnType": "wpilib.ADXL345_I2C.Axes", "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [], + "instanceVariables": [ + { + "name": "name", + "tooltip": "name(self: object, /) -> str\n", + "type": "str", + "writable": false + }, + { + "name": "value", + "tooltip": "", + "type": "int", + "writable": false + } + ], + "moduleName": "wpilib", + "staticMethods": [] + }, + { + "className": "wpilib.ADXL345_I2C.Range", + "classVariables": [ + { + "name": "kRange_16G", + "tooltip": "", + "type": "wpilib.ADXL345_I2C.Range", + "writable": false + }, + { + "name": "kRange_2G", + "tooltip": "", + "type": "wpilib.ADXL345_I2C.Range", + "writable": false + }, + { + "name": "kRange_4G", + "tooltip": "", + "type": "wpilib.ADXL345_I2C.Range", + "writable": false }, + { + "name": "kRange_8G", + "tooltip": "", + "type": "wpilib.ADXL345_I2C.Range", + "writable": false + } + ], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "name": "value", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "isHubConnected", - "returnType": "bool", + "declaringClassName": "wpilib.ADXL345_I2C.Range", + "functionName": "__init__", + "returnType": "wpilib.ADXL345_I2C.Range", "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [], + "instanceVariables": [ + { + "name": "name", + "tooltip": "name(self: object, /) -> str\n", + "type": "str", + "writable": false }, + { + "name": "value", + "tooltip": "", + "type": "int", + "writable": false + } + ], + "moduleName": "wpilib", + "staticMethods": [] + }, + { + "className": "wpilib.AddressableLED", + "classVariables": [], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "name": "channel", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "resetEncoder", - "returnType": "None", - "tooltip": "" - }, + "declaringClassName": "wpilib.AddressableLED", + "functionName": "__init__", + "returnType": "wpilib.AddressableLED", + "tooltip": "Constructs a new driver for a specific channel.\n\n:param channel: the output channel to use" + } + ], + "enums": [], + "instanceMethods": [ { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" - }, - { - "defaultValue": "", - "name": "perCount", - "type": "float" + "type": "wpilib.AddressableLED" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setDistancePerCount", - "returnType": "None", - "tooltip": "" + "declaringClassName": "wpilib.AddressableLED", + "functionName": "getChannel", + "returnType": "int", + "tooltip": "Gets the channel for this addressable LED.\n\n:returns: channel" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" - }, - { - "defaultValue": "", - "name": "enabled", - "type": "bool" + "type": "wpilib.AddressableLED" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setEnabled", - "returnType": "None", - "tooltip": "" + "declaringClassName": "wpilib.AddressableLED", + "functionName": "getStart", + "returnType": "int", + "tooltip": "Gets the display start of the LED strip in the global buffer.\n\n:returns: the strip start, in LEDs" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.AddressableLED" }, { "defaultValue": "", - "name": "floatOn0", - "type": "bool" + "name": "order", + "type": "wpilib.AddressableLED.ColorOrder" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setFloatOn0", + "declaringClassName": "wpilib.AddressableLED", + "functionName": "setColorOrder", "returnType": "None", - "tooltip": "" + "tooltip": "Sets the color order for this AddressableLED. The default order is GRB.\n\nThis will take effect on the next call to SetData().\n\n:param order: the color order" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.AddressableLED" }, { "defaultValue": "", - "name": "power", - "type": "float" + "name": "ledData", + "type": "List[wpilib.AddressableLED.LEDData]" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setPercentagePower", + "declaringClassName": "wpilib.AddressableLED", + "functionName": "setData", "returnType": "None", - "tooltip": "" + "tooltip": "Sets the LED output data. This will write to the global buffer starting at\nthe location set by SetStart() and up to the length set by SetLength().\n\n:param ledData: the buffer to write" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.AddressableLED" }, { "defaultValue": "", - "name": "setpoint", - "type": "float" + "name": "length", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setPositionSetpoint", + "declaringClassName": "wpilib.AddressableLED", + "functionName": "setLength", "returnType": "None", - "tooltip": "" + "tooltip": "Sets the length of the LED strip.\n\n:param length: the strip length, in LEDs" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "type": "wpilib.AddressableLED" }, { "defaultValue": "", - "name": "reversed", - "type": "bool" + "name": "start", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setReversed", + "declaringClassName": "wpilib.AddressableLED", + "functionName": "setStart", "returnType": "None", - "tooltip": "" - }, + "tooltip": "Sets the display start of the LED strip in the global buffer.\n\n:param start: the strip start, in LEDs" + } + ], + "instanceVariables": [], + "moduleName": "wpilib", + "staticMethods": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubMotor" + "name": "start", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "setpoint", - "type": "float" + "name": "colorOrder", + "type": "wpilib.AddressableLED.ColorOrder" + }, + { + "defaultValue": "", + "name": "ledData", + "type": "List[wpilib.AddressableLED.LEDData]" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setVelocitySetpoint", + "declaringClassName": "wpilib.AddressableLED", + "functionName": "setGlobalData", "returnType": "None", - "tooltip": "" + "tooltip": "Sets the LED output data at an arbitrary location in the global buffer.\n\n:param start: the start location, in LEDs\n:param colorOrder: the color order\n:param ledData: the buffer to write" + } + ] + }, + { + "className": "wpilib.AddressableLED.ColorOrder", + "classVariables": [ + { + "name": "kBGR", + "tooltip": "", + "type": "wpilib.AddressableLED.ColorOrder", + "writable": false + }, + { + "name": "kBRG", + "tooltip": "", + "type": "wpilib.AddressableLED.ColorOrder", + "writable": false + }, + { + "name": "kGBR", + "tooltip": "", + "type": "wpilib.AddressableLED.ColorOrder", + "writable": false + }, + { + "name": "kGRB", + "tooltip": "", + "type": "wpilib.AddressableLED.ColorOrder", + "writable": false + }, + { + "name": "kRBG", + "tooltip": "", + "type": "wpilib.AddressableLED.ColorOrder", + "writable": false }, + { + "name": "kRGB", + "tooltip": "", + "type": "wpilib.AddressableLED.ColorOrder", + "writable": false + } + ], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubMotor" - }, - { - "defaultValue": "", - "name": "voltage", - "type": "float" + "name": "value", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubMotor", - "functionName": "setVoltage", - "returnType": "None", + "declaringClassName": "wpilib.AddressableLED.ColorOrder", + "functionName": "__init__", + "returnType": "wpilib.AddressableLED.ColorOrder", "tooltip": "" } ], - "instanceVariables": [], - "moduleName": "expansion_hub", + "enums": [], + "instanceMethods": [], + "instanceVariables": [ + { + "name": "name", + "tooltip": "name(self: object, /) -> str\n", + "type": "str", + "writable": false + }, + { + "name": "value", + "tooltip": "", + "type": "int", + "writable": false + } + ], + "moduleName": "wpilib", "staticMethods": [] }, { - "className": "expansion_hub.ExpansionHubPidConstants", + "className": "wpilib.AddressableLED.LEDData", "classVariables": [], "constructors": [ + { + "args": [], + "declaringClassName": "wpilib.AddressableLED.LEDData", + "functionName": "__init__", + "returnType": "wpilib.AddressableLED.LEDData", + "tooltip": "" + }, { "args": [ { "defaultValue": "", - "name": "hubNumber", - "type": "int" + "name": "r", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "motorNumber", - "type": "int" + "name": "g", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "isVelocityPid", - "type": "bool" + "name": "b", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubPidConstants", + "declaringClassName": "wpilib.AddressableLED.LEDData", "functionName": "__init__", - "returnType": "expansion_hub.ExpansionHubPidConstants", + "returnType": "wpilib.AddressableLED.LEDData", "tooltip": "" } ], @@ -690,62 +895,44 @@ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubPidConstants" - } - ], - "declaringClassName": "expansion_hub.ExpansionHubPidConstants", - "functionName": "disableContinousInput", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ + "type": "wpilib.AddressableLED.LEDData" + }, { "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubPidConstants" + "name": "h", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "minimum", - "type": "float" + "name": "s", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "maximum", - "type": "float" + "name": "v", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubPidConstants", - "functionName": "enableContinousInput", + "declaringClassName": "wpilib.AddressableLED.LEDData", + "functionName": "setHSV", "returnType": "None", - "tooltip": "" + "tooltip": "A helper method to set all values of the LED.\n\n:param h: the h value [0-180]\n:param s: the s value [0-255]\n:param v: the v value [0-255]" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubPidConstants" + "type": "wpilib.AddressableLED.LEDData" }, { "defaultValue": "", - "name": "s", - "type": "float" - }, - { - "defaultValue": "", - "name": "v", - "type": "float" - }, - { - "defaultValue": "", - "name": "a", - "type": "float" + "name": "color", + "type": "wpilib.Color" } ], - "declaringClassName": "expansion_hub.ExpansionHubPidConstants", - "functionName": "setFF", + "declaringClassName": "wpilib.AddressableLED.LEDData", + "functionName": "setLED", "returnType": "None", "tooltip": "" }, @@ -754,335 +941,206 @@ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubPidConstants" - }, - { - "defaultValue": "", - "name": "p", - "type": "float" - }, - { - "defaultValue": "", - "name": "i", - "type": "float" + "type": "wpilib.AddressableLED.LEDData" }, { "defaultValue": "", - "name": "d", - "type": "float" + "name": "color", + "type": "wpilib.Color8Bit" } ], - "declaringClassName": "expansion_hub.ExpansionHubPidConstants", - "functionName": "setPID", + "declaringClassName": "wpilib.AddressableLED.LEDData", + "functionName": "setLED", "returnType": "None", "tooltip": "" - } - ], - "instanceVariables": [], - "moduleName": "expansion_hub", - "staticMethods": [] - }, - { - "className": "expansion_hub.ExpansionHubServo", - "classVariables": [], - "constructors": [ - { - "args": [ - { - "defaultValue": "", - "name": "hubNumber", - "type": "int" - }, - { - "defaultValue": "", - "name": "servoNumber", - "type": "int" - } - ], - "declaringClassName": "expansion_hub.ExpansionHubServo", - "functionName": "__init__", - "returnType": "expansion_hub.ExpansionHubServo", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [ - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubServo" - } - ], - "declaringClassName": "expansion_hub.ExpansionHubServo", - "functionName": "isHubConnected", - "returnType": "bool", - "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "expansion_hub.ExpansionHubServo" + "type": "wpilib.AddressableLED.LEDData" }, { "defaultValue": "", - "name": "value", - "type": "float" - } - ], - "declaringClassName": "expansion_hub.ExpansionHubServo", - "functionName": "set", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubServo" + "name": "r", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "degrees", - "type": "float" - } - ], - "declaringClassName": "expansion_hub.ExpansionHubServo", - "functionName": "setAngle", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubServo" + "name": "g", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "enabled", - "type": "bool" + "name": "b", + "type": "typing.SupportsInt" } ], - "declaringClassName": "expansion_hub.ExpansionHubServo", - "functionName": "setEnabled", + "declaringClassName": "wpilib.AddressableLED.LEDData", + "functionName": "setRGB", "returnType": "None", - "tooltip": "" + "tooltip": "A helper method to set all values of the LED.\n\n:param r: the r value [0-255]\n:param g: the g value [0-255]\n:param b: the b value [0-255]" + } + ], + "instanceVariables": [ + { + "name": "b", + "tooltip": "///< blue value", + "type": "int", + "writable": true }, { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubServo" - }, - { - "defaultValue": "", - "name": "framePeriod", - "type": "int" - } - ], - "declaringClassName": "expansion_hub.ExpansionHubServo", - "functionName": "setFramePeriod", - "returnType": "None", - "tooltip": "" + "name": "g", + "tooltip": "///< green value", + "type": "int", + "writable": true }, { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "expansion_hub.ExpansionHubServo" - }, - { - "defaultValue": "", - "name": "pulseWidth", - "type": "int" - } - ], - "declaringClassName": "expansion_hub.ExpansionHubServo", - "functionName": "setPulseWidth", - "returnType": "None", - "tooltip": "" + "name": "r", + "tooltip": "///< red value", + "type": "int", + "writable": true } ], - "instanceVariables": [], - "moduleName": "expansion_hub", + "moduleName": "wpilib", "staticMethods": [] }, { - "className": "wpilib.ADXL345_I2C", - "classVariables": [ - { - "name": "kAddress", - "tooltip": "", - "type": "int", - "writable": false - } - ], + "className": "wpilib.Alert", + "classVariables": [], "constructors": [ { "args": [ { "defaultValue": "", - "name": "port", - "type": "wpilib.I2C.Port" - }, - { - "defaultValue": "", - "name": "range", - "type": "wpilib.ADXL345_I2C.Range" + "name": "text", + "type": "str" }, { - "defaultValue": "29", - "name": "deviceAddress", - "type": "typing.SupportsInt" + "defaultValue": "", + "name": "type", + "type": "wpilib.Alert.AlertType" } ], - "declaringClassName": "wpilib.ADXL345_I2C", + "declaringClassName": "wpilib.Alert", "functionName": "__init__", - "returnType": "wpilib.ADXL345_I2C", - "tooltip": "Constructs the ADXL345 Accelerometer over I2C.\n\n:param port: The I2C port the accelerometer is attached to\n:param range: The range (+ or -) that the accelerometer will measure\n:param deviceAddress: The I2C address of the accelerometer (0x1D or 0x53)" - } - ], - "enums": [], - "instanceMethods": [ + "returnType": "wpilib.Alert", + "tooltip": "Creates a new alert in the default group - \"Alerts\". If this is the first\nto be instantiated, the appropriate entries will be added to NetworkTables.\n\n:param text: Text to be displayed when the alert is active.\n:param type: Alert urgency level." + }, { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.ADXL345_I2C" + "name": "group", + "type": "str" }, { "defaultValue": "", - "name": "axis", - "type": "wpilib.ADXL345_I2C.Axes" - } - ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "getAcceleration", - "returnType": "float", - "tooltip": "Get the acceleration of one axis in Gs.\n\n:param axis: The axis to read from.\n\n:returns: Acceleration of the ADXL345 in Gs." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.ADXL345_I2C" - } - ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "getAccelerations", - "returnType": "wpilib.ADXL345_I2C.AllAxes", - "tooltip": "Get the acceleration of all axes in Gs.\n\n:returns: An object containing the acceleration measured on each axis of the\n ADXL345 in Gs." - }, - { - "args": [ + "name": "text", + "type": "str" + }, { "defaultValue": "", - "name": "self", - "type": "wpilib.ADXL345_I2C" + "name": "type", + "type": "wpilib.Alert.AlertType" } ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "getI2CDeviceAddress", - "returnType": "int", - "tooltip": "" - }, + "declaringClassName": "wpilib.Alert", + "functionName": "__init__", + "returnType": "wpilib.Alert", + "tooltip": "Creates a new alert. If this is the first to be instantiated in its group,\nthe appropriate entries will be added to NetworkTables.\n\n:param group: Group identifier, used as the entry name in NetworkTables.\n:param text: Text to be displayed when the alert is active.\n:param type: Alert urgency level." + } + ], + "enums": [], + "instanceMethods": [ { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.ADXL345_I2C" + "type": "wpilib.Alert" } ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "getI2CPort", - "returnType": "wpilib.I2C.Port", - "tooltip": "" + "declaringClassName": "wpilib.Alert", + "functionName": "close", + "returnType": "None", + "tooltip": "Disables the alert" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.ADXL345_I2C" + "type": "wpilib.Alert" } ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "getX", - "returnType": "float", - "tooltip": "Returns the acceleration along the X axis in g-forces.\n\n:returns: The acceleration along the X axis in g-forces." + "declaringClassName": "wpilib.Alert", + "functionName": "get", + "returnType": "bool", + "tooltip": "Gets whether the alert is active.\n\n:returns: whether the alert is active." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.ADXL345_I2C" + "type": "wpilib.Alert" } ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "getY", - "returnType": "float", - "tooltip": "Returns the acceleration along the Y axis in g-forces.\n\n:returns: The acceleration along the Y axis in g-forces." + "declaringClassName": "wpilib.Alert", + "functionName": "getText", + "returnType": "str", + "tooltip": "Gets the current alert text.\n\n:returns: the current text." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.ADXL345_I2C" + "type": "wpilib.Alert" } ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "getZ", - "returnType": "float", - "tooltip": "Returns the acceleration along the Z axis in g-forces.\n\n:returns: The acceleration along the Z axis in g-forces." + "declaringClassName": "wpilib.Alert", + "functionName": "getType", + "returnType": "wpilib.Alert.AlertType", + "tooltip": "Get the type of this alert.\n\n:returns: the type" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.ADXL345_I2C" + "type": "wpilib.Alert" }, { "defaultValue": "", - "name": "builder", - "type": "ntcore.NTSendableBuilder" + "name": "active", + "type": "bool" } ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "initSendable", + "declaringClassName": "wpilib.Alert", + "functionName": "set", "returnType": "None", - "tooltip": "" + "tooltip": "Sets whether the alert should currently be displayed. This method can be\nsafely called periodically.\n\n:param active: Whether to display the alert." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.ADXL345_I2C" + "type": "wpilib.Alert" }, { "defaultValue": "", - "name": "range", - "type": "wpilib.ADXL345_I2C.Range" + "name": "text", + "type": "str" } ], - "declaringClassName": "wpilib.ADXL345_I2C", - "functionName": "setRange", + "declaringClassName": "wpilib.Alert", + "functionName": "setText", "returnType": "None", - "tooltip": "Set the measuring range of the accelerometer.\n\n:param range: The maximum acceleration, positive or negative, that the\n accelerometer will measure." + "tooltip": "Updates current alert text. Use this method to dynamically change the\ndisplayed alert, such as including more details about the detected problem.\n\n:param text: Text to be displayed when the alert is active." } ], "instanceVariables": [], @@ -1090,61 +1148,24 @@ "staticMethods": [] }, { - "className": "wpilib.ADXL345_I2C.AllAxes", - "classVariables": [], - "constructors": [ - { - "args": [], - "declaringClassName": "wpilib.ADXL345_I2C.AllAxes", - "functionName": "__init__", - "returnType": "wpilib.ADXL345_I2C.AllAxes", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [], - "instanceVariables": [ - { - "name": "XAxis", - "tooltip": "Acceleration along the X axis in g-forces.", - "type": "float", - "writable": true - }, - { - "name": "YAxis", - "tooltip": "Acceleration along the Y axis in g-forces.", - "type": "float", - "writable": true - }, - { - "name": "ZAxis", - "tooltip": "Acceleration along the Z axis in g-forces.", - "type": "float", - "writable": true - } - ], - "moduleName": "wpilib", - "staticMethods": [] - }, - { - "className": "wpilib.ADXL345_I2C.Axes", + "className": "wpilib.Alert.AlertType", "classVariables": [ { - "name": "kAxis_X", + "name": "kError", "tooltip": "", - "type": "wpilib.ADXL345_I2C.Axes", + "type": "wpilib.Alert.AlertType", "writable": false }, { - "name": "kAxis_Y", + "name": "kInfo", "tooltip": "", - "type": "wpilib.ADXL345_I2C.Axes", + "type": "wpilib.Alert.AlertType", "writable": false }, { - "name": "kAxis_Z", + "name": "kWarning", "tooltip": "", - "type": "wpilib.ADXL345_I2C.Axes", + "type": "wpilib.Alert.AlertType", "writable": false } ], @@ -1157,9 +1178,9 @@ "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.ADXL345_I2C.Axes", + "declaringClassName": "wpilib.Alert.AlertType", "functionName": "__init__", - "returnType": "wpilib.ADXL345_I2C.Axes", + "returnType": "wpilib.Alert.AlertType", "tooltip": "" } ], @@ -1183,83 +1204,34 @@ "staticMethods": [] }, { - "className": "wpilib.ADXL345_I2C.Range", - "classVariables": [ - { - "name": "kRange_16G", - "tooltip": "", - "type": "wpilib.ADXL345_I2C.Range", - "writable": false - }, - { - "name": "kRange_2G", - "tooltip": "", - "type": "wpilib.ADXL345_I2C.Range", - "writable": false - }, - { - "name": "kRange_4G", - "tooltip": "", - "type": "wpilib.ADXL345_I2C.Range", - "writable": false - }, - { - "name": "kRange_8G", - "tooltip": "", - "type": "wpilib.ADXL345_I2C.Range", - "writable": false - } - ], + "className": "wpilib.AnalogAccelerometer", + "classVariables": [], "constructors": [ { "args": [ { "defaultValue": "", - "name": "value", + "name": "channel", "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.ADXL345_I2C.Range", + "declaringClassName": "wpilib.AnalogAccelerometer", "functionName": "__init__", - "returnType": "wpilib.ADXL345_I2C.Range", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [], - "instanceVariables": [ - { - "name": "name", - "tooltip": "name(self: object, /) -> str\n", - "type": "str", - "writable": false + "returnType": "wpilib.AnalogAccelerometer", + "tooltip": "Create a new instance of an accelerometer.\n\nThe constructor allocates desired analog input.\n\n:param channel: The channel number for the analog input the accelerometer is\n connected to" }, - { - "name": "value", - "tooltip": "", - "type": "int", - "writable": false - } - ], - "moduleName": "wpilib", - "staticMethods": [] - }, - { - "className": "wpilib.AddressableLED", - "classVariables": [], - "constructors": [ { "args": [ { "defaultValue": "", "name": "channel", - "type": "typing.SupportsInt" + "type": "wpilib.AnalogInput" } ], - "declaringClassName": "wpilib.AddressableLED", + "declaringClassName": "wpilib.AnalogAccelerometer", "functionName": "__init__", - "returnType": "wpilib.AddressableLED", - "tooltip": "Constructs a new driver for a specific channel.\n\n:param channel: the output channel to use" + "returnType": "wpilib.AnalogAccelerometer", + "tooltip": "Create a new instance of Accelerometer from an existing AnalogInput.\n\nMake a new instance of accelerometer given an AnalogInput. This is\nparticularly useful if the port is going to be read as an analog channel as\nwell as through the Accelerometer class.\n\n:param channel: The existing AnalogInput object for the analog input the\n accelerometer is connected to" } ], "enums": [], @@ -1269,235 +1241,148 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED" + "type": "wpilib.AnalogAccelerometer" } ], - "declaringClassName": "wpilib.AddressableLED", - "functionName": "getChannel", - "returnType": "int", - "tooltip": "Gets the channel for this addressable LED.\n\n:returns: channel" + "declaringClassName": "wpilib.AnalogAccelerometer", + "functionName": "getAcceleration", + "returnType": "float", + "tooltip": "Return the acceleration in Gs.\n\nThe acceleration is returned units of Gs.\n\n:returns: The current acceleration of the sensor in Gs." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED" + "type": "wpilib.AnalogAccelerometer" + }, + { + "defaultValue": "", + "name": "builder", + "type": "wpiutil.SendableBuilder" } ], - "declaringClassName": "wpilib.AddressableLED", - "functionName": "getStart", - "returnType": "int", - "tooltip": "Gets the display start of the LED strip in the global buffer.\n\n:returns: the strip start, in LEDs" + "declaringClassName": "wpilib.AnalogAccelerometer", + "functionName": "initSendable", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED" + "type": "wpilib.AnalogAccelerometer" }, { "defaultValue": "", - "name": "order", - "type": "wpilib.AddressableLED.ColorOrder" + "name": "sensitivity", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.AddressableLED", - "functionName": "setColorOrder", + "declaringClassName": "wpilib.AnalogAccelerometer", + "functionName": "setSensitivity", "returnType": "None", - "tooltip": "Sets the color order for this AddressableLED. The default order is GRB.\n\nThis will take effect on the next call to SetData().\n\n:param order: the color order" + "tooltip": "Set the accelerometer sensitivity.\n\nThis sets the sensitivity of the accelerometer used for calculating the\nacceleration. The sensitivity varies by accelerometer model.\n\n:param sensitivity: The sensitivity of accelerometer in Volts per G." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED" + "type": "wpilib.AnalogAccelerometer" }, { "defaultValue": "", - "name": "ledData", - "type": "List[wpilib.AddressableLED.LEDData]" + "name": "zero", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.AddressableLED", - "functionName": "setData", + "declaringClassName": "wpilib.AnalogAccelerometer", + "functionName": "setZero", "returnType": "None", - "tooltip": "Sets the LED output data. This will write to the global buffer starting at\nthe location set by SetStart() and up to the length set by SetLength().\n\n:param ledData: the buffer to write" - }, + "tooltip": "Set the voltage that corresponds to 0 G.\n\nThe zero G voltage varies by accelerometer model.\n\n:param zero: The zero G voltage." + } + ], + "instanceVariables": [], + "moduleName": "wpilib", + "staticMethods": [] + }, + { + "className": "wpilib.AnalogEncoder", + "classVariables": [], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.AddressableLED" - }, - { - "defaultValue": "", - "name": "length", + "name": "channel", "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.AddressableLED", - "functionName": "setLength", - "returnType": "None", - "tooltip": "Sets the length of the LED strip.\n\n:param length: the strip length, in LEDs" + "declaringClassName": "wpilib.AnalogEncoder", + "functionName": "__init__", + "returnType": "wpilib.AnalogEncoder", + "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogIn channel.\n\nThis has a fullRange of 1 and an expectedZero of 0.\n\n:param channel: the analog input channel to attach to" }, { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.AddressableLED" - }, - { - "defaultValue": "", - "name": "start", - "type": "typing.SupportsInt" + "name": "analogInput", + "type": "wpilib.AnalogInput" } ], - "declaringClassName": "wpilib.AddressableLED", - "functionName": "setStart", - "returnType": "None", - "tooltip": "Sets the display start of the LED strip in the global buffer.\n\n:param start: the strip start, in LEDs" - } - ], - "instanceVariables": [], - "moduleName": "wpilib", - "staticMethods": [ + "declaringClassName": "wpilib.AnalogEncoder", + "functionName": "__init__", + "returnType": "wpilib.AnalogEncoder", + "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogInput.\n\nThis has a fullRange of 1 and an expectedZero of 0.\n\n:param analogInput: the analog input to attach to" + }, { "args": [ { "defaultValue": "", - "name": "start", + "name": "channel", "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "colorOrder", - "type": "wpilib.AddressableLED.ColorOrder" + "name": "fullRange", + "type": "typing.SupportsFloat" }, { "defaultValue": "", - "name": "ledData", - "type": "List[wpilib.AddressableLED.LEDData]" - } - ], - "declaringClassName": "wpilib.AddressableLED", - "functionName": "setGlobalData", - "returnType": "None", - "tooltip": "Sets the LED output data at an arbitrary location in the global buffer.\n\n:param start: the start location, in LEDs\n:param colorOrder: the color order\n:param ledData: the buffer to write" - } - ] - }, - { - "className": "wpilib.AddressableLED.ColorOrder", - "classVariables": [ - { - "name": "kBGR", - "tooltip": "", - "type": "wpilib.AddressableLED.ColorOrder", - "writable": false - }, - { - "name": "kBRG", - "tooltip": "", - "type": "wpilib.AddressableLED.ColorOrder", - "writable": false - }, - { - "name": "kGBR", - "tooltip": "", - "type": "wpilib.AddressableLED.ColorOrder", - "writable": false - }, - { - "name": "kGRB", - "tooltip": "", - "type": "wpilib.AddressableLED.ColorOrder", - "writable": false - }, - { - "name": "kRBG", - "tooltip": "", - "type": "wpilib.AddressableLED.ColorOrder", - "writable": false - }, - { - "name": "kRGB", - "tooltip": "", - "type": "wpilib.AddressableLED.ColorOrder", - "writable": false - } - ], - "constructors": [ - { - "args": [ - { - "defaultValue": "", - "name": "value", - "type": "typing.SupportsInt" + "name": "expectedZero", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.AddressableLED.ColorOrder", - "functionName": "__init__", - "returnType": "wpilib.AddressableLED.ColorOrder", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [], - "instanceVariables": [ - { - "name": "name", - "tooltip": "name(self: object, /) -> str\n", - "type": "str", - "writable": false - }, - { - "name": "value", - "tooltip": "", - "type": "int", - "writable": false - } - ], - "moduleName": "wpilib", - "staticMethods": [] - }, - { - "className": "wpilib.AddressableLED.LEDData", - "classVariables": [], - "constructors": [ - { - "args": [], - "declaringClassName": "wpilib.AddressableLED.LEDData", + "declaringClassName": "wpilib.AnalogEncoder", "functionName": "__init__", - "returnType": "wpilib.AddressableLED.LEDData", - "tooltip": "" + "returnType": "wpilib.AnalogEncoder", + "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogIn channel.\n\n:param channel: the analog input channel to attach to\n:param fullRange: the value to report at maximum travel\n:param expectedZero: the reading where you would expect a 0 from get()" }, { "args": [ { "defaultValue": "", - "name": "r", - "type": "typing.SupportsInt" + "name": "analogInput", + "type": "wpilib.AnalogInput" }, { "defaultValue": "", - "name": "g", - "type": "typing.SupportsInt" + "name": "fullRange", + "type": "typing.SupportsFloat" }, { "defaultValue": "", - "name": "b", - "type": "typing.SupportsInt" + "name": "expectedZero", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.AddressableLED.LEDData", + "declaringClassName": "wpilib.AnalogEncoder", "functionName": "__init__", - "returnType": "wpilib.AddressableLED.LEDData", - "tooltip": "" + "returnType": "wpilib.AnalogEncoder", + "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogInput.\n\n:param analogInput: the analog input to attach to\n:param fullRange: the value to report at maximum travel\n:param expectedZero: the reading where you would expect a 0 from get()" } ], "enums": [], @@ -1507,44 +1392,42 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED.LEDData" - }, - { - "defaultValue": "", - "name": "h", - "type": "typing.SupportsInt" - }, - { - "defaultValue": "", - "name": "s", - "type": "typing.SupportsInt" - }, + "type": "wpilib.AnalogEncoder" + } + ], + "declaringClassName": "wpilib.AnalogEncoder", + "functionName": "get", + "returnType": "float", + "tooltip": "Get the encoder value.\n\n:returns: the encoder value scaled by the full range input" + }, + { + "args": [ { "defaultValue": "", - "name": "v", - "type": "typing.SupportsInt" + "name": "self", + "type": "wpilib.AnalogEncoder" } ], - "declaringClassName": "wpilib.AddressableLED.LEDData", - "functionName": "setHSV", - "returnType": "None", - "tooltip": "A helper method to set all values of the LED.\n\n:param h: the h value [0-180]\n:param s: the s value [0-255]\n:param v: the v value [0-255]" + "declaringClassName": "wpilib.AnalogEncoder", + "functionName": "getChannel", + "returnType": "int", + "tooltip": "Get the channel number.\n\n:returns: The channel number." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED.LEDData" + "type": "wpilib.AnalogEncoder" }, { "defaultValue": "", - "name": "color", - "type": "wpilib.Color" + "name": "builder", + "type": "wpiutil.SendableBuilder" } ], - "declaringClassName": "wpilib.AddressableLED.LEDData", - "functionName": "setLED", + "declaringClassName": "wpilib.AnalogEncoder", + "functionName": "initSendable", "returnType": "None", "tooltip": "" }, @@ -1553,115 +1436,122 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED.LEDData" + "type": "wpilib.AnalogEncoder" }, { "defaultValue": "", - "name": "color", - "type": "wpilib.Color8Bit" + "name": "inverted", + "type": "bool" } ], - "declaringClassName": "wpilib.AddressableLED.LEDData", - "functionName": "setLED", + "declaringClassName": "wpilib.AnalogEncoder", + "functionName": "setInverted", "returnType": "None", - "tooltip": "" + "tooltip": "Set if this encoder is inverted.\n\n:param inverted: true to invert the encoder, false otherwise" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AddressableLED.LEDData" - }, - { - "defaultValue": "", - "name": "r", - "type": "typing.SupportsInt" + "type": "wpilib.AnalogEncoder" }, { "defaultValue": "", - "name": "g", - "type": "typing.SupportsInt" + "name": "min", + "type": "typing.SupportsFloat" }, { "defaultValue": "", - "name": "b", - "type": "typing.SupportsInt" + "name": "max", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.AddressableLED.LEDData", - "functionName": "setRGB", + "declaringClassName": "wpilib.AnalogEncoder", + "functionName": "setVoltagePercentageRange", "returnType": "None", - "tooltip": "A helper method to set all values of the LED.\n\n:param r: the r value [0-255]\n:param g: the g value [0-255]\n:param b: the b value [0-255]" - } - ], - "instanceVariables": [ - { - "name": "b", - "tooltip": "///< blue value", - "type": "int", - "writable": true - }, - { - "name": "g", - "tooltip": "///< green value", - "type": "int", - "writable": true - }, - { - "name": "r", - "tooltip": "///< red value", - "type": "int", - "writable": true + "tooltip": "Set the encoder voltage percentage range. Analog sensors are not always\nfully stable at the end of their travel ranges. Shrinking this range down\ncan help mitigate issues with that.\n\n:param min: minimum voltage percentage (0-1 range)\n:param max: maximum voltage percentage (0-1 range)" } ], + "instanceVariables": [], "moduleName": "wpilib", "staticMethods": [] }, { - "className": "wpilib.Alert", + "className": "wpilib.AnalogGyro", "classVariables": [], "constructors": [ { "args": [ { "defaultValue": "", - "name": "text", - "type": "str" + "name": "channel", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "__init__", + "returnType": "wpilib.AnalogGyro", + "tooltip": "%Gyro constructor using the Analog Input channel number.\n\n:param channel: The analog channel the gyro is connected to. Gyros can only\n be used on on-board Analog Inputs 0-1." + }, + { + "args": [ + { + "defaultValue": "", + "name": "channel", + "type": "wpilib.AnalogInput" + } + ], + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "__init__", + "returnType": "wpilib.AnalogGyro", + "tooltip": "%Gyro constructor with a precreated AnalogInput object.\n\nUse this constructor when the analog channel needs to be shared.\nThis object will not clean up the AnalogInput object when using this\nconstructor.\n\n:param channel: A pointer to the AnalogInput object that the gyro is\n connected to." + }, + { + "args": [ + { + "defaultValue": "", + "name": "channel", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "type", - "type": "wpilib.Alert.AlertType" + "name": "center", + "type": "typing.SupportsInt" + }, + { + "defaultValue": "", + "name": "offset", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.Alert", + "declaringClassName": "wpilib.AnalogGyro", "functionName": "__init__", - "returnType": "wpilib.Alert", - "tooltip": "Creates a new alert in the default group - \"Alerts\". If this is the first\nto be instantiated, the appropriate entries will be added to NetworkTables.\n\n:param text: Text to be displayed when the alert is active.\n:param type: Alert urgency level." + "returnType": "wpilib.AnalogGyro", + "tooltip": "%Gyro constructor using the Analog Input channel number with parameters for\npresetting the center and offset values. Bypasses calibration.\n\n:param channel: The analog channel the gyro is connected to. Gyros can only\n be used on on-board Analog Inputs 0-1.\n:param center: Preset uncalibrated value to use as the accumulator center\n value.\n:param offset: Preset uncalibrated value to use as the gyro offset." }, { "args": [ { "defaultValue": "", - "name": "group", - "type": "str" + "name": "channel", + "type": "wpilib.AnalogInput" }, { "defaultValue": "", - "name": "text", - "type": "str" + "name": "center", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "type", - "type": "wpilib.Alert.AlertType" + "name": "offset", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.Alert", + "declaringClassName": "wpilib.AnalogGyro", "functionName": "__init__", - "returnType": "wpilib.Alert", - "tooltip": "Creates a new alert. If this is the first to be instantiated in its group,\nthe appropriate entries will be added to NetworkTables.\n\n:param group: Group identifier, used as the entry name in NetworkTables.\n:param text: Text to be displayed when the alert is active.\n:param type: Alert urgency level." + "returnType": "wpilib.AnalogGyro", + "tooltip": "%Gyro constructor with a precreated AnalogInput object and calibrated\nparameters.\n\nUse this constructor when the analog channel needs to be shared.\nThis object will not clean up the AnalogInput object when using this\nconstructor.\n\n:param channel: A pointer to the AnalogInput object that the gyro is\n connected to.\n:param center: Preset uncalibrated value to use as the accumulator center\n value.\n:param offset: Preset uncalibrated value to use as the gyro offset." } ], "enums": [], @@ -1671,249 +1561,171 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.Alert" + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.Alert", - "functionName": "close", + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "calibrate", "returnType": "None", - "tooltip": "Disables the alert" + "tooltip": "Calibrate the gyro by running for a number of samples and computing the\ncenter value. Then use the center value as the Accumulator center value for\nsubsequent measurements.\n\nIt's important to make sure that the robot is not moving while the\ncentering calculations are in progress, this is typically done when the\nrobot is first turned on while it's sitting at rest before the competition\nstarts." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.Alert" + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.Alert", - "functionName": "get", - "returnType": "bool", - "tooltip": "Gets whether the alert is active.\n\n:returns: whether the alert is active." + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "getAnalogInput", + "returnType": "wpilib.AnalogInput", + "tooltip": "Gets the analog input for the gyro.\n\n:returns: AnalogInput" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.Alert" + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.Alert", - "functionName": "getText", - "returnType": "str", - "tooltip": "Gets the current alert text.\n\n:returns: the current text." + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "getAngle", + "returnType": "float", + "tooltip": "Return the actual angle in degrees that the robot is currently facing.\n\nThe angle is based on the current accumulator value corrected by the\noversampling rate, the gyro type and the A/D calibration values. The angle\nis continuous, that is it will continue from 360->361 degrees. This allows\nalgorithms that wouldn't want to see a discontinuity in the gyro output as\nit sweeps from 360 to 0 on the second time around.\n\n:returns: The current heading of the robot in degrees. This heading is based\n on integration of the returned rate from the gyro." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.Alert" + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.Alert", - "functionName": "getType", - "returnType": "wpilib.Alert.AlertType", - "tooltip": "Get the type of this alert.\n\n:returns: the type" + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "getCenter", + "returnType": "int", + "tooltip": "Return the gyro center value. If run after calibration,\nthe center value can be used as a preset later.\n\n:returns: the current center value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.Alert" - }, - { - "defaultValue": "", - "name": "active", - "type": "bool" + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.Alert", - "functionName": "set", - "returnType": "None", - "tooltip": "Sets whether the alert should currently be displayed. This method can be\nsafely called periodically.\n\n:param active: Whether to display the alert." + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "getOffset", + "returnType": "float", + "tooltip": "Return the gyro offset value. If run after calibration,\nthe offset value can be used as a preset later.\n\n:returns: the current offset value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.Alert" - }, - { - "defaultValue": "", - "name": "text", - "type": "str" + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.Alert", - "functionName": "setText", - "returnType": "None", - "tooltip": "Updates current alert text. Use this method to dynamically change the\ndisplayed alert, such as including more details about the detected problem.\n\n:param text: Text to be displayed when the alert is active." - } - ], - "instanceVariables": [], - "moduleName": "wpilib", - "staticMethods": [] - }, - { - "className": "wpilib.Alert.AlertType", - "classVariables": [ - { - "name": "kError", - "tooltip": "", - "type": "wpilib.Alert.AlertType", - "writable": false - }, - { - "name": "kInfo", - "tooltip": "", - "type": "wpilib.Alert.AlertType", - "writable": false + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "getRate", + "returnType": "float", + "tooltip": "Return the rate of rotation of the gyro\n\nThe rate is based on the most recent reading of the gyro analog value\n\n:returns: the current rate in degrees per second" }, - { - "name": "kWarning", - "tooltip": "", - "type": "wpilib.Alert.AlertType", - "writable": false - } - ], - "constructors": [ { "args": [ { "defaultValue": "", - "name": "value", - "type": "typing.SupportsInt" + "name": "self", + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.Alert.AlertType", - "functionName": "__init__", - "returnType": "wpilib.Alert.AlertType", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [], - "instanceVariables": [ - { - "name": "name", - "tooltip": "name(self: object, /) -> str\n", - "type": "str", - "writable": false + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "getRotation2d", + "returnType": "wpimath.geometry.Rotation2d", + "tooltip": "Return the heading of the robot as a Rotation2d.\n\nThe angle is continuous, that is it will continue from 360 to 361 degrees.\nThis allows algorithms that wouldn't want to see a discontinuity in the\ngyro output as it sweeps past from 360 to 0 on the second time around.\n\nThe angle is expected to increase as the gyro turns counterclockwise when\nlooked at from the top. It needs to follow the NWU axis convention.\n\n:returns: the current heading of the robot as a Rotation2d. This heading is\n based on integration of the returned rate from the gyro." }, - { - "name": "value", - "tooltip": "", - "type": "int", - "writable": false - } - ], - "moduleName": "wpilib", - "staticMethods": [] - }, - { - "className": "wpilib.AnalogAccelerometer", - "classVariables": [], - "constructors": [ { "args": [ { "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" + "name": "self", + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.AnalogAccelerometer", - "functionName": "__init__", - "returnType": "wpilib.AnalogAccelerometer", - "tooltip": "Create a new instance of an accelerometer.\n\nThe constructor allocates desired analog input.\n\n:param channel: The channel number for the analog input the accelerometer is\n connected to" + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "initGyro", + "returnType": "None", + "tooltip": "Initialize the gyro.\n\nCalibration is handled by Calibrate()." }, { "args": [ { "defaultValue": "", - "name": "channel", - "type": "wpilib.AnalogInput" - } - ], - "declaringClassName": "wpilib.AnalogAccelerometer", - "functionName": "__init__", - "returnType": "wpilib.AnalogAccelerometer", - "tooltip": "Create a new instance of Accelerometer from an existing AnalogInput.\n\nMake a new instance of accelerometer given an AnalogInput. This is\nparticularly useful if the port is going to be read as an analog channel as\nwell as through the Accelerometer class.\n\n:param channel: The existing AnalogInput object for the analog input the\n accelerometer is connected to" - } - ], - "enums": [], - "instanceMethods": [ - { - "args": [ + "name": "self", + "type": "wpilib.AnalogGyro" + }, { "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogAccelerometer" + "name": "builder", + "type": "wpiutil.SendableBuilder" } ], - "declaringClassName": "wpilib.AnalogAccelerometer", - "functionName": "getAcceleration", - "returnType": "float", - "tooltip": "Return the acceleration in Gs.\n\nThe acceleration is returned units of Gs.\n\n:returns: The current acceleration of the sensor in Gs." + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "initSendable", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AnalogAccelerometer" - }, - { - "defaultValue": "", - "name": "builder", - "type": "wpiutil.SendableBuilder" + "type": "wpilib.AnalogGyro" } ], - "declaringClassName": "wpilib.AnalogAccelerometer", - "functionName": "initSendable", + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "reset", "returnType": "None", - "tooltip": "" + "tooltip": "Reset the gyro.\n\nResets the gyro to a heading of zero. This can be used if there is\nsignificant drift in the gyro and it needs to be recalibrated after it has\nbeen running." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AnalogAccelerometer" + "type": "wpilib.AnalogGyro" }, { "defaultValue": "", - "name": "sensitivity", + "name": "volts", "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.AnalogAccelerometer", - "functionName": "setSensitivity", + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "setDeadband", "returnType": "None", - "tooltip": "Set the accelerometer sensitivity.\n\nThis sets the sensitivity of the accelerometer used for calculating the\nacceleration. The sensitivity varies by accelerometer model.\n\n:param sensitivity: The sensitivity of accelerometer in Volts per G." + "tooltip": "Set the size of the neutral zone.\n\nAny voltage from the gyro less than this amount from the center is\nconsidered stationary. Setting a deadband will decrease the amount of\ndrift when the gyro isn't rotating, but will make it less accurate.\n\n:param volts: The size of the deadband in volts" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.AnalogAccelerometer" + "type": "wpilib.AnalogGyro" }, { "defaultValue": "", - "name": "zero", + "name": "voltsPerDegreePerSecond", "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.AnalogAccelerometer", - "functionName": "setZero", + "declaringClassName": "wpilib.AnalogGyro", + "functionName": "setSensitivity", "returnType": "None", - "tooltip": "Set the voltage that corresponds to 0 G.\n\nThe zero G voltage varies by accelerometer model.\n\n:param zero: The zero G voltage." + "tooltip": "Set the gyro sensitivity.\n\nThis takes the number of volts/degree/second sensitivity of the gyro and\nuses it in subsequent calculations to allow the code to work with multiple\ngyros. This value is typically found in the gyro datasheet.\n\n:param voltsPerDegreePerSecond: The sensitivity in Volts/degree/second" } ], "instanceVariables": [], @@ -1921,7 +1733,7 @@ "staticMethods": [] }, { - "className": "wpilib.AnalogEncoder", + "className": "wpilib.AnalogInput", "classVariables": [], "constructors": [ { @@ -1932,431 +1744,7 @@ "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "__init__", - "returnType": "wpilib.AnalogEncoder", - "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogIn channel.\n\nThis has a fullRange of 1 and an expectedZero of 0.\n\n:param channel: the analog input channel to attach to" - }, - { - "args": [ - { - "defaultValue": "", - "name": "analogInput", - "type": "wpilib.AnalogInput" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "__init__", - "returnType": "wpilib.AnalogEncoder", - "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogInput.\n\nThis has a fullRange of 1 and an expectedZero of 0.\n\n:param analogInput: the analog input to attach to" - }, - { - "args": [ - { - "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" - }, - { - "defaultValue": "", - "name": "fullRange", - "type": "typing.SupportsFloat" - }, - { - "defaultValue": "", - "name": "expectedZero", - "type": "typing.SupportsFloat" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "__init__", - "returnType": "wpilib.AnalogEncoder", - "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogIn channel.\n\n:param channel: the analog input channel to attach to\n:param fullRange: the value to report at maximum travel\n:param expectedZero: the reading where you would expect a 0 from get()" - }, - { - "args": [ - { - "defaultValue": "", - "name": "analogInput", - "type": "wpilib.AnalogInput" - }, - { - "defaultValue": "", - "name": "fullRange", - "type": "typing.SupportsFloat" - }, - { - "defaultValue": "", - "name": "expectedZero", - "type": "typing.SupportsFloat" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "__init__", - "returnType": "wpilib.AnalogEncoder", - "tooltip": "Construct a new AnalogEncoder attached to a specific AnalogInput.\n\n:param analogInput: the analog input to attach to\n:param fullRange: the value to report at maximum travel\n:param expectedZero: the reading where you would expect a 0 from get()" - } - ], - "enums": [], - "instanceMethods": [ - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogEncoder" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "get", - "returnType": "float", - "tooltip": "Get the encoder value.\n\n:returns: the encoder value scaled by the full range input" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogEncoder" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "getChannel", - "returnType": "int", - "tooltip": "Get the channel number.\n\n:returns: The channel number." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogEncoder" - }, - { - "defaultValue": "", - "name": "builder", - "type": "wpiutil.SendableBuilder" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "initSendable", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogEncoder" - }, - { - "defaultValue": "", - "name": "inverted", - "type": "bool" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "setInverted", - "returnType": "None", - "tooltip": "Set if this encoder is inverted.\n\n:param inverted: true to invert the encoder, false otherwise" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogEncoder" - }, - { - "defaultValue": "", - "name": "min", - "type": "typing.SupportsFloat" - }, - { - "defaultValue": "", - "name": "max", - "type": "typing.SupportsFloat" - } - ], - "declaringClassName": "wpilib.AnalogEncoder", - "functionName": "setVoltagePercentageRange", - "returnType": "None", - "tooltip": "Set the encoder voltage percentage range. Analog sensors are not always\nfully stable at the end of their travel ranges. Shrinking this range down\ncan help mitigate issues with that.\n\n:param min: minimum voltage percentage (0-1 range)\n:param max: maximum voltage percentage (0-1 range)" - } - ], - "instanceVariables": [], - "moduleName": "wpilib", - "staticMethods": [] - }, - { - "className": "wpilib.AnalogGyro", - "classVariables": [], - "constructors": [ - { - "args": [ - { - "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "__init__", - "returnType": "wpilib.AnalogGyro", - "tooltip": "%Gyro constructor using the Analog Input channel number.\n\n:param channel: The analog channel the gyro is connected to. Gyros can only\n be used on on-board Analog Inputs 0-1." - }, - { - "args": [ - { - "defaultValue": "", - "name": "channel", - "type": "wpilib.AnalogInput" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "__init__", - "returnType": "wpilib.AnalogGyro", - "tooltip": "%Gyro constructor with a precreated AnalogInput object.\n\nUse this constructor when the analog channel needs to be shared.\nThis object will not clean up the AnalogInput object when using this\nconstructor.\n\n:param channel: A pointer to the AnalogInput object that the gyro is\n connected to." - }, - { - "args": [ - { - "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" - }, - { - "defaultValue": "", - "name": "center", - "type": "typing.SupportsInt" - }, - { - "defaultValue": "", - "name": "offset", - "type": "typing.SupportsFloat" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "__init__", - "returnType": "wpilib.AnalogGyro", - "tooltip": "%Gyro constructor using the Analog Input channel number with parameters for\npresetting the center and offset values. Bypasses calibration.\n\n:param channel: The analog channel the gyro is connected to. Gyros can only\n be used on on-board Analog Inputs 0-1.\n:param center: Preset uncalibrated value to use as the accumulator center\n value.\n:param offset: Preset uncalibrated value to use as the gyro offset." - }, - { - "args": [ - { - "defaultValue": "", - "name": "channel", - "type": "wpilib.AnalogInput" - }, - { - "defaultValue": "", - "name": "center", - "type": "typing.SupportsInt" - }, - { - "defaultValue": "", - "name": "offset", - "type": "typing.SupportsFloat" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "__init__", - "returnType": "wpilib.AnalogGyro", - "tooltip": "%Gyro constructor with a precreated AnalogInput object and calibrated\nparameters.\n\nUse this constructor when the analog channel needs to be shared.\nThis object will not clean up the AnalogInput object when using this\nconstructor.\n\n:param channel: A pointer to the AnalogInput object that the gyro is\n connected to.\n:param center: Preset uncalibrated value to use as the accumulator center\n value.\n:param offset: Preset uncalibrated value to use as the gyro offset." - } - ], - "enums": [], - "instanceMethods": [ - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "calibrate", - "returnType": "None", - "tooltip": "Calibrate the gyro by running for a number of samples and computing the\ncenter value. Then use the center value as the Accumulator center value for\nsubsequent measurements.\n\nIt's important to make sure that the robot is not moving while the\ncentering calculations are in progress, this is typically done when the\nrobot is first turned on while it's sitting at rest before the competition\nstarts." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "getAnalogInput", - "returnType": "wpilib.AnalogInput", - "tooltip": "Gets the analog input for the gyro.\n\n:returns: AnalogInput" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "getAngle", - "returnType": "float", - "tooltip": "Return the actual angle in degrees that the robot is currently facing.\n\nThe angle is based on the current accumulator value corrected by the\noversampling rate, the gyro type and the A/D calibration values. The angle\nis continuous, that is it will continue from 360->361 degrees. This allows\nalgorithms that wouldn't want to see a discontinuity in the gyro output as\nit sweeps from 360 to 0 on the second time around.\n\n:returns: The current heading of the robot in degrees. This heading is based\n on integration of the returned rate from the gyro." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "getCenter", - "returnType": "int", - "tooltip": "Return the gyro center value. If run after calibration,\nthe center value can be used as a preset later.\n\n:returns: the current center value" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "getOffset", - "returnType": "float", - "tooltip": "Return the gyro offset value. If run after calibration,\nthe offset value can be used as a preset later.\n\n:returns: the current offset value" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "getRate", - "returnType": "float", - "tooltip": "Return the rate of rotation of the gyro\n\nThe rate is based on the most recent reading of the gyro analog value\n\n:returns: the current rate in degrees per second" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "getRotation2d", - "returnType": "wpimath.geometry.Rotation2d", - "tooltip": "Return the heading of the robot as a Rotation2d.\n\nThe angle is continuous, that is it will continue from 360 to 361 degrees.\nThis allows algorithms that wouldn't want to see a discontinuity in the\ngyro output as it sweeps past from 360 to 0 on the second time around.\n\nThe angle is expected to increase as the gyro turns counterclockwise when\nlooked at from the top. It needs to follow the NWU axis convention.\n\n:returns: the current heading of the robot as a Rotation2d. This heading is\n based on integration of the returned rate from the gyro." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "initGyro", - "returnType": "None", - "tooltip": "Initialize the gyro.\n\nCalibration is handled by Calibrate()." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - }, - { - "defaultValue": "", - "name": "builder", - "type": "wpiutil.SendableBuilder" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "initSendable", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "reset", - "returnType": "None", - "tooltip": "Reset the gyro.\n\nResets the gyro to a heading of zero. This can be used if there is\nsignificant drift in the gyro and it needs to be recalibrated after it has\nbeen running." - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - }, - { - "defaultValue": "", - "name": "volts", - "type": "typing.SupportsFloat" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "setDeadband", - "returnType": "None", - "tooltip": "Set the size of the neutral zone.\n\nAny voltage from the gyro less than this amount from the center is\nconsidered stationary. Setting a deadband will decrease the amount of\ndrift when the gyro isn't rotating, but will make it less accurate.\n\n:param volts: The size of the deadband in volts" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "wpilib.AnalogGyro" - }, - { - "defaultValue": "", - "name": "voltsPerDegreePerSecond", - "type": "typing.SupportsFloat" - } - ], - "declaringClassName": "wpilib.AnalogGyro", - "functionName": "setSensitivity", - "returnType": "None", - "tooltip": "Set the gyro sensitivity.\n\nThis takes the number of volts/degree/second sensitivity of the gyro and\nuses it in subsequent calculations to allow the code to work with multiple\ngyros. This value is typically found in the gyro datasheet.\n\n:param voltsPerDegreePerSecond: The sensitivity in Volts/degree/second" - } - ], - "instanceVariables": [], - "moduleName": "wpilib", - "staticMethods": [] - }, - { - "className": "wpilib.AnalogInput", - "classVariables": [], - "constructors": [ - { - "args": [ - { - "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" - } - ], - "declaringClassName": "wpilib.AnalogInput", + "declaringClassName": "wpilib.AnalogInput", "functionName": "__init__", "returnType": "wpilib.AnalogInput", "tooltip": "Construct an analog input.\n\n:param channel: The channel number on the roboRIO to represent. 0-3 are\n on-board 4-7 are on the MXP port." @@ -44140,683 +43528,1325 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SimDeviceSim" + "type": "wpilib.simulation.SimDeviceSim" + }, + { + "defaultValue": "", + "name": "name", + "type": "str" + } + ], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "getEnum", + "returnType": "hal._wpiHal.SimEnum", + "tooltip": "Get the property object with the given name.\n\n:param name: the property name\n\n:returns: the property object" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SimDeviceSim" + }, + { + "defaultValue": "", + "name": "name", + "type": "str" + } + ], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "getInt", + "returnType": "hal._wpiHal.SimInt", + "tooltip": "Retrieves an object that allows you to interact with simulated values\nrepresented as an integer." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SimDeviceSim" + }, + { + "defaultValue": "", + "name": "name", + "type": "str" + } + ], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "getLong", + "returnType": "hal._wpiHal.SimLong", + "tooltip": "Retrieves an object that allows you to interact with simulated values\nrepresented as a long." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SimDeviceSim" + } + ], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "getName", + "returnType": "str", + "tooltip": "Get the name of this object.\n\n:returns: name" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SimDeviceSim" + }, + { + "defaultValue": "", + "name": "name", + "type": "str" + } + ], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "getValue", + "returnType": "hal._wpiHal.SimValue", + "tooltip": "Provides a readonly mechanism to retrieve all types of device values" + } + ], + "instanceVariables": [], + "moduleName": "wpilib.simulation", + "staticMethods": [ + { + "args": [ + { + "defaultValue": "''", + "name": "prefix", + "type": "str" + } + ], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "enumerateDevices", + "returnType": "list[str]", + "tooltip": "Returns a list of available device names" + }, + { + "args": [ + { + "defaultValue": "", + "name": "val", + "type": "hal._wpiHal.SimEnum" + } + ], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "getEnumOptions", + "returnType": "list[str]", + "tooltip": "Get all options for the given enum.\n\n:param val: the enum\n\n:returns: names of the different values for that enum" + }, + { + "args": [], + "declaringClassName": "wpilib.simulation.SimDeviceSim", + "functionName": "resetData", + "returnType": "None", + "tooltip": "Reset all SimDevice data." + } + ] + }, + { + "className": "wpilib.simulation.SingleJointedArmSim", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": "", + "name": "system", + "type": "wpimath.system.LinearSystem_2_1_2" + }, + { + "defaultValue": "", + "name": "gearbox", + "type": "wpimath.system.plant.DCMotor" + }, + { + "defaultValue": "", + "name": "gearing", + "type": "typing.SupportsFloat" + }, + { + "defaultValue": "", + "name": "armLength", + "type": "wpimath.units.meters" + }, + { + "defaultValue": "", + "name": "minAngle", + "type": "wpimath.units.radians" + }, + { + "defaultValue": "", + "name": "maxAngle", + "type": "wpimath.units.radians" + }, + { + "defaultValue": "", + "name": "simulateGravity", + "type": "bool" + }, + { + "defaultValue": "", + "name": "startingAngle", + "type": "wpimath.units.radians" + }, + { + "defaultValue": "[0.0, 0.0]", + "name": "measurementStdDevs", + "type": "Annotated[list[typing.SupportsFloat], FixedSize(2)]" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "__init__", + "returnType": "wpilib.simulation.SingleJointedArmSim", + "tooltip": "Creates a simulated arm mechanism.\n\n:param system: The system representing this arm. This system can\n be created with\n LinearSystemId::SingleJointedArmSystem().\n:param gearbox: The type and number of motors on the arm gearbox.\n:param gearing: The gear ratio of the arm (numbers greater than 1\n represent reductions).\n:param armLength: The length of the arm.\n:param minAngle: The minimum angle that the arm is capable of.\n:param maxAngle: The maximum angle that the arm is capable of.\n:param simulateGravity: Whether gravity should be simulated or not.\n:param startingAngle: The initial position of the arm.\n:param measurementStdDevs: The standard deviations of the measurements." + }, + { + "args": [ + { + "defaultValue": "", + "name": "gearbox", + "type": "wpimath.system.plant.DCMotor" + }, + { + "defaultValue": "", + "name": "gearing", + "type": "typing.SupportsFloat" + }, + { + "defaultValue": "", + "name": "moi", + "type": "wpimath.units.kilogram_square_meters" + }, + { + "defaultValue": "", + "name": "armLength", + "type": "wpimath.units.meters" + }, + { + "defaultValue": "", + "name": "minAngle", + "type": "wpimath.units.radians" + }, + { + "defaultValue": "", + "name": "maxAngle", + "type": "wpimath.units.radians" + }, + { + "defaultValue": "", + "name": "simulateGravity", + "type": "bool" + }, + { + "defaultValue": "", + "name": "startingAngle", + "type": "wpimath.units.radians" + }, + { + "defaultValue": "[0.0, 0.0]", + "name": "measurementStdDevs", + "type": "Annotated[list[typing.SupportsFloat], FixedSize(2)]" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "__init__", + "returnType": "wpilib.simulation.SingleJointedArmSim", + "tooltip": "Creates a simulated arm mechanism.\n\n:param gearbox: The type and number of motors on the arm gearbox.\n:param gearing: The gear ratio of the arm (numbers greater than 1\n represent reductions).\n:param moi: The moment of inertia of the arm. This can be\n calculated from CAD software.\n:param armLength: The length of the arm.\n:param minAngle: The minimum angle that the arm is capable of.\n:param maxAngle: The maximum angle that the arm is capable of.\n:param simulateGravity: Whether gravity should be simulated or not.\n:param startingAngle: The initial position of the arm.\n:param measurementStdDevs: The standard deviation of the measurement noise." + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "getAngle", + "returnType": "wpimath.units.radians", + "tooltip": "Returns the current arm angle.\n\n:returns: The current arm angle." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "getAngleDegrees", + "returnType": "wpimath.units.degrees", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "getCurrentDraw", + "returnType": "wpimath.units.amperes", + "tooltip": "Returns the arm current draw.\n\n:returns: The arm current draw." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.LinearSystemSim_2_1_2" + } + ], + "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", + "functionName": "getInput", + "returnType": "typing.Annotated[numpy.typing.NDArray[numpy.float64], \"[1, 1]\"]", + "tooltip": "Returns the current input of the plant.\n\n:returns: The current input of the plant." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.LinearSystemSim_2_1_2" + }, + { + "defaultValue": "", + "name": "row", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", + "functionName": "getInput", + "returnType": "float", + "tooltip": "Returns an element of the current input of the plant.\n\n:param row: The row to return.\n\n:returns: An element of the current input of the plant." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.LinearSystemSim_2_1_2" + } + ], + "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", + "functionName": "getOutput", + "returnType": "typing.Annotated[numpy.typing.NDArray[numpy.float64], \"[2, 1]\"]", + "tooltip": "Returns the current output of the plant.\n\n:returns: The current output of the plant." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.LinearSystemSim_2_1_2" + }, + { + "defaultValue": "", + "name": "row", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", + "functionName": "getOutput", + "returnType": "float", + "tooltip": "Returns an element of the current output of the plant.\n\n:param row: The row to return.\n\n:returns: An element of the current output of the plant." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "getVelocity", + "returnType": "wpimath.units.radians_per_second", + "tooltip": "Returns the current arm velocity.\n\n:returns: The current arm velocity." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "getVelocityDps", + "returnType": "wpimath.units.degrees_per_second", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "hasHitLowerLimit", + "returnType": "bool", + "tooltip": "Returns whether the arm has hit the lower limit.\n\n:returns: Whether the arm has hit the lower limit." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "hasHitUpperLimit", + "returnType": "bool", + "tooltip": "Returns whether the arm has hit the upper limit.\n\n:returns: Whether the arm has hit the upper limit." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.LinearSystemSim_2_1_2" + }, + { + "defaultValue": "", + "name": "u", + "type": "typing.Annotated[numpy.typing.ArrayLike, numpy.float64, \"[1, 1]\"]" + } + ], + "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", + "functionName": "setInput", + "returnType": "None", + "tooltip": "Sets the system inputs (usually voltages).\n\n:param u: The system inputs." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.LinearSystemSim_2_1_2" + }, + { + "defaultValue": "", + "name": "row", + "type": "typing.SupportsInt" + }, + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsFloat" + } + ], + "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", + "functionName": "setInput", + "returnType": "None", + "tooltip": "Sets the system inputs.\n\n:param row: The row in the input matrix to set.\n:param value: The value to set the row to." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + }, + { + "defaultValue": "", + "name": "voltage", + "type": "wpimath.units.volts" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "setInputVoltage", + "returnType": "None", + "tooltip": "Sets the input voltage for the arm.\n\n:param voltage: The input voltage." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + }, + { + "defaultValue": "", + "name": "angle", + "type": "wpimath.units.radians" + }, + { + "defaultValue": "", + "name": "velocity", + "type": "wpimath.units.radians_per_second" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "setState", + "returnType": "None", + "tooltip": "Sets the arm's state. The new angle will be limited between the minimum and\nmaximum allowed limits.\n\n:param angle: The new angle.\n:param velocity: The new angular velocity." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.LinearSystemSim_2_1_2" + }, + { + "defaultValue": "", + "name": "dt", + "type": "wpimath.units.seconds" + } + ], + "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", + "functionName": "update", + "returnType": "None", + "tooltip": "Updates the simulation.\n\n:param dt: The time between updates." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + }, + { + "defaultValue": "", + "name": "armAngle", + "type": "wpimath.units.radians" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "wouldHitLowerLimit", + "returnType": "bool", + "tooltip": "Returns whether the arm would hit the lower limit.\n\n:param armAngle: The arm height.\n\n:returns: Whether the arm would hit the lower limit." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SingleJointedArmSim" + }, + { + "defaultValue": "", + "name": "armAngle", + "type": "wpimath.units.radians" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "wouldHitUpperLimit", + "returnType": "bool", + "tooltip": "Returns whether the arm would hit the upper limit.\n\n:param armAngle: The arm height.\n\n:returns: Whether the arm would hit the upper limit." + } + ], + "instanceVariables": [], + "moduleName": "wpilib.simulation", + "staticMethods": [ + { + "args": [ + { + "defaultValue": "", + "name": "length", + "type": "wpimath.units.meters" + }, + { + "defaultValue": "", + "name": "mass", + "type": "wpimath.units.kilograms" + } + ], + "declaringClassName": "wpilib.simulation.SingleJointedArmSim", + "functionName": "estimateMOI", + "returnType": "wpimath.units.kilogram_square_meters", + "tooltip": "Calculates a rough estimate of the moment of inertia of an arm given its\nlength and mass.\n\n:param length: The length of the arm.\n:param mass: The mass of the arm.\n\n:returns: The calculated moment of inertia." + } + ] + }, + { + "className": "wpilib.simulation.SolenoidSim", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": "", + "name": "moduleSim", + "type": "wpilib.simulation.PneumaticsBaseSim" + }, + { + "defaultValue": "", + "name": "channel", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.simulation.SolenoidSim", + "functionName": "__init__", + "returnType": "wpilib.simulation.SolenoidSim", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "module", + "type": "typing.SupportsInt" + }, + { + "defaultValue": "", + "name": "type", + "type": "wpilib.PneumaticsModuleType" + }, + { + "defaultValue": "", + "name": "channel", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.simulation.SolenoidSim", + "functionName": "__init__", + "returnType": "wpilib.simulation.SolenoidSim", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "type", + "type": "wpilib.PneumaticsModuleType" + }, + { + "defaultValue": "", + "name": "channel", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.simulation.SolenoidSim", + "functionName": "__init__", + "returnType": "wpilib.simulation.SolenoidSim", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SolenoidSim" + } + ], + "declaringClassName": "wpilib.simulation.SolenoidSim", + "functionName": "getModuleSim", + "returnType": "wpilib.simulation.PneumaticsBaseSim", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SolenoidSim" + } + ], + "declaringClassName": "wpilib.simulation.SolenoidSim", + "functionName": "getOutput", + "returnType": "bool", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SolenoidSim" + }, + { + "defaultValue": "", + "name": "callback", + "type": "Callable[[str, hal._wpiHal.Value], None]" + }, + { + "defaultValue": "", + "name": "initialNotify", + "type": "bool" + } + ], + "declaringClassName": "wpilib.simulation.SolenoidSim", + "functionName": "registerOutputCallback", + "returnType": "wpilib.simulation.CallbackStore", + "tooltip": "Register a callback to be run when the output of this solenoid has changed.\n\n:param callback: the callback\n:param initialNotify: whether to run the callback with the initial state\n\n:returns: the :class:`.CallbackStore` object associated with this callback.\n Save a reference to this object; it being deconstructed cancels the\n callback." + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.SolenoidSim" + }, + { + "defaultValue": "", + "name": "output", + "type": "bool" + } + ], + "declaringClassName": "wpilib.simulation.SolenoidSim", + "functionName": "setOutput", + "returnType": "None", + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "wpilib.simulation", + "staticMethods": [] + }, + { + "className": "wpilib.simulation.StadiaControllerSim", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": "", + "name": "joystick", + "type": "wpilib.StadiaController" + } + ], + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "__init__", + "returnType": "wpilib.simulation.StadiaControllerSim", + "tooltip": "Constructs from a StadiaController object.\n\n:param joystick: controller to simulate" + }, + { + "args": [ + { + "defaultValue": "", + "name": "port", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "__init__", + "returnType": "wpilib.simulation.StadiaControllerSim", + "tooltip": "Constructs from a joystick port number.\n\n:param port: port number" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "name", - "type": "str" + "name": "outputNumber", + "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "getEnum", - "returnType": "hal._wpiHal.SimEnum", - "tooltip": "Get the property object with the given name.\n\n:param name: the property name\n\n:returns: the property object" + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "getOutput", + "returnType": "bool", + "tooltip": "Read the output of a button.\n\n:param outputNumber: the button number\n\n:returns: the value of the button (true = pressed)" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SimDeviceSim" - }, - { - "defaultValue": "", - "name": "name", - "type": "str" + "type": "wpilib.simulation.GenericHIDSim" } ], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "getInt", - "returnType": "hal._wpiHal.SimInt", - "tooltip": "Retrieves an object that allows you to interact with simulated values\nrepresented as an integer." + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "getOutputs", + "returnType": "int", + "tooltip": "Get the encoded 16-bit integer that passes button values.\n\n:returns: the button values" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SimDeviceSim" + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "name", - "type": "str" + "name": "type", + "type": "wpilib.interfaces.GenericHID.RumbleType" } ], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "getLong", - "returnType": "hal._wpiHal.SimLong", - "tooltip": "Retrieves an object that allows you to interact with simulated values\nrepresented as a long." + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "getRumble", + "returnType": "float", + "tooltip": "Get the joystick rumble.\n\n:param type: the rumble to read\n\n:returns: the rumble value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SimDeviceSim" + "type": "wpilib.simulation.GenericHIDSim" } ], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "getName", - "returnType": "str", - "tooltip": "Get the name of this object.\n\n:returns: name" + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "notifyNewData", + "returnType": "None", + "tooltip": "Updates joystick data so that new values are visible to the user program." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SimDeviceSim" + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "name", - "type": "str" - } - ], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "getValue", - "returnType": "hal._wpiHal.SimValue", - "tooltip": "Provides a readonly mechanism to retrieve all types of device values" - } - ], - "instanceVariables": [], - "moduleName": "wpilib.simulation", - "staticMethods": [ - { - "args": [ - { - "defaultValue": "''", - "name": "prefix", - "type": "str" + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "enumerateDevices", - "returnType": "list[str]", - "tooltip": "Returns a list of available device names" + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setAButton", + "returnType": "None", + "tooltip": "Change the value of the A button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", - "name": "val", - "type": "hal._wpiHal.SimEnum" + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "count", + "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "getEnumOptions", - "returnType": "list[str]", - "tooltip": "Get all options for the given enum.\n\n:param val: the enum\n\n:returns: names of the different values for that enum" - }, - { - "args": [], - "declaringClassName": "wpilib.simulation.SimDeviceSim", - "functionName": "resetData", + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setAxisCount", "returnType": "None", - "tooltip": "Reset all SimDevice data." - } - ] - }, - { - "className": "wpilib.simulation.SingleJointedArmSim", - "classVariables": [], - "constructors": [ + "tooltip": "Set the axis count of this device.\n\n:param count: the new axis count" + }, { "args": [ { "defaultValue": "", - "name": "system", - "type": "wpimath.system.LinearSystem_2_1_2" - }, - { - "defaultValue": "", - "name": "gearbox", - "type": "wpimath.system.plant.DCMotor" - }, - { - "defaultValue": "", - "name": "gearing", - "type": "typing.SupportsFloat" - }, - { - "defaultValue": "", - "name": "armLength", - "type": "wpimath.units.meters" - }, - { - "defaultValue": "", - "name": "minAngle", - "type": "wpimath.units.radians" - }, - { - "defaultValue": "", - "name": "maxAngle", - "type": "wpimath.units.radians" + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "simulateGravity", - "type": "bool" + "name": "axis", + "type": "typing.SupportsInt" }, { "defaultValue": "", - "name": "startingAngle", - "type": "wpimath.units.radians" - }, - { - "defaultValue": "[0.0, 0.0]", - "name": "measurementStdDevs", - "type": "Annotated[list[typing.SupportsFloat], FixedSize(2)]" + "name": "type", + "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "__init__", - "returnType": "wpilib.simulation.SingleJointedArmSim", - "tooltip": "Creates a simulated arm mechanism.\n\n:param system: The system representing this arm. This system can\n be created with\n LinearSystemId::SingleJointedArmSystem().\n:param gearbox: The type and number of motors on the arm gearbox.\n:param gearing: The gear ratio of the arm (numbers greater than 1\n represent reductions).\n:param armLength: The length of the arm.\n:param minAngle: The minimum angle that the arm is capable of.\n:param maxAngle: The maximum angle that the arm is capable of.\n:param simulateGravity: Whether gravity should be simulated or not.\n:param startingAngle: The initial position of the arm.\n:param measurementStdDevs: The standard deviations of the measurements." + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setAxisType", + "returnType": "None", + "tooltip": "Set the type of an axis.\n\n:param axis: the axis\n:param type: the type" }, { "args": [ { "defaultValue": "", - "name": "gearbox", - "type": "wpimath.system.plant.DCMotor" - }, - { - "defaultValue": "", - "name": "gearing", - "type": "typing.SupportsFloat" - }, - { - "defaultValue": "", - "name": "moi", - "type": "wpimath.units.kilogram_square_meters" - }, - { - "defaultValue": "", - "name": "armLength", - "type": "wpimath.units.meters" - }, - { - "defaultValue": "", - "name": "minAngle", - "type": "wpimath.units.radians" - }, - { - "defaultValue": "", - "name": "maxAngle", - "type": "wpimath.units.radians" + "name": "self", + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "simulateGravity", + "name": "value", "type": "bool" - }, - { - "defaultValue": "", - "name": "startingAngle", - "type": "wpimath.units.radians" - }, - { - "defaultValue": "[0.0, 0.0]", - "name": "measurementStdDevs", - "type": "Annotated[list[typing.SupportsFloat], FixedSize(2)]" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "__init__", - "returnType": "wpilib.simulation.SingleJointedArmSim", - "tooltip": "Creates a simulated arm mechanism.\n\n:param gearbox: The type and number of motors on the arm gearbox.\n:param gearing: The gear ratio of the arm (numbers greater than 1\n represent reductions).\n:param moi: The moment of inertia of the arm. This can be\n calculated from CAD software.\n:param armLength: The length of the arm.\n:param minAngle: The minimum angle that the arm is capable of.\n:param maxAngle: The maximum angle that the arm is capable of.\n:param simulateGravity: Whether gravity should be simulated or not.\n:param startingAngle: The initial position of the arm.\n:param measurementStdDevs: The standard deviation of the measurement noise." - } - ], - "enums": [], - "instanceMethods": [ + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setBButton", + "returnType": "None", + "tooltip": "Change the value of the B button on the controller.\n\n:param value: the new value" + }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" - } - ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "getAngle", - "returnType": "wpimath.units.radians", - "tooltip": "Returns the current arm angle.\n\n:returns: The current arm angle." - }, - { - "args": [ + "type": "wpilib.simulation.GenericHIDSim" + }, { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "name": "count", + "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "getAngleDegrees", - "returnType": "wpimath.units.degrees", - "tooltip": "" + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setButtonCount", + "returnType": "None", + "tooltip": "Set the button count of this device.\n\n:param count: the new button count" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "getCurrentDraw", - "returnType": "wpimath.units.amperes", - "tooltip": "Returns the arm current draw.\n\n:returns: The arm current draw." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setEllipsesButton", + "returnType": "None", + "tooltip": "Change the value of the ellipses button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.LinearSystemSim_2_1_2" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", - "functionName": "getInput", - "returnType": "typing.Annotated[numpy.typing.NDArray[numpy.float64], \"[1, 1]\"]", - "tooltip": "Returns the current input of the plant.\n\n:returns: The current input of the plant." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setFrameButton", + "returnType": "None", + "tooltip": "Change the value of the frame button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.LinearSystemSim_2_1_2" + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "row", - "type": "typing.SupportsInt" + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", - "functionName": "getInput", - "returnType": "float", - "tooltip": "Returns an element of the current input of the plant.\n\n:param row: The row to return.\n\n:returns: An element of the current input of the plant." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setGoogleButton", + "returnType": "None", + "tooltip": "Change the value of the google button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.LinearSystemSim_2_1_2" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", - "functionName": "getOutput", - "returnType": "typing.Annotated[numpy.typing.NDArray[numpy.float64], \"[2, 1]\"]", - "tooltip": "Returns the current output of the plant.\n\n:returns: The current output of the plant." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setHamburgerButton", + "returnType": "None", + "tooltip": "Change the value of the hamburger button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.LinearSystemSim_2_1_2" + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "row", - "type": "typing.SupportsInt" + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", - "functionName": "getOutput", - "returnType": "float", - "tooltip": "Returns an element of the current output of the plant.\n\n:param row: The row to return.\n\n:returns: An element of the current output of the plant." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setLeftBumperButton", + "returnType": "None", + "tooltip": "Change the value of the left bumper button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "getVelocity", - "returnType": "wpimath.units.radians_per_second", - "tooltip": "Returns the current arm velocity.\n\n:returns: The current arm velocity." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setLeftStickButton", + "returnType": "None", + "tooltip": "Change the value of the left stick button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "getVelocityDps", - "returnType": "wpimath.units.degrees_per_second", - "tooltip": "" + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setLeftTriggerButton", + "returnType": "None", + "tooltip": "Change the value of the left trigger button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "hasHitLowerLimit", - "returnType": "bool", - "tooltip": "Returns whether the arm has hit the lower limit.\n\n:returns: Whether the arm has hit the lower limit." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setLeftX", + "returnType": "None", + "tooltip": "Change the left X value of the controller's joystick.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "hasHitUpperLimit", - "returnType": "bool", - "tooltip": "Returns whether the arm has hit the upper limit.\n\n:returns: Whether the arm has hit the upper limit." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setLeftY", + "returnType": "None", + "tooltip": "Change the left Y value of the controller's joystick.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.LinearSystemSim_2_1_2" + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "u", - "type": "typing.Annotated[numpy.typing.ArrayLike, numpy.float64, \"[1, 1]\"]" + "name": "name", + "type": "str" } ], - "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", - "functionName": "setInput", + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setName", "returnType": "None", - "tooltip": "Sets the system inputs (usually voltages).\n\n:param u: The system inputs." + "tooltip": "Set the name of this device.\n\n:param name: the new device name" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.LinearSystemSim_2_1_2" + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "row", + "name": "pov", "type": "typing.SupportsInt" }, { "defaultValue": "", "name": "value", - "type": "typing.SupportsFloat" + "type": "wpilib.DriverStation.POVDirection" } ], - "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", - "functionName": "setInput", + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setPOV", "returnType": "None", - "tooltip": "Sets the system inputs.\n\n:param row: The row in the input matrix to set.\n:param value: The value to set the row to." + "tooltip": "Set the value of a given POV.\n\n:param pov: the POV to set\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "voltage", - "type": "wpimath.units.volts" + "name": "value", + "type": "wpilib.DriverStation.POVDirection" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "setInputVoltage", + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setPOV", "returnType": "None", - "tooltip": "Sets the input voltage for the arm.\n\n:param voltage: The input voltage." + "tooltip": "Set the value of the default POV (port 0).\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" - }, - { - "defaultValue": "", - "name": "angle", - "type": "wpimath.units.radians" + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "velocity", - "type": "wpimath.units.radians_per_second" + "name": "count", + "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "setState", + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setPOVCount", "returnType": "None", - "tooltip": "Sets the arm's state. The new angle will be limited between the minimum and\nmaximum allowed limits.\n\n:param angle: The new angle.\n:param velocity: The new angular velocity." + "tooltip": "Set the POV count of this device.\n\n:param count: the new POV count" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.LinearSystemSim_2_1_2" + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "dt", - "type": "wpimath.units.seconds" + "name": "axis", + "type": "typing.SupportsInt" + }, + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.LinearSystemSim_2_1_2", - "functionName": "update", + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setRawAxis", "returnType": "None", - "tooltip": "Updates the simulation.\n\n:param dt: The time between updates." + "tooltip": "Set the value of a given axis.\n\n:param axis: the axis to set\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.GenericHIDSim" }, { "defaultValue": "", - "name": "armAngle", - "type": "wpimath.units.radians" + "name": "button", + "type": "typing.SupportsInt" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "wouldHitLowerLimit", - "returnType": "bool", - "tooltip": "Returns whether the arm would hit the lower limit.\n\n:param armAngle: The arm height.\n\n:returns: Whether the arm would hit the lower limit." + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setRawButton", + "returnType": "None", + "tooltip": "Set the value of a given button.\n\n:param button: the button to set\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SingleJointedArmSim" + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "armAngle", - "type": "wpimath.units.radians" + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "wouldHitUpperLimit", - "returnType": "bool", - "tooltip": "Returns whether the arm would hit the upper limit.\n\n:param armAngle: The arm height.\n\n:returns: Whether the arm would hit the upper limit." - } - ], - "instanceVariables": [], - "moduleName": "wpilib.simulation", - "staticMethods": [ + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setRightBumperButton", + "returnType": "None", + "tooltip": "Change the value of the right bumper button on the controller.\n\n:param value: the new value" + }, { "args": [ { "defaultValue": "", - "name": "length", - "type": "wpimath.units.meters" + "name": "self", + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "mass", - "type": "wpimath.units.kilograms" + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SingleJointedArmSim", - "functionName": "estimateMOI", - "returnType": "wpimath.units.kilogram_square_meters", - "tooltip": "Calculates a rough estimate of the moment of inertia of an arm given its\nlength and mass.\n\n:param length: The length of the arm.\n:param mass: The mass of the arm.\n\n:returns: The calculated moment of inertia." - } - ] - }, - { - "className": "wpilib.simulation.SolenoidSim", - "classVariables": [], - "constructors": [ + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setRightStickButton", + "returnType": "None", + "tooltip": "Change the value of the right stick button on the controller.\n\n:param value: the new value" + }, { "args": [ { "defaultValue": "", - "name": "moduleSim", - "type": "wpilib.simulation.PneumaticsBaseSim" + "name": "self", + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SolenoidSim", - "functionName": "__init__", - "returnType": "wpilib.simulation.SolenoidSim", - "tooltip": "" + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setRightTriggerButton", + "returnType": "None", + "tooltip": "Change the value of the right trigger button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", - "name": "module", - "type": "typing.SupportsInt" - }, - { - "defaultValue": "", - "name": "type", - "type": "wpilib.PneumaticsModuleType" + "name": "self", + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" + "name": "value", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.SolenoidSim", - "functionName": "__init__", - "returnType": "wpilib.simulation.SolenoidSim", - "tooltip": "" + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setRightX", + "returnType": "None", + "tooltip": "Change the right X value of the controller's joystick.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", - "name": "type", - "type": "wpilib.PneumaticsModuleType" + "name": "self", + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "channel", - "type": "typing.SupportsInt" + "name": "value", + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.SolenoidSim", - "functionName": "__init__", - "returnType": "wpilib.simulation.SolenoidSim", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [ + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setRightY", + "returnType": "None", + "tooltip": "Change the right Y value of the controller's joystick.\n\n:param value: the new value" + }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SolenoidSim" + "type": "wpilib.simulation.StadiaControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SolenoidSim", - "functionName": "getModuleSim", - "returnType": "wpilib.simulation.PneumaticsBaseSim", - "tooltip": "" + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setStadiaButton", + "returnType": "None", + "tooltip": "Change the value of the stadia button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SolenoidSim" + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "type", + "type": "wpilib.interfaces.GenericHID.HIDType" } ], - "declaringClassName": "wpilib.simulation.SolenoidSim", - "functionName": "getOutput", - "returnType": "bool", - "tooltip": "" + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setType", + "returnType": "None", + "tooltip": "Set the type of this device.\n\n:param type: the new device type" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SolenoidSim" - }, - { - "defaultValue": "", - "name": "callback", - "type": "Callable[[str, hal._wpiHal.Value], None]" + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "initialNotify", + "name": "value", "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SolenoidSim", - "functionName": "registerOutputCallback", - "returnType": "wpilib.simulation.CallbackStore", - "tooltip": "Register a callback to be run when the output of this solenoid has changed.\n\n:param callback: the callback\n:param initialNotify: whether to run the callback with the initial state\n\n:returns: the :class:`.CallbackStore` object associated with this callback.\n Save a reference to this object; it being deconstructed cancels the\n callback." + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setXButton", + "returnType": "None", + "tooltip": "Change the value of the X button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.SolenoidSim" + "type": "wpilib.simulation.StadiaControllerSim" }, { "defaultValue": "", - "name": "output", + "name": "value", "type": "bool" } ], - "declaringClassName": "wpilib.simulation.SolenoidSim", - "functionName": "setOutput", + "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "functionName": "setYButton", "returnType": "None", - "tooltip": "" + "tooltip": "Change the value of the Y button on the controller.\n\n:param value: the new value" } ], "instanceVariables": [], @@ -44824,7 +44854,7 @@ "staticMethods": [] }, { - "className": "wpilib.simulation.StadiaControllerSim", + "className": "wpilib.simulation.XboxControllerSim", "classVariables": [], "constructors": [ { @@ -44832,13 +44862,13 @@ { "defaultValue": "", "name": "joystick", - "type": "wpilib.StadiaController" + "type": "wpilib.XboxController" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "declaringClassName": "wpilib.simulation.XboxControllerSim", "functionName": "__init__", - "returnType": "wpilib.simulation.StadiaControllerSim", - "tooltip": "Constructs from a StadiaController object.\n\n:param joystick: controller to simulate" + "returnType": "wpilib.simulation.XboxControllerSim", + "tooltip": "Constructs from a XboxController object.\n\n:param joystick: controller to simulate" }, { "args": [ @@ -44848,9 +44878,9 @@ "type": "typing.SupportsInt" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "declaringClassName": "wpilib.simulation.XboxControllerSim", "functionName": "__init__", - "returnType": "wpilib.simulation.StadiaControllerSim", + "returnType": "wpilib.simulation.XboxControllerSim", "tooltip": "Constructs from a joystick port number.\n\n:param port: port number" } ], @@ -44923,7 +44953,7 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -44931,7 +44961,7 @@ "type": "bool" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "declaringClassName": "wpilib.simulation.XboxControllerSim", "functionName": "setAButton", "returnType": "None", "tooltip": "Change the value of the A button on the controller.\n\n:param value: the new value" @@ -44982,7 +45012,7 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -44990,11 +45020,29 @@ "type": "bool" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", + "declaringClassName": "wpilib.simulation.XboxControllerSim", "functionName": "setBButton", "returnType": "None", "tooltip": "Change the value of the B button on the controller.\n\n:param value: the new value" }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.XboxControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" + } + ], + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setBackButton", + "returnType": "None", + "tooltip": "Change the value of the back button on the controller.\n\n:param value: the new value" + }, { "args": [ { @@ -45018,7 +45066,7 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -45026,17 +45074,17 @@ "type": "bool" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setEllipsesButton", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setLeftBumperButton", "returnType": "None", - "tooltip": "Change the value of the ellipses button on the controller.\n\n:param value: the new value" + "tooltip": "Change the value of the left bumper button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -45044,53 +45092,176 @@ "type": "bool" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setFrameButton", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setLeftStickButton", "returnType": "None", - "tooltip": "Change the value of the frame button on the controller.\n\n:param value: the new value" + "tooltip": "Change the value of the left stick button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", "name": "value", - "type": "bool" + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setGoogleButton", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setLeftTriggerAxis", "returnType": "None", - "tooltip": "Change the value of the google button on the controller.\n\n:param value: the new value" + "tooltip": "Change the value of the left trigger axis on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", "name": "value", - "type": "bool" + "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setHamburgerButton", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setLeftX", "returnType": "None", - "tooltip": "Change the value of the hamburger button on the controller.\n\n:param value: the new value" + "tooltip": "Change the left X value of the controller's joystick.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsFloat" + } + ], + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setLeftY", + "returnType": "None", + "tooltip": "Change the left Y value of the controller's joystick.\n\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "name", + "type": "str" + } + ], + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setName", + "returnType": "None", + "tooltip": "Set the name of this device.\n\n:param name: the new device name" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "pov", + "type": "typing.SupportsInt" + }, + { + "defaultValue": "", + "name": "value", + "type": "wpilib.DriverStation.POVDirection" + } + ], + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setPOV", + "returnType": "None", + "tooltip": "Set the value of a given POV.\n\n:param pov: the POV to set\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "wpilib.DriverStation.POVDirection" + } + ], + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setPOV", + "returnType": "None", + "tooltip": "Set the value of the default POV (port 0).\n\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "count", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setPOVCount", + "returnType": "None", + "tooltip": "Set the POV count of this device.\n\n:param count: the new POV count" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "axis", + "type": "typing.SupportsInt" + }, + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsFloat" + } + ], + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setRawAxis", + "returnType": "None", + "tooltip": "Set the value of a given axis.\n\n:param axis: the axis to set\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "button", + "type": "typing.SupportsInt" }, { "defaultValue": "", @@ -45098,17 +45269,17 @@ "type": "bool" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setLeftBumperButton", + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setRawButton", "returnType": "None", - "tooltip": "Change the value of the left bumper button on the controller.\n\n:param value: the new value" + "tooltip": "Set the value of a given button.\n\n:param button: the button to set\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -45116,17 +45287,17 @@ "type": "bool" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setLeftStickButton", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setRightBumperButton", "returnType": "None", - "tooltip": "Change the value of the left stick button on the controller.\n\n:param value: the new value" + "tooltip": "Change the value of the right bumper button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -45134,17 +45305,17 @@ "type": "bool" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setLeftTriggerButton", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setRightStickButton", "returnType": "None", - "tooltip": "Change the value of the left trigger button on the controller.\n\n:param value: the new value" + "tooltip": "Change the value of the right stick button on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -45152,17 +45323,17 @@ "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setLeftX", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setRightTriggerAxis", "returnType": "None", - "tooltip": "Change the left X value of the controller's joystick.\n\n:param value: the new value" + "tooltip": "Change the value of the right trigger axis on the controller.\n\n:param value: the new value" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.simulation.XboxControllerSim" }, { "defaultValue": "", @@ -45170,330 +45341,467 @@ "type": "typing.SupportsFloat" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setLeftY", + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setRightX", "returnType": "None", - "tooltip": "Change the left Y value of the controller's joystick.\n\n:param value: the new value" + "tooltip": "Change the right X value of the controller's joystick.\n\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.XboxControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsFloat" + } + ], + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setRightY", + "returnType": "None", + "tooltip": "Change the right Y value of the controller's joystick.\n\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.XboxControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" + } + ], + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setStartButton", + "returnType": "None", + "tooltip": "Change the value of the start button on the controller.\n\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.GenericHIDSim" + }, + { + "defaultValue": "", + "name": "type", + "type": "wpilib.interfaces.GenericHID.HIDType" + } + ], + "declaringClassName": "wpilib.simulation.GenericHIDSim", + "functionName": "setType", + "returnType": "None", + "tooltip": "Set the type of this device.\n\n:param type: the new device type" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.XboxControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" + } + ], + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setXButton", + "returnType": "None", + "tooltip": "Change the value of the X button on the controller.\n\n:param value: the new value" + }, + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib.simulation.XboxControllerSim" + }, + { + "defaultValue": "", + "name": "value", + "type": "bool" + } + ], + "declaringClassName": "wpilib.simulation.XboxControllerSim", + "functionName": "setYButton", + "returnType": "None", + "tooltip": "Change the value of the Y button on the controller.\n\n:param value: the new value" + } + ], + "instanceVariables": [], + "moduleName": "wpilib.simulation", + "staticMethods": [] + }, + { + "className": "wpilib.sysid.State", + "classVariables": [ + { + "name": "kDynamicForward", + "tooltip": "", + "type": "wpilib.sysid.State", + "writable": false + }, + { + "name": "kDynamicReverse", + "tooltip": "", + "type": "wpilib.sysid.State", + "writable": false + }, + { + "name": "kNone", + "tooltip": "", + "type": "wpilib.sysid.State", + "writable": false + }, + { + "name": "kQuasistaticForward", + "tooltip": "", + "type": "wpilib.sysid.State", + "writable": false + }, + { + "name": "kQuasistaticReverse", + "tooltip": "", + "type": "wpilib.sysid.State", + "writable": false + } + ], + "constructors": [ + { + "args": [ + { + "defaultValue": "", + "name": "value", + "type": "typing.SupportsInt" + } + ], + "declaringClassName": "wpilib.sysid.State", + "functionName": "__init__", + "returnType": "wpilib.sysid.State", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [], + "instanceVariables": [ + { + "name": "name", + "tooltip": "name(self: object, /) -> str\n", + "type": "str", + "writable": false }, + { + "name": "value", + "tooltip": "", + "type": "int", + "writable": false + } + ], + "moduleName": "wpilib.sysid", + "staticMethods": [] + }, + { + "className": "wpilib.sysid.SysIdRoutineLog", + "classVariables": [], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "name", + "name": "logName", "type": "str" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setName", - "returnType": "None", - "tooltip": "Set the name of this device.\n\n:param name: the new device name" - }, + "declaringClassName": "wpilib.sysid.SysIdRoutineLog", + "functionName": "__init__", + "returnType": "wpilib.sysid.SysIdRoutineLog", + "tooltip": "Create a new logging utility for a SysId test routine.\n\n:param logName: The name for the test routine in the log. Should be unique\n between complete test routines (quasistatic and dynamic, forward and\n reverse). The current state of this test (e.g. \"quasistatic-forward\")\n will appear in WPILog under the \"sysid-test-state-logName\" entry." + } + ], + "enums": [], + "instanceMethods": [ { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "pov", - "type": "typing.SupportsInt" + "type": "wpilib.sysid.SysIdRoutineLog" }, { "defaultValue": "", - "name": "value", - "type": "wpilib.DriverStation.POVDirection" + "name": "motorName", + "type": "str" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setPOV", - "returnType": "None", - "tooltip": "Set the value of a given POV.\n\n:param pov: the POV to set\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog", + "functionName": "motor", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log data from a motor during a SysId routine.\n\n:param motorName: The name of the motor.\n\n:returns: Handle with chainable callbacks to log individual data fields." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib.sysid.SysIdRoutineLog" }, { "defaultValue": "", - "name": "value", - "type": "wpilib.DriverStation.POVDirection" + "name": "state", + "type": "wpilib.sysid.State" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setPOV", + "declaringClassName": "wpilib.sysid.SysIdRoutineLog", + "functionName": "recordState", "returnType": "None", - "tooltip": "Set the value of the default POV (port 0).\n\n:param value: the new value" - }, + "tooltip": "Records the current state of the SysId test routine. Should be called once\nper iteration during tests with the type of the current test, and once upon\ntest end with state `none`.\n\n:param state: The current state of the SysId test routine." + } + ], + "instanceVariables": [], + "moduleName": "wpilib.sysid", + "staticMethods": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "count", - "type": "typing.SupportsInt" + "name": "state", + "type": "wpilib.sysid.State" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setPOVCount", - "returnType": "None", - "tooltip": "Set the POV count of this device.\n\n:param count: the new POV count" - }, + "declaringClassName": "wpilib.sysid.SysIdRoutineLog", + "functionName": "stateEnumToString", + "returnType": "str", + "tooltip": "" + } + ] + }, + { + "className": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "classVariables": [], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "axis", - "type": "typing.SupportsInt" + "name": "args", + "type": "tuple" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "kwargs", + "type": "dict" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setRawAxis", - "returnType": "None", - "tooltip": "Set the value of a given axis.\n\n:param axis: the axis to set\n:param value: the new value" - }, + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "__init__", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], + "enums": [], + "instanceMethods": [ { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "button", - "type": "typing.SupportsInt" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "acceleration", + "type": "wpimath.units.meters_per_second_squared" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setRawButton", - "returnType": "None", - "tooltip": "Set the value of a given button.\n\n:param button: the button to set\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "acceleration", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the linear acceleration of the motor.\n\nThis is optional; SysId can perform an accurate fit without it.\n\n:param acceleration: The linear acceleration to record.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "acceleration", + "type": "wpimath.units.turns_per_second_squared" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setRightBumperButton", - "returnType": "None", - "tooltip": "Change the value of the right bumper button on the controller.\n\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "angularAcceleration", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the angular acceleration of the motor.\n\nThis is optional; SysId can perform an accurate fit without it.\n\n:param acceleration: The angular acceleration to record.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "position", + "type": "wpimath.units.turns" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setRightStickButton", - "returnType": "None", - "tooltip": "Change the value of the right stick button on the controller.\n\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "angularPosition", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the angular position of the motor.\n\n:param position: The angular position to record.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "velocity", + "type": "wpimath.units.turns_per_second" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setRightTriggerButton", - "returnType": "None", - "tooltip": "Change the value of the right trigger button on the controller.\n\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "angularVelocity", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the angular velocity of the motor.\n\n:param velocity: The angular velocity to record.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "current", + "type": "wpimath.units.amperes" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setRightX", - "returnType": "None", - "tooltip": "Change the right X value of the controller's joystick.\n\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "current", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the current applied to the motor.\n\nThis is optional; SysId can perform an accurate fit without it.\n\n:param current: The current to record.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "position", + "type": "wpimath.units.meters" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setRightY", - "returnType": "None", - "tooltip": "Change the right Y value of the controller's joystick.\n\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "position", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the linear position of the motor.\n\n:param position: The linear position to record.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "bool" - } - ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setStadiaButton", - "returnType": "None", - "tooltip": "Change the value of the stadia button on the controller.\n\n:param value: the new value" - }, - { - "args": [ + "name": "name", + "type": "str" + }, { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "name": "value", + "type": "typing.SupportsFloat" }, { "defaultValue": "", - "name": "type", - "type": "wpilib.interfaces.GenericHID.HIDType" + "name": "unit", + "type": "str" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setType", - "returnType": "None", - "tooltip": "Set the type of this device.\n\n:param type: the new device type" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "value", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log a generic data value from the motor.\n\n:param name: The name of the data field being recorded.\n:param value: The numeric value of the data field.\n:param unit: The unit string of the data field.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "velocity", + "type": "wpimath.units.meters_per_second" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setXButton", - "returnType": "None", - "tooltip": "Change the value of the X button on the controller.\n\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "velocity", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the linear velocity of the motor.\n\n:param velocity: The linear velocity to record.\n\n:returns: The motor log (for call chaining)." }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.StadiaControllerSim" + "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "voltage", + "type": "wpimath.units.volts" } ], - "declaringClassName": "wpilib.simulation.StadiaControllerSim", - "functionName": "setYButton", - "returnType": "None", - "tooltip": "Change the value of the Y button on the controller.\n\n:param value: the new value" + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "voltage", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Log the voltage applied to the motor.\n\n:param voltage: The voltage to record.\n\n:returns: The motor log (for call chaining)." } ], "instanceVariables": [], - "moduleName": "wpilib.simulation", + "moduleName": "wpilib.sysid", "staticMethods": [] }, { - "className": "wpilib.simulation.XboxControllerSim", + "className": "wpilib_placeholders.ExpansionHub", "classVariables": [], "constructors": [ { "args": [ { "defaultValue": "", - "name": "joystick", - "type": "wpilib.XboxController" - } - ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "__init__", - "returnType": "wpilib.simulation.XboxControllerSim", - "tooltip": "Constructs from a XboxController object.\n\n:param joystick: controller to simulate" - }, - { - "args": [ - { - "defaultValue": "", - "name": "port", - "type": "typing.SupportsInt" + "name": "hubNumber", + "type": "int" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", + "declaringClassName": "wpilib_placeholders.ExpansionHub", "functionName": "__init__", - "returnType": "wpilib.simulation.XboxControllerSim", - "tooltip": "Constructs from a joystick port number.\n\n:param port: port number" + "returnType": "wpilib_placeholders.ExpansionHub", + "tooltip": "" } ], "enums": [], @@ -45503,720 +45811,702 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "outputNumber", - "type": "typing.SupportsInt" + "type": "wpilib_placeholders.ExpansionHub" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "getOutput", - "returnType": "bool", - "tooltip": "Read the output of a button.\n\n:param outputNumber: the button number\n\n:returns: the value of the button (true = pressed)" + "declaringClassName": "wpilib_placeholders.ExpansionHub", + "functionName": "getBatteryVoltage", + "returnType": "float", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHub" + }, + { + "defaultValue": "", + "name": "motorNumber", + "type": "int" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "getOutputs", - "returnType": "int", - "tooltip": "Get the encoded 16-bit integer that passes button values.\n\n:returns: the button values" + "declaringClassName": "wpilib_placeholders.ExpansionHub", + "functionName": "getMotor", + "returnType": "wpilib_placeholders.ExpansionHubMotor", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHub" }, { "defaultValue": "", - "name": "type", - "type": "wpilib.interfaces.GenericHID.RumbleType" + "name": "servoNumber", + "type": "int" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "getRumble", - "returnType": "float", - "tooltip": "Get the joystick rumble.\n\n:param type: the rumble to read\n\n:returns: the rumble value" + "declaringClassName": "wpilib_placeholders.ExpansionHub", + "functionName": "getServo", + "returnType": "wpilib_placeholders.ExpansionHubServo", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHub" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "notifyNewData", - "returnType": "None", - "tooltip": "Updates joystick data so that new values are visible to the user program." - }, + "declaringClassName": "wpilib_placeholders.ExpansionHub", + "functionName": "isConnected", + "returnType": "bool", + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "wpilib_placeholders", + "staticMethods": [] + }, + { + "className": "wpilib_placeholders.ExpansionHubMotor", + "classVariables": [], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "name": "hubNumber", + "type": "int" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "motorNumber", + "type": "int" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setAButton", - "returnType": "None", - "tooltip": "Change the value of the A button on the controller.\n\n:param value: the new value" - }, + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "__init__", + "returnType": "wpilib_placeholders.ExpansionHubMotor", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "count", - "type": "typing.SupportsInt" + "type": "wpilib_placeholders.ExpansionHubMotor" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setAxisCount", - "returnType": "None", - "tooltip": "Set the axis count of this device.\n\n:param count: the new axis count" + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "getCurrent", + "returnType": "float", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "axis", - "type": "typing.SupportsInt" - }, - { - "defaultValue": "", - "name": "type", - "type": "typing.SupportsInt" + "type": "wpilib_placeholders.ExpansionHubMotor" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setAxisType", - "returnType": "None", - "tooltip": "Set the type of an axis.\n\n:param axis: the axis\n:param type: the type" + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "getEncoder", + "returnType": "float", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" - }, - { - "defaultValue": "", - "name": "value", - "type": "bool" + "type": "wpilib_placeholders.ExpansionHubMotor" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setBButton", - "returnType": "None", - "tooltip": "Change the value of the B button on the controller.\n\n:param value: the new value" + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "getEncoderVelocity", + "returnType": "float", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" - }, - { - "defaultValue": "", - "name": "value", - "type": "bool" + "type": "wpilib_placeholders.ExpansionHubMotor" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setBackButton", - "returnType": "None", - "tooltip": "Change the value of the back button on the controller.\n\n:param value: the new value" + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "getPositionPidConstants", + "returnType": "wpilib_placeholders.ExpansionHubPidConstants", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "count", - "type": "typing.SupportsInt" + "type": "wpilib_placeholders.ExpansionHubMotor" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setButtonCount", - "returnType": "None", - "tooltip": "Set the button count of this device.\n\n:param count: the new button count" + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "getVelocityPidConstants", + "returnType": "wpilib_placeholders.ExpansionHubPidConstants", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" - }, + "type": "wpilib_placeholders.ExpansionHubMotor" + } + ], + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "isHubConnected", + "returnType": "bool", + "tooltip": "" + }, + { + "args": [ { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "self", + "type": "wpilib_placeholders.ExpansionHubMotor" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setLeftBumperButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "resetEncoder", "returnType": "None", - "tooltip": "Change the value of the left bumper button on the controller.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "perCount", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setLeftStickButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setDistancePerCount", "returnType": "None", - "tooltip": "Change the value of the left stick button on the controller.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "enabled", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setLeftTriggerAxis", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setEnabled", "returnType": "None", - "tooltip": "Change the value of the left trigger axis on the controller.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "floatOn0", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setLeftX", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setFloatOn0", "returnType": "None", - "tooltip": "Change the left X value of the controller's joystick.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "power", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setLeftY", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setPercentagePower", "returnType": "None", - "tooltip": "Change the left Y value of the controller's joystick.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "name", - "type": "str" + "name": "setpoint", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setName", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setPositionSetpoint", "returnType": "None", - "tooltip": "Set the name of this device.\n\n:param name: the new device name" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" - }, - { - "defaultValue": "", - "name": "pov", - "type": "typing.SupportsInt" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "value", - "type": "wpilib.DriverStation.POVDirection" + "name": "reversed", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setPOV", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setReversed", "returnType": "None", - "tooltip": "Set the value of a given POV.\n\n:param pov: the POV to set\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "value", - "type": "wpilib.DriverStation.POVDirection" + "name": "setpoint", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setPOV", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setVelocitySetpoint", "returnType": "None", - "tooltip": "Set the value of the default POV (port 0).\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHubMotor" }, { "defaultValue": "", - "name": "count", - "type": "typing.SupportsInt" + "name": "voltage", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setPOVCount", + "declaringClassName": "wpilib_placeholders.ExpansionHubMotor", + "functionName": "setVoltage", "returnType": "None", - "tooltip": "Set the POV count of this device.\n\n:param count: the new POV count" - }, + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "wpilib_placeholders", + "staticMethods": [] + }, + { + "className": "wpilib_placeholders.ExpansionHubPidConstants", + "classVariables": [], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "name": "hubNumber", + "type": "int" }, { "defaultValue": "", - "name": "axis", - "type": "typing.SupportsInt" + "name": "motorNumber", + "type": "int" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "isVelocityPid", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setRawAxis", + "declaringClassName": "wpilib_placeholders.ExpansionHubPidConstants", + "functionName": "__init__", + "returnType": "wpilib_placeholders.ExpansionHubPidConstants", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": "", + "name": "self", + "type": "wpilib_placeholders.ExpansionHubPidConstants" + } + ], + "declaringClassName": "wpilib_placeholders.ExpansionHubPidConstants", + "functionName": "disableContinousInput", "returnType": "None", - "tooltip": "Set the value of a given axis.\n\n:param axis: the axis to set\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHubPidConstants" }, { "defaultValue": "", - "name": "button", - "type": "typing.SupportsInt" + "name": "minimum", + "type": "float" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "maximum", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setRawButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubPidConstants", + "functionName": "enableContinousInput", "returnType": "None", - "tooltip": "Set the value of a given button.\n\n:param button: the button to set\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubPidConstants" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "s", + "type": "float" + }, + { + "defaultValue": "", + "name": "v", + "type": "float" + }, + { + "defaultValue": "", + "name": "a", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setRightBumperButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubPidConstants", + "functionName": "setFF", "returnType": "None", - "tooltip": "Change the value of the right bumper button on the controller.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubPidConstants" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "p", + "type": "float" + }, + { + "defaultValue": "", + "name": "i", + "type": "float" + }, + { + "defaultValue": "", + "name": "d", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setRightStickButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubPidConstants", + "functionName": "setPID", "returnType": "None", - "tooltip": "Change the value of the right stick button on the controller.\n\n:param value: the new value" - }, + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "wpilib_placeholders", + "staticMethods": [] + }, + { + "className": "wpilib_placeholders.ExpansionHubServo", + "classVariables": [], + "constructors": [ { "args": [ { "defaultValue": "", - "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "name": "hubNumber", + "type": "int" }, { "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "name": "servoNumber", + "type": "int" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setRightTriggerAxis", - "returnType": "None", - "tooltip": "Change the value of the right trigger axis on the controller.\n\n:param value: the new value" - }, + "declaringClassName": "wpilib_placeholders.ExpansionHubServo", + "functionName": "__init__", + "returnType": "wpilib_placeholders.ExpansionHubServo", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" - }, - { - "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "type": "wpilib_placeholders.ExpansionHubServo" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setRightX", - "returnType": "None", - "tooltip": "Change the right X value of the controller's joystick.\n\n:param value: the new value" + "declaringClassName": "wpilib_placeholders.ExpansionHubServo", + "functionName": "isHubConnected", + "returnType": "bool", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubServo" }, { "defaultValue": "", "name": "value", - "type": "typing.SupportsFloat" + "type": "float" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setRightY", + "declaringClassName": "wpilib_placeholders.ExpansionHubServo", + "functionName": "set", "returnType": "None", - "tooltip": "Change the right Y value of the controller's joystick.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubServo" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "degrees", + "type": "float" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setStartButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubServo", + "functionName": "setAngle", "returnType": "None", - "tooltip": "Change the value of the start button on the controller.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.GenericHIDSim" + "type": "wpilib_placeholders.ExpansionHubServo" }, { "defaultValue": "", - "name": "type", - "type": "wpilib.interfaces.GenericHID.HIDType" + "name": "enabled", + "type": "bool" } ], - "declaringClassName": "wpilib.simulation.GenericHIDSim", - "functionName": "setType", + "declaringClassName": "wpilib_placeholders.ExpansionHubServo", + "functionName": "setEnabled", "returnType": "None", - "tooltip": "Set the type of this device.\n\n:param type: the new device type" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubServo" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "framePeriod", + "type": "int" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setXButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubServo", + "functionName": "setFramePeriod", "returnType": "None", - "tooltip": "Change the value of the X button on the controller.\n\n:param value: the new value" + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.simulation.XboxControllerSim" + "type": "wpilib_placeholders.ExpansionHubServo" }, { "defaultValue": "", - "name": "value", - "type": "bool" + "name": "pulseWidth", + "type": "int" } ], - "declaringClassName": "wpilib.simulation.XboxControllerSim", - "functionName": "setYButton", + "declaringClassName": "wpilib_placeholders.ExpansionHubServo", + "functionName": "setPulseWidth", "returnType": "None", - "tooltip": "Change the value of the Y button on the controller.\n\n:param value: the new value" + "tooltip": "" } ], "instanceVariables": [], - "moduleName": "wpilib.simulation", + "moduleName": "wpilib_placeholders", "staticMethods": [] }, { - "className": "wpilib.sysid.State", - "classVariables": [ - { - "name": "kDynamicForward", - "tooltip": "", - "type": "wpilib.sysid.State", - "writable": false - }, - { - "name": "kDynamicReverse", - "tooltip": "", - "type": "wpilib.sysid.State", - "writable": false - }, - { - "name": "kNone", - "tooltip": "", - "type": "wpilib.sysid.State", - "writable": false - }, - { - "name": "kQuasistaticForward", - "tooltip": "", - "type": "wpilib.sysid.State", - "writable": false - }, + "className": "wpilib_placeholders.OpModeRobot", + "classVariables": [], + "constructors": [ { - "name": "kQuasistaticReverse", - "tooltip": "", - "type": "wpilib.sysid.State", - "writable": false + "args": [], + "declaringClassName": "wpilib_placeholders.OpModeRobot", + "functionName": "__init__", + "returnType": "wpilib_placeholders.OpModeRobot", + "tooltip": "" } ], - "constructors": [ + "enums": [], + "instanceMethods": [ { "args": [ { "defaultValue": "", - "name": "value", - "type": "typing.SupportsInt" + "name": "self", + "type": "wpilib_placeholders.OpModeRobot" + }, + { + "defaultValue": "", + "name": "mode, name", + "type": "str" + }, + { + "defaultValue": "", + "name": "group", + "type": "str" + }, + { + "defaultValue": "", + "name": "description", + "type": "str" } ], - "declaringClassName": "wpilib.sysid.State", - "functionName": "__init__", - "returnType": "wpilib.sysid.State", + "declaringClassName": "wpilib_placeholders.OpModeRobot", + "functionName": "AddOpMode", + "returnType": "None", "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [], - "instanceVariables": [ - { - "name": "name", - "tooltip": "name(self: object, /) -> str\n", - "type": "str", - "writable": false }, - { - "name": "value", - "tooltip": "", - "type": "int", - "writable": false - } - ], - "moduleName": "wpilib.sysid", - "staticMethods": [] - }, - { - "className": "wpilib.sysid.SysIdRoutineLog", - "classVariables": [], - "constructors": [ { "args": [ { "defaultValue": "", - "name": "logName", - "type": "str" + "name": "self", + "type": "wpilib_placeholders.OpModeRobot" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog", - "functionName": "__init__", - "returnType": "wpilib.sysid.SysIdRoutineLog", - "tooltip": "Create a new logging utility for a SysId test routine.\n\n:param logName: The name for the test routine in the log. Should be unique\n between complete test routines (quasistatic and dynamic, forward and\n reverse). The current state of this test (e.g. \"quasistatic-forward\")\n will appear in WPILog under the \"sysid-test-state-logName\" entry." - } - ], - "enums": [], - "instanceMethods": [ + "declaringClassName": "wpilib_placeholders.OpModeRobot", + "functionName": "DriverStationConnected", + "returnType": "None", + "tooltip": "" + }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog" - }, - { - "defaultValue": "", - "name": "motorName", - "type": "str" + "type": "wpilib_placeholders.OpModeRobot" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog", - "functionName": "motor", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log data from a motor during a SysId routine.\n\n:param motorName: The name of the motor.\n\n:returns: Handle with chainable callbacks to log individual data fields." + "declaringClassName": "wpilib_placeholders.OpModeRobot", + "functionName": "EndCompetition", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog" - }, - { - "defaultValue": "", - "name": "state", - "type": "wpilib.sysid.State" + "type": "wpilib_placeholders.OpModeRobot" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog", - "functionName": "recordState", + "declaringClassName": "wpilib_placeholders.OpModeRobot", + "functionName": "NonePeriodic", "returnType": "None", - "tooltip": "Records the current state of the SysId test routine. Should be called once\nper iteration during tests with the type of the current test, and once upon\ntest end with state `none`.\n\n:param state: The current state of the SysId test routine." - } - ], - "instanceVariables": [], - "moduleName": "wpilib.sysid", - "staticMethods": [ + "tooltip": "" + }, { "args": [ { "defaultValue": "", - "name": "state", - "type": "wpilib.sysid.State" + "name": "self", + "type": "wpilib_placeholders.OpModeRobot" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog", - "functionName": "stateEnumToString", - "returnType": "str", + "declaringClassName": "wpilib_placeholders.OpModeRobot", + "functionName": "StartCompetition", + "returnType": "None", "tooltip": "" } - ] + ], + "instanceVariables": [], + "moduleName": "wpilib_placeholders", + "staticMethods": [] }, { - "className": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "className": "wpilib_placeholders.PeriodicOpMode", "classVariables": [], "constructors": [ { - "args": [ - { - "defaultValue": "", - "name": "args", - "type": "tuple" - }, - { - "defaultValue": "", - "name": "kwargs", - "type": "dict" - } - ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "args": [], + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", "functionName": "__init__", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Initialize self. See help(type(self)) for accurate signature." + "returnType": "wpilib_placeholders.PeriodicOpMode", + "tooltip": "" } ], "enums": [], @@ -46226,176 +46516,152 @@ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, - { - "defaultValue": "", - "name": "acceleration", - "type": "wpimath.units.meters_per_second_squared" + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "acceleration", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the linear acceleration of the motor.\n\nThis is optional; SysId can perform an accurate fit without it.\n\n:param acceleration: The linear acceleration to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "AddPeriodic", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, - { - "defaultValue": "", - "name": "acceleration", - "type": "wpimath.units.turns_per_second_squared" + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "angularAcceleration", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the angular acceleration of the motor.\n\nThis is optional; SysId can perform an accurate fit without it.\n\n:param acceleration: The angular acceleration to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "DisabledPeriodic", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, - { - "defaultValue": "", - "name": "position", - "type": "wpimath.units.turns" + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "angularPosition", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the angular position of the motor.\n\n:param position: The angular position to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "End", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, - { - "defaultValue": "", - "name": "velocity", - "type": "wpimath.units.turns_per_second" + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "angularVelocity", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the angular velocity of the motor.\n\n:param velocity: The angular velocity to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "GetLoopStartTime", + "returnType": "int", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, - { - "defaultValue": "", - "name": "current", - "type": "wpimath.units.amperes" + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "current", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the current applied to the motor.\n\nThis is optional; SysId can perform an accurate fit without it.\n\n:param current: The current to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "GetPeriod", + "returnType": "float", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, - { - "defaultValue": "", - "name": "position", - "type": "wpimath.units.meters" + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "position", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the linear position of the motor.\n\n:param position: The linear position to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "LoopFunc", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, - { - "defaultValue": "", - "name": "name", - "type": "str" - }, - { - "defaultValue": "", - "name": "value", - "type": "typing.SupportsFloat" + "type": "wpilib_placeholders.PeriodicOpMode" }, { "defaultValue": "", - "name": "unit", - "type": "str" + "name": "opModeId", + "type": "int" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "value", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log a generic data value from the motor.\n\n:param name: The name of the data field being recorded.\n:param value: The numeric value of the data field.\n:param unit: The unit string of the data field.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "OpModeRun", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, + "type": "wpilib_placeholders.PeriodicOpMode" + } + ], + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "OpModeStop", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ { "defaultValue": "", - "name": "velocity", - "type": "wpimath.units.meters_per_second" + "name": "self", + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "velocity", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the linear velocity of the motor.\n\n:param velocity: The linear velocity to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "Periodic", + "returnType": "None", + "tooltip": "" }, { "args": [ { "defaultValue": "", "name": "self", - "type": "wpilib.sysid.SysIdRoutineLog.MotorLog" - }, + "type": "wpilib_placeholders.PeriodicOpMode" + } + ], + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "PrintWatchdogEpochs", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ { "defaultValue": "", - "name": "voltage", - "type": "wpimath.units.volts" + "name": "self", + "type": "wpilib_placeholders.PeriodicOpMode" } ], - "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "functionName": "voltage", - "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", - "tooltip": "Log the voltage applied to the motor.\n\n:param voltage: The voltage to record.\n\n:returns: The motor log (for call chaining)." + "declaringClassName": "wpilib_placeholders.PeriodicOpMode", + "functionName": "Start", + "returnType": "None", + "tooltip": "" } ], "instanceVariables": [], - "moduleName": "wpilib.sysid", + "moduleName": "wpilib_placeholders", "staticMethods": [] }, { @@ -81450,12 +81716,6 @@ } ], "modules": [ - { - "enums": [], - "functions": [], - "moduleName": "expansion_hub", - "moduleVariables": [] - }, { "enums": [], "functions": [ @@ -81677,6 +81937,30 @@ "moduleName": "wpilib.sysid", "moduleVariables": [] }, + { + "enums": [], + "functions": [], + "moduleName": "wpilib_placeholders", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "wpilib_placeholders.expansion_hub", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "wpilib_placeholders.op_mode_robot", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "wpilib_placeholders.periodic_op_mode", + "moduleVariables": [] + }, { "enums": [], "functions": [ diff --git a/src/blocks/utils/generated/server_python_scripts.json b/src/blocks/utils/generated/server_python_scripts.json index 7e05a960..9fbac3c9 100644 --- a/src/blocks/utils/generated/server_python_scripts.json +++ b/src/blocks/utils/generated/server_python_scripts.json @@ -44,20 +44,10 @@ "defaultValue": "", "name": "self", "type": "blocks_base_classes.Mechanism" - }, - { - "defaultValue": "", - "name": "event_name", - "type": "str" - }, - { - "defaultValue": "", - "name": "event_handler", - "type": "typing.Callable" } ], "declaringClassName": "blocks_base_classes.Mechanism", - "functionName": "register_event_handler", + "functionName": "opmode_end", "returnType": "None", "tooltip": "" }, @@ -70,7 +60,7 @@ } ], "declaringClassName": "blocks_base_classes.Mechanism", - "functionName": "start", + "functionName": "opmode_periodic", "returnType": "None", "tooltip": "" }, @@ -83,7 +73,7 @@ } ], "declaringClassName": "blocks_base_classes.Mechanism", - "functionName": "stop", + "functionName": "opmode_start", "returnType": "None", "tooltip": "" }, @@ -106,161 +96,6 @@ } ], "declaringClassName": "blocks_base_classes.Mechanism", - "functionName": "unregister_event_handler", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.Mechanism" - } - ], - "declaringClassName": "blocks_base_classes.Mechanism", - "functionName": "update", - "returnType": "None", - "tooltip": "" - } - ], - "instanceVariables": [], - "moduleName": "blocks_base_classes", - "staticMethods": [] - }, - { - "className": "blocks_base_classes.OpMode", - "classVariables": [], - "constructors": [ - { - "args": [ - { - "defaultValue": "", - "name": "robot", - "type": "blocks_base_classes.RobotBase" - } - ], - "declaringClassName": "blocks_base_classes.OpMode", - "functionName": "__init__", - "returnType": "blocks_base_classes.OpMode", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [ - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.OpMode" - } - ], - "declaringClassName": "blocks_base_classes.OpMode", - "functionName": "loop", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.OpMode" - } - ], - "declaringClassName": "blocks_base_classes.OpMode", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.OpMode" - } - ], - "declaringClassName": "blocks_base_classes.OpMode", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - } - ], - "instanceVariables": [], - "moduleName": "blocks_base_classes", - "staticMethods": [] - }, - { - "className": "blocks_base_classes.RobotBase", - "classVariables": [], - "constructors": [ - { - "args": [], - "declaringClassName": "blocks_base_classes.RobotBase", - "functionName": "__init__", - "returnType": "blocks_base_classes.RobotBase", - "tooltip": "" - } - ], - "enums": [], - "instanceMethods": [ - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.RobotBase" - } - ], - "declaringClassName": "blocks_base_classes.RobotBase", - "functionName": "define_hardware", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.RobotBase" - }, - { - "defaultValue": "", - "name": "event_name", - "type": "str" - }, - { - "defaultValue": "", - "name": "args", - "type": "tuple" - } - ], - "declaringClassName": "blocks_base_classes.RobotBase", - "functionName": "fire_event", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.RobotBase" - }, - { - "defaultValue": "", - "name": "event_name", - "type": "str" - }, - { - "defaultValue": "", - "name": "event_handler", - "type": "typing.Callable" - } - ], - "declaringClassName": "blocks_base_classes.RobotBase", "functionName": "register_event_handler", "returnType": "None", "tooltip": "" @@ -270,33 +105,7 @@ { "defaultValue": "", "name": "self", - "type": "blocks_base_classes.RobotBase" - } - ], - "declaringClassName": "blocks_base_classes.RobotBase", - "functionName": "start", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.RobotBase" - } - ], - "declaringClassName": "blocks_base_classes.RobotBase", - "functionName": "stop", - "returnType": "None", - "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.RobotBase" + "type": "blocks_base_classes.Mechanism" }, { "defaultValue": "", @@ -309,23 +118,10 @@ "type": "typing.Callable" } ], - "declaringClassName": "blocks_base_classes.RobotBase", + "declaringClassName": "blocks_base_classes.Mechanism", "functionName": "unregister_event_handler", "returnType": "None", "tooltip": "" - }, - { - "args": [ - { - "defaultValue": "", - "name": "self", - "type": "blocks_base_classes.RobotBase" - } - ], - "declaringClassName": "blocks_base_classes.RobotBase", - "functionName": "update", - "returnType": "None", - "tooltip": "" } ], "instanceVariables": [], @@ -343,19 +139,13 @@ { "enums": [], "functions": [], - "moduleName": "blocks_base_classes.mechanism", + "moduleName": "blocks_base_classes.decorators", "moduleVariables": [] }, { "enums": [], "functions": [], - "moduleName": "blocks_base_classes.opmode", - "moduleVariables": [] - }, - { - "enums": [], - "functions": [], - "moduleName": "blocks_base_classes.robot_base", + "moduleName": "blocks_base_classes.mechanism", "moduleVariables": [] } ], diff --git a/src/blocks/utils/python.ts b/src/blocks/utils/python.ts index 800c66cd..1f203b47 100644 --- a/src/blocks/utils/python.ts +++ b/src/blocks/utils/python.ts @@ -31,14 +31,20 @@ import * as SetPythonVariable from "../mrc_set_python_variable"; // Utilities related to blocks for python modules and classes, including those from RobotPy, external samples, etc. -export const MODULE_NAME_BLOCKS_BASE_CLASSES = 'blocks_base_classes'; +// The module for classes used by blocks that don't exist in wpilib. +const MODULE_NAME_BLOCKS_BASE_CLASSES = 'blocks_base_classes'; -export const CLASS_NAME_ROBOT_BASE = MODULE_NAME_BLOCKS_BASE_CLASSES + '.RobotBase'; +// TODO(lizlooney): Update these constants if necessary when we update wpilib. + +export const CLASS_NAME_ROBOT_BASE = 'wpilib_placeholders.OpModeRobot'; export const ROBOT_METHOD_NAMES_NOT_OVERRIDEABLE: string[] = [ 'define_hardware', 'fire_event', 'register_event_handler', 'unregister_event_handler', + 'StartCompetition', + 'EndCompetition', + 'AddOpMode', ]; export const CLASS_NAME_MECHANISM = MODULE_NAME_BLOCKS_BASE_CLASSES + '.Mechanism'; @@ -48,11 +54,25 @@ export const MECHANISM_METHOD_NAMES_NOT_OVERRIDEABLE: string[] = [ 'unregister_event_handler', ]; -// TODO(lizlooney): what about PeriodicOpMode and LinearOpMode? -export const CLASS_NAME_OPMODE = MODULE_NAME_BLOCKS_BASE_CLASSES + '.OpMode'; -export const OPMODE_METHOD_NAMES_NOT_OVERRIDEABLE: string[] = []; -// TODO(lizlooney): Make sure to update the value of PERIODIC_METHOD_NAME when we update wpilib. -export const PERIODIC_METHOD_NAME = 'loop'; +export const CLASS_NAME_OPMODE = 'wpilib_placeholders.PeriodicOpMode'; +export const OPMODE_METHOD_NAMES_NOT_OVERRIDEABLE: string[] = [ + 'GetLoopStartTime', + 'AddPeriodic', + 'GetPeriod', + 'PrintWatchdogEpochs', + 'OpModeRun', + 'OpModeStop', + 'LoopFunc', +]; +export const START_METHOD_NAME = 'Start'; +export const PERIODIC_METHOD_NAME = 'Periodic'; +export const END_METHOD_NAME = 'End'; + +export const TELEOP_DECORATOR_CLASS = MODULE_NAME_BLOCKS_BASE_CLASSES + '.Teleop'; +export const AUTO_DECORATOR_CLASS = MODULE_NAME_BLOCKS_BASE_CLASSES + '.Auto'; +export const TEST_DECORATOR_CLASS = MODULE_NAME_BLOCKS_BASE_CLASSES + '.Test'; +export const NAME_DECORATOR_CLASS = MODULE_NAME_BLOCKS_BASE_CLASSES + '.Name'; +export const GROUP_DECORATOR_CLASS = MODULE_NAME_BLOCKS_BASE_CLASSES + '.Group'; export const robotPyData = generatedRobotPyData as PythonData; const externalSamplesData = generatedExternalSamplesData as PythonData diff --git a/src/editor/extended_python_generator.ts b/src/editor/extended_python_generator.ts index db5e1427..295301fd 100644 --- a/src/editor/extended_python_generator.ts +++ b/src/editor/extended_python_generator.ts @@ -27,9 +27,14 @@ import * as eventHandler from '../blocks/mrc_event_handler'; import { STEPS_METHOD_NAME } from '../blocks/mrc_steps'; import { - MODULE_NAME_BLOCKS_BASE_CLASSES, - CLASS_NAME_OPMODE, + TELEOP_DECORATOR_CLASS, + AUTO_DECORATOR_CLASS, + TEST_DECORATOR_CLASS, + NAME_DECORATOR_CLASS, + GROUP_DECORATOR_CLASS, + START_METHOD_NAME, PERIODIC_METHOD_NAME, + END_METHOD_NAME, getClassData, } from '../blocks/utils/python'; import * as storageModule from '../storage/module'; @@ -40,15 +45,37 @@ export class OpModeDetails { let code = ''; if (this.enabled) { - const typeDecorator = generator.importModuleName(MODULE_NAME_BLOCKS_BASE_CLASSES, this.type); - code += `@${typeDecorator}\n`; + let typeDecoratorClass: string = ''; + switch (this.type) { + case 'Teleop': + typeDecoratorClass = TELEOP_DECORATOR_CLASS; + break; + case 'Auto': + typeDecoratorClass = AUTO_DECORATOR_CLASS; + break; + case 'Test': + typeDecoratorClass = TEST_DECORATOR_CLASS; + break; + } + // Import the module for the decorator, not the decorator class itself + // because otherwise the Teleop decorator collides with the class name of + // the OpMode module that is created automatically when a new project is + // created. Similarly, it is likely that the user might make an opmode + // named Test or Auto. + const lastDot = typeDecoratorClass.lastIndexOf('.'); + if (lastDot === -1) { + throw new Error(`The decorator class ${typeDecoratorClass} should contain a '.'`); + } + const moduleName = typeDecoratorClass.substring(0, lastDot); + generator.importModule(moduleName); + code += `@${typeDecoratorClass}\n`; if (this.name) { - const nameDecorator = generator.importModuleName(MODULE_NAME_BLOCKS_BASE_CLASSES, 'Name'); + const nameDecorator = generator.importModuleDotClass(NAME_DECORATOR_CLASS); code += `@${nameDecorator}(${className}, '${this.name}')\n`; } if (this.group) { - const groupDecorator = generator.importModuleName(MODULE_NAME_BLOCKS_BASE_CLASSES, 'Group'); + const groupDecorator = generator.importModuleDotClass(GROUP_DECORATOR_CLASS); code += `@${groupDecorator}(${className}, '${this.group}')\n`; } } @@ -109,9 +136,21 @@ export class ExtendedPythonGenerator extends PythonGenerator { generateInitStatements(): string { let initStatements = ''; - if (this.getModuleType() === storageModule.ModuleType.MECHANISM && this.hasAnyComponents) { - initStatements += this.INDENT + 'self.define_hardware(' + - this.getComponentPortParameters().join(', ') + ')\n'; + switch (this.getModuleType()) { + case storageModule.ModuleType.ROBOT: + initStatements += this.INDENT + 'self.hardware = []\n'; + initStatements += this.INDENT + 'self.event_handlers = {}\n'; + initStatements += this.INDENT + 'self.define_hardware()\n'; + break; + case storageModule.ModuleType.MECHANISM: + if (this.hasAnyComponents) { + initStatements += this.INDENT + 'self.define_hardware(' + + this.getComponentPortParameters().join(', ') + ')\n'; + } + break; + case storageModule.ModuleType.OPMODE: + initStatements += this.INDENT + 'self.robot = robot\n'; + break; } if (this.hasAnyEventHandlers) { @@ -212,6 +251,19 @@ export class ExtendedPythonGenerator extends PythonGenerator { return module + '.' + name; } + importModuleDotClass(moduleDotClass: string): string { + const lastDot = moduleDotClass.lastIndexOf('.'); + if (lastDot !== -1) { + const moduleName = moduleDotClass.substring(0, lastDot); + const className = moduleDotClass.substring(lastDot + 1); + if (this.fromModuleImportName(moduleName, className)) { + return className; + } + this.importModule(moduleName); + } + return moduleDotClass; + } + /** * Add a class method definition. */ @@ -239,31 +291,65 @@ export class ExtendedPythonGenerator extends PythonGenerator { : ''; let baseClassName = this.context.getBaseClassName(); - if (baseClassName.startsWith(MODULE_NAME_BLOCKS_BASE_CLASSES + '.') && - baseClassName.lastIndexOf('.') == MODULE_NAME_BLOCKS_BASE_CLASSES.length) { - const simpleName = baseClassName.substring(MODULE_NAME_BLOCKS_BASE_CLASSES.length + 1); - if (this.fromModuleImportName(MODULE_NAME_BLOCKS_BASE_CLASSES, simpleName)) { - baseClassName = simpleName; - } else { - this.importModule(MODULE_NAME_BLOCKS_BASE_CLASSES); - } - } + baseClassName = this.importModuleDotClass(baseClassName); code = decorators + 'class ' + className + '(' + baseClassName + '):\n'; - if (this.getModuleType() === storageModule.ModuleType.OPMODE) { - // If the user has a steps method, we need to generate code to call it from the periodic method. + if (this.getModuleType() === storageModule.ModuleType.ROBOT) { + // Define methods that we use for blocks, but are not in wpilib.OpModeRobot. + this.fromModuleImportName('typing', 'Callable'); + this.classMethods['register_event_handler'] = ( + 'def register_event_handler(self, event_name: str, event_handler: Callable) -> None:\n' + + this.INDENT + 'if event_name in self.event_handlers:\n' + + this.INDENT.repeat(2) + 'self.event_handlers[event_name].append(event_handler)\n' + + this.INDENT + 'else:\n' + + this.INDENT.repeat(2) + 'self.event_handlers[event_name] = [event_handler]\n' + ); + this.classMethods['unregister_event_handler'] = ( + 'def unregister_event_handler(self, event_name: str, event_handler: Callable) -> None:\n' + + this.INDENT + 'if event_name in self.event_handlers:\n' + + this.INDENT.repeat(2) + 'if event_handler in self.event_handlers[event_name]:\n' + + this.INDENT.repeat(3) + 'self.event_handlers[event_name].remove(event_handler)\n' + + this.INDENT.repeat(3) + 'if not self.event_handlers[event_name]:\n' + + this.INDENT.repeat(4) + 'del self.event_handlers[event_name]\n' + ) + this.classMethods['fire_event'] = ( + 'def fire_event(self, event_name: str, *args) -> None:\n' + + this.INDENT + 'if event_name in self.event_handlers:\n' + + this.INDENT.repeat(2) + 'for event_handler in self.event_handlers[event_name]:\n' + + this.INDENT.repeat(3) + 'event_handler(*args)\n' + ) + this.classMethods['opmode_start'] = ( + 'def opmode_start(self) -> None:\n' + + this.INDENT + 'for hardware in self.hardware:\n' + + this.INDENT.repeat(2) + 'hardware.opmode_start()\n' + ); + this.classMethods['opmode_periodic'] = ( + 'def opmode_periodic(self) -> None:\n' + + this.INDENT + 'for hardware in self.hardware:\n' + + this.INDENT.repeat(2) + 'hardware.opmode_periodic()\n' + ); + this.classMethods['opmode_end'] = ( + 'def opmode_end(self) -> None:\n' + + this.INDENT + 'for hardware in self.hardware:\n' + + this.INDENT.repeat(2) + 'hardware.opmode_end()\n' + ); + } + + if (this.getModuleType() === storageModule.ModuleType.OPMODE) { + // Add code to the Start method to call robot.opmode_start. + this.classMethods[START_METHOD_NAME] = this.insertCodeToCallRobot(START_METHOD_NAME, 'opmode_start'); + + // Add code to the Periodic method to call robot.opmode_periodic. + let periodicCode = this.insertCodeToCallRobot(PERIODIC_METHOD_NAME, 'opmode_periodic'); if (STEPS_METHOD_NAME in this.classMethods) { - let periodicCode: string; - if (PERIODIC_METHOD_NAME in this.classMethods) { - periodicCode = this.classMethods[PERIODIC_METHOD_NAME]; - } else { - periodicCode = `def ${PERIODIC_METHOD_NAME}(self):\n`; - periodicCode += this.INDENT + `super().${PERIODIC_METHOD_NAME}()\n`; - } + // Generate code to call the steps method after the user's code. periodicCode += this.INDENT + `self.${STEPS_METHOD_NAME}()\n`; - this.classMethods[PERIODIC_METHOD_NAME] = periodicCode; } + this.classMethods[PERIODIC_METHOD_NAME] = periodicCode; + + // Add code to the End method to call robot.opmode_end. + this.classMethods[END_METHOD_NAME] = this.insertCodeToCallRobot(END_METHOD_NAME, 'opmode_end'); } const classMethods = []; @@ -309,15 +395,31 @@ export class ExtendedPythonGenerator extends PythonGenerator { return super.finish(code); } + private insertCodeToCallRobot(methodName: string, robotMethodName: string): string { + const defAndSuper = `def ${methodName}(self):\n` + this.INDENT + `super().${methodName}()\n`; + let code: string; + if (methodName in this.classMethods) { + code = this.classMethods[methodName]; + // Make sure code starts with defAndSuper. + if (!code.startsWith(defAndSuper)) { + throw new Error(`The generated code for the ${methodName} method should start with ${defAndSuper}`); + } + code = code.substring(defAndSuper.length); + } else { + // The user has not defined the method. We will define it now. + code = ''; + } + // Generate code to call the robot method immediately after calling the superclass method. + return defAndSuper + this.INDENT + `self.robot.${robotMethodName}()\n` + code; + } + setOpModeDetails(opModeDetails: OpModeDetails) { this.opModeDetails = opModeDetails; } getSuperInitParameters(): string { - if (this.context?.getBaseClassName() == CLASS_NAME_OPMODE) { - return 'robot' - } - return '' + // wpilib.OpModeRobot, Mechanism, and wpilib.PeriodicOpMode all have no argument __init__ methods. + return ''; } /** diff --git a/src/modules/mechanism_start.json b/src/modules/mechanism_start.json index a20a8ef1..738c6a9f 100644 --- a/src/modules/mechanism_start.json +++ b/src/modules/mechanism_start.json @@ -24,7 +24,6 @@ "type": "mrc_class_method_def", "x": 10, "y": 230, - "deletable": false, "editable": false, "extraState": { "canChangeSignature": false, @@ -34,7 +33,7 @@ "params": [] }, "fields": { - "NAME": "update" + "NAME": "opmode_periodic" } }, { @@ -43,7 +42,7 @@ "y": 10, "deletable": false, "editable": false, - "extraState":{ + "extraState": { "hideMechanisms" : true } } diff --git a/src/modules/opmode_start.json b/src/modules/opmode_start.json index 4a6fb2ce..376edbba 100644 --- a/src/modules/opmode_start.json +++ b/src/modules/opmode_start.json @@ -46,7 +46,7 @@ "params": [] }, "fields": { - "NAME": "loop" + "NAME": "Periodic" } } ] diff --git a/src/storage/upgrade_project.ts b/src/storage/upgrade_project.ts index 51d7acc8..0fb0336f 100644 --- a/src/storage/upgrade_project.ts +++ b/src/storage/upgrade_project.ts @@ -28,12 +28,12 @@ import * as storageModuleContent from './module_content'; import * as storageNames from './names'; import * as storageProject from './project'; import { upgrade_001_to_002 } from '../blocks/mrc_mechanism_component_holder'; -import { upgrade_002_to_003, upgrade_004_to_005 } from '../blocks/mrc_class_method_def'; +import { upgrade_002_to_003, upgrade_004_to_005, upgrade_006_to_007, upgrade_007_to_008 } from '../blocks/mrc_class_method_def'; import { upgrade_005_to_006 } from '../blocks/mrc_component'; import * as workspaces from '../blocks/utils/workspaces'; export const NO_VERSION = '0.0.0'; -export const CURRENT_VERSION = '0.0.6'; +export const CURRENT_VERSION = '0.0.8'; export async function upgradeProjectIfNecessary( storage: commonStorage.Storage, projectName: string): Promise { @@ -72,6 +72,16 @@ export async function upgradeProjectIfNecessary( // @ts-ignore case '0.0.5': upgradeFrom_005_to_006(storage, projectName, projectInfo); + + // Intentional fallthrough after case '0.0.6' + // @ts-ignore + case '0.0.6': + upgradeFrom_006_to_007(storage, projectName, projectInfo); + + // Intentional fallthrough after case '0.0.7' + // @ts-ignore + case '0.0.7': + upgradeFrom_007_to_008(storage, projectName, projectInfo); } await storageProject.saveProjectInfo(storage, projectName); } @@ -141,6 +151,14 @@ function isOpMode(moduleType: storageModule.ModuleType): boolean { return moduleType === storageModule.ModuleType.OPMODE; } +/** + * Predicate function that can be passed to upgradeBlocksFiles indicating that only Mechanism + * modules should be affected. + */ +function isMechanism(moduleType: storageModule.ModuleType): boolean { + return moduleType === storageModule.ModuleType.MECHANISM; +} + /** * Predicate function that can be passed to upgradeBlocksFiles indicating that only Robot modules * should be affected. @@ -230,3 +248,27 @@ async function upgradeFrom_005_to_006( anyModuleType, upgrade_005_to_006); projectInfo.version = '0.0.6'; } + +async function upgradeFrom_006_to_007( + storage: commonStorage.Storage, + projectName: string, + projectInfo: storageProject.ProjectInfo): Promise { + // mrc_class_method_def blocks for opmode loop method need to be changed to 'Periodic'. + await upgradeBlocksFiles( + storage, projectName, + noModuleTypes, noPreupgrade, + isOpMode, upgrade_006_to_007); + projectInfo.version = '0.0.7'; +} + +async function upgradeFrom_007_to_008( + storage: commonStorage.Storage, + projectName: string, + projectInfo: storageProject.ProjectInfo): Promise { + // mrc_class_method_def blocks for mechanism update method need to be changed to 'opmode_periodic'. + await upgradeBlocksFiles( + storage, projectName, + noModuleTypes, noPreupgrade, + isMechanism, upgrade_007_to_008); + projectInfo.version = '0.0.8'; +}