mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[copybara] mostrobotpy to allwpilib (#8503)
Resync with `mostrobotpy` This mostly involves the big "ignore almost everything in the HAL project" and some fixups for the Addressable LED classes. Required two small hand fixes to get it building over here with bazel, and with more compiler warnings on. I also manually zeroed out the `repo_url` field in the toml files to avoid unnecessary churn whenever it goes from a release build to a development build. I already did this with `version` field in there, and will do a follow up PR that updates the copybara script to do it automatically. --------- Co-authored-by: Default email <default@default.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
# validated: 2024-01-20 DS 92149efa11fa button/CommandGenericHID.java
|
||||
from typing import Optional
|
||||
|
||||
from wpilib.event import EventLoop
|
||||
from wpilib.interfaces import GenericHID
|
||||
from wpilib import EventLoop, GenericHID
|
||||
|
||||
from ..commandscheduler import CommandScheduler
|
||||
from .trigger import Trigger
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# validated: 2024-01-20 DS 92aecab2ef05 button/CommandJoystick.java
|
||||
from typing import Optional
|
||||
|
||||
from wpilib import Joystick
|
||||
from wpilib.event import EventLoop
|
||||
from wpilib import EventLoop, Joystick
|
||||
|
||||
from ..commandscheduler import CommandScheduler
|
||||
from .commandgenerichid import CommandGenericHID
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# validated: 2024-01-20 DS d426873ed15b button/CommandPS4Controller.java
|
||||
from typing import Optional
|
||||
|
||||
from wpilib import PS4Controller
|
||||
from wpilib.event import EventLoop
|
||||
from wpilib import EventLoop, PS4Controller
|
||||
|
||||
from ..commandscheduler import CommandScheduler
|
||||
from .commandgenerichid import CommandGenericHID
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# validated: 2024-01-20 DS 3ba501f9478a button/CommandXboxController.java
|
||||
from typing import Optional
|
||||
|
||||
from wpilib import XboxController
|
||||
from wpilib.event import EventLoop
|
||||
from wpilib import EventLoop, XboxController
|
||||
|
||||
from ..commandscheduler import CommandScheduler
|
||||
from .commandgenerichid import CommandGenericHID
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# validated: 2024-01-20 DS 7a099cb02a33 button/JoystickButton.java
|
||||
from wpilib.interfaces import GenericHID
|
||||
from wpilib import GenericHID
|
||||
|
||||
from .trigger import Trigger
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# validated: 2024-01-20 DS 7a099cb02a33 button/POVButton.java
|
||||
from wpilib.interfaces import GenericHID
|
||||
from wpilib import GenericHID
|
||||
|
||||
from .trigger import Trigger
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ from types import SimpleNamespace
|
||||
from typing import Callable, overload
|
||||
|
||||
from typing_extensions import Self
|
||||
from wpilib.event import EventLoop
|
||||
from wpimath.filter import Debouncer
|
||||
from wpilib import EventLoop
|
||||
from wpimath import Debouncer
|
||||
|
||||
from ..command import Command
|
||||
from ..commandscheduler import CommandScheduler
|
||||
|
||||
@@ -11,11 +11,11 @@ from typing_extensions import Self
|
||||
from wpilib import (
|
||||
RobotBase,
|
||||
DriverStation,
|
||||
EventLoop,
|
||||
TimedRobot,
|
||||
Watchdog,
|
||||
reportWarning,
|
||||
)
|
||||
from wpilib.event import EventLoop
|
||||
from wpiutil import Sendable, SendableBuilder, SendableRegistry
|
||||
|
||||
from .command import Command, InterruptionBehavior
|
||||
|
||||
@@ -9,7 +9,7 @@ from typing import Any, Callable, Union
|
||||
from .command import Command
|
||||
from .subsystem import Subsystem
|
||||
|
||||
from wpimath.controller import PIDController
|
||||
from wpimath import PIDController
|
||||
|
||||
|
||||
class PIDCommand(Command):
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# the WPILib BSD license file in the root directory of this project.
|
||||
from __future__ import annotations
|
||||
|
||||
from wpimath.controller import PIDController
|
||||
from wpimath import PIDController
|
||||
|
||||
from .subsystem import Subsystem
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
from typing import Any, Generic
|
||||
|
||||
from wpimath.controller import ProfiledPIDController, ProfiledPIDControllerRadians
|
||||
from wpimath.trajectory import TrapezoidProfile, TrapezoidProfileRadians
|
||||
from wpimath import ProfiledPIDController, ProfiledPIDControllerRadians, TrapezoidProfile, TrapezoidProfileRadians
|
||||
|
||||
from .command import Command
|
||||
from .subsystem import Subsystem
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
from typing import Generic
|
||||
|
||||
from wpimath.trajectory import TrapezoidProfile
|
||||
from wpimath import TrapezoidProfile
|
||||
|
||||
from .subsystem import Subsystem
|
||||
from .typing import TProfiledPIDController, TTrapezoidProfileState
|
||||
|
||||
@@ -8,8 +8,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any, Union
|
||||
|
||||
from wpimath import units
|
||||
from wpimath.trajectory import TrapezoidProfile, TrapezoidProfileRadians
|
||||
from wpimath import TrapezoidProfile, TrapezoidProfileRadians, units
|
||||
|
||||
|
||||
from .subsystem import Subsystem
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
from typing import Callable, Protocol, TypeVar, Union
|
||||
|
||||
from typing_extensions import TypeAlias
|
||||
from wpimath.controller import ProfiledPIDController, ProfiledPIDControllerRadians
|
||||
from wpimath.trajectory import TrapezoidProfile, TrapezoidProfileRadians
|
||||
from wpimath import ProfiledPIDController, ProfiledPIDControllerRadians, TrapezoidProfile, TrapezoidProfileRadians
|
||||
|
||||
# Generic Types
|
||||
TProfiledPIDController = TypeVar(
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from util import * # type: ignore
|
||||
import wpimath.controller as controller
|
||||
import commands2
|
||||
|
||||
import wpimath
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .util import *
|
||||
|
||||
@@ -15,7 +16,7 @@ def test_pidCommandSupplier(scheduler: commands2.CommandScheduler):
|
||||
output_float = OOFloat(0.0)
|
||||
measurement_source = OOFloat(5.0)
|
||||
setpoint_source = OOFloat(2.0)
|
||||
pid_controller = controller.PIDController(0.1, 0.01, 0.001)
|
||||
pid_controller = wpimath.PIDController(0.1, 0.01, 0.001)
|
||||
system = commands2.Subsystem()
|
||||
pidCommand = commands2.PIDCommand(
|
||||
pid_controller,
|
||||
@@ -50,7 +51,7 @@ def test_pidCommandScalar(scheduler: commands2.CommandScheduler):
|
||||
output_float = OOFloat(0.0)
|
||||
measurement_source = OOFloat(5.0)
|
||||
setpoint_source = 2.0
|
||||
pid_controller = controller.PIDController(0.1, 0.01, 0.001)
|
||||
pid_controller = wpimath.PIDController(0.1, 0.01, 0.001)
|
||||
system = commands2.Subsystem()
|
||||
pidCommand = commands2.PIDCommand(
|
||||
pid_controller,
|
||||
@@ -85,7 +86,7 @@ def test_withTimeout(scheduler: commands2.CommandScheduler):
|
||||
output_float = OOFloat(0.0)
|
||||
measurement_source = OOFloat(5.0)
|
||||
setpoint_source = OOFloat(2.0)
|
||||
pid_controller = controller.PIDController(0.1, 0.01, 0.001)
|
||||
pid_controller = wpimath.PIDController(0.1, 0.01, 0.001)
|
||||
system = commands2.Subsystem()
|
||||
command1 = commands2.PIDCommand(
|
||||
pid_controller,
|
||||
|
||||
@@ -2,8 +2,7 @@ from types import MethodType
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from wpimath.controller import ProfiledPIDController, ProfiledPIDControllerRadians
|
||||
from wpimath.trajectory import TrapezoidProfile, TrapezoidProfileRadians
|
||||
from wpimath import ProfiledPIDController, ProfiledPIDControllerRadians, TrapezoidProfile, TrapezoidProfileRadians
|
||||
|
||||
from commands2 import ProfiledPIDSubsystem
|
||||
|
||||
|
||||
@@ -5,12 +5,7 @@
|
||||
from typing import TYPE_CHECKING, List, Tuple
|
||||
import math
|
||||
|
||||
import wpimath.controller as controller
|
||||
import wpimath.trajectory as trajectory
|
||||
import wpimath.geometry as geometry
|
||||
import wpimath.kinematics as kinematics
|
||||
from wpimath.trajectory import TrapezoidProfile as DimensionlessProfile
|
||||
from wpimath.trajectory import TrapezoidProfileRadians as RadiansProfile
|
||||
from wpimath import TrapezoidProfile as DimensionlessProfile, TrapezoidProfileRadians as RadiansProfile
|
||||
|
||||
from wpilib import Timer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user