Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
- "ubuntu-24.04"
- "ubuntu-24.04-arm"
- "macos-15"
- "windows-2022"
- "windows-2025"
python_version:
- "3.13"

Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
- "ubuntu-24.04-arm"
- "macos-15-intel" # x86_64
- "macos-15" # arm64
- "windows-2022"
- "windows-2025"
python_version:
- '3.11'
- '3.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(self, camera_to_object_topic: ntcore.DoubleArrayTopic) -> None:
# Here we use DifferentialDrivePoseEstimator so that we can fuse odometry readings. The
# numbers used below are robot specific, and should be tuned.
self.pose_estimator = wpimath.DifferentialDrivePoseEstimator(
self.kinematics,
self.imu.get_rotation2d(),
self.left_encoder.get_distance(),
self.right_encoder.get_distance(),
Expand Down
14 changes: 6 additions & 8 deletions examples/robot/ElevatorExponentialProfile/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,20 @@ def __init__(self) -> None:

# Create a motion profile with the given maximum voltage and characteristics kV, kA
# These gains should match your feedforward kV, kA for best results.
self.profile = wpimath.ExponentialProfileMeterVolts(
wpimath.ExponentialProfileMeterVolts.Constraints.from_characteristics(
10, 1, 1
)
self.profile = wpimath.ExponentialProfile(
wpimath.ExponentialProfile.Constraints.from_characteristics(10, 1, 1)
)
self.goal = wpimath.ExponentialProfileMeterVolts.State(0, 0)
self.setpoint = wpimath.ExponentialProfileMeterVolts.State(0, 0)
self.goal = wpimath.ExponentialProfile.State(0, 0)
self.setpoint = wpimath.ExponentialProfile.State(0, 0)

# Note: These gains are fake, and will have to be tuned for your robot.
self.motor.set_pid(1.3, 0.0, 0.7)

def teleop_periodic(self) -> None:
if self.joystick.get_raw_button_pressed(2):
self.goal = wpimath.ExponentialProfileMeterVolts.State(5, 0)
self.goal = wpimath.ExponentialProfile.State(5, 0)
elif self.joystick.get_raw_button_pressed(3):
self.goal = wpimath.ExponentialProfileMeterVolts.State(0, 0)
self.goal = wpimath.ExponentialProfile.State(0, 0)

# Retrieve the profiled setpoint for the next timestep. This setpoint moves
# toward the goal while obeying the constraints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ def __init__(self) -> None:
# This gearbox represents a gearbox containing 4 Vex 775pro motors.
self.elevator_gearbox = wpimath.DCMotor.neo(2)

self.profile = wpimath.ExponentialProfileMeterVolts(
wpimath.ExponentialProfileMeterVolts.Constraints.from_characteristics(
self.profile = wpimath.ExponentialProfile(
wpimath.ExponentialProfile.Constraints.from_characteristics(
constants.ELEVATOR_MAX_V,
constants.ELEVATOR_KV,
constants.ELEVATOR_KA,
)
)

self.setpoint = wpimath.ExponentialProfileMeterVolts.State(0, 0)
self.setpoint = wpimath.ExponentialProfile.State(0, 0)

# Standard classes for controlling our elevator
self.pid_controller = wpimath.PIDController(
Expand Down Expand Up @@ -104,7 +104,7 @@ def reach_goal(self, goal: float) -> None:

:param goal: the position to maintain
"""
goal_state = wpimath.ExponentialProfileMeterVolts.State(goal, 0)
goal_state = wpimath.ExponentialProfile.State(goal, 0)

next_state = self.profile.calculate(0.020, self.setpoint, goal_state)

Expand All @@ -126,9 +126,7 @@ def stop(self) -> None:

def reset(self) -> None:
"""Reset Exponential profile to begin from current position on enable."""
self.setpoint = wpimath.ExponentialProfileMeterVolts.State(
self.encoder.get_distance(), 0
)
self.setpoint = wpimath.ExponentialProfile.State(self.encoder.get_distance(), 0)

def update_telemetry(self) -> None:
"""Update telemetry, including the mechanism visualization."""
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/ElevatorProfiledPID/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MyRobot(wpilib.TimedRobot):
def __init__(self) -> None:
super().__init__()
self.joystick = wpilib.Joystick(1)
self.encoder = wpilib.Encoder(1, 2)
self.encoder = wpilib.Encoder(2, 3)
self.motor = wpilib.PWMSparkMax(1)

# Create a PID controller whose setpoint's change is subject to maximum
Expand Down
15 changes: 1 addition & 14 deletions examples/robot/Encoder/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,14 @@ def __init__(self):
"""Robot initialization function"""
super().__init__()

self.encoder = wpilib.Encoder(1, 2, False, wpilib.Encoder.EncodingType.X4)

# Defines the number of samples to average when determining the rate.
# On a quadrature encoder, values range from 1-255;
# larger values result in smoother but potentially
# less accurate rates than lower values.
self.encoder.set_samples_to_average(5)
self.encoder = wpilib.Encoder(2, 3, False, wpilib.Encoder.EncodingType.X4)

# Defines how far the mechanism attached to the encoder moves per pulse. In
# this case, we assume that a 360 count encoder is directly
# attached to a 3 inch diameter (1.5inch radius) wheel,
# and that we want to measure distance in inches.
self.encoder.set_distance_per_pulse(1.0 / 360.0 * 2.0 * math.pi * 1.5)

# Defines the lowest rate at which the encoder will
# not be considered stopped, for the purposes of
# the GetStopped() method. Units are in distance / second,
# where distance refers to the units of distance
# that you are using, in this case inches.
self.encoder.set_min_rate(1.0)

def teleop_periodic(self):
wpilib.SmartDashboard.put_number(
"Encoder Distance", self.encoder.get_distance()
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/SimpleDifferentialDriveSimulation/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self) -> None:
self.timer = wpilib.Timer()

# Called once at the beginning of the robot program.
self.trajectory = wpimath.TrajectoryGenerator.generate_trajectory(
self.trajectory = wpimath.DrivetrainSplineTrajectoryGenerator.generate(
wpimath.Pose2d(2, 2, wpimath.Rotation2d()),
[],
wpimath.Pose2d(6, 4, wpimath.Rotation2d()),
Expand Down
2 changes: 1 addition & 1 deletion rdev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ wrapper = "2027.0.0a6.post4"

[params]

wpilib_bin_version = "2027.0.0-alpha-6-167-gdb3a9c428"
wpilib_bin_version = "2027.0.0-alpha-6-218-g3fa405550"
wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
# wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/development-2027"

Expand Down
4 changes: 2 additions & 2 deletions snippets/robot/QuickVision/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class MyRobot(wpilib.TimedRobot):
"""
Uses the CameraServer class to automatically capture video from a USB webcam and send it to the
dashboard without doing any vision processing. This is the easiest way to get camera images
to the dashboard. Just add this to the robot_init() method in your program.
to the dashboard. Just add this to the robot class constructor.
"""

def __init__(self):
def __init__(self) -> None:
super().__init__()
CameraServer().launch()
4 changes: 2 additions & 2 deletions subprojects/robotpy-cscore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ version_file = "cscore/version.py"
artifact_id = "cscore-cpp"
group_id = "org.wpilib.cscore"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

staticlibs = ["cscore"]
extract_to = "lib"
Expand All @@ -53,7 +53,7 @@ extract_to = "lib"
artifact_id = "cameraserver-cpp"
group_id = "org.wpilib.cameraserver"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

staticlibs = ["cameraserver"]
extract_to = "lib"
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-hal/hal/_initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
if _sse:
_wpi_hal.set_show_extensions_not_found_messages(False)

_wpi_hal.initialize(500, 0)
_wpi_hal.initialize()
25 changes: 25 additions & 0 deletions subprojects/robotpy-hal/semiwrap/UsageReporting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,28 @@ functions:
overloads:
std::string_view, std::string_view:
std::string_view, int, std::string_view:
HAL_PublishCanVersion:
overloads:
uint8_t, uint32_t, std::string_view, std::string_view:
cpp_code: |
[](uint8_t busId, uint32_t deviceId, std::string_view name,
std::string_view version) {
py::gil_scoped_release release;
return HAL_PublishCanVersion(busId, deviceId, name, version);
}
HAL_PublishVersion:
overloads:
std::string_view, std::string_view:
cpp_code: |
[](std::string_view name, std::string_view version) {
py::gil_scoped_release release;
return HAL_PublishVersion(name, version);
}
HAL_PublishWpilibVersion:
overloads:
std::string_view:
cpp_code: |
[](std::string_view version) {
py::gil_scoped_release release;
return HAL_PublishWpilibVersion(version);
}
2 changes: 1 addition & 1 deletion subprojects/robotpy-halsim-ds-socket/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ version_file = "halsim_ds_socket/version.py"
artifact_id = "halsim_ds_socket"
group_id = "org.wpilib.halsim"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"
use_headers = false

extract_to = "halsim_ds_socket"
Expand Down
4 changes: 2 additions & 2 deletions subprojects/robotpy-halsim-ws/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ version_file = "halsim_ws/version.py"
artifact_id = "halsim_ws_server"
group_id = "org.wpilib.halsim"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"
use_headers = false

extract_to = "halsim_ws/server"
Expand All @@ -45,7 +45,7 @@ libs = ["halsim_ws_server"]
artifact_id = "halsim_ws_client"
group_id = "org.wpilib.halsim"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"
use_headers = false

extract_to = "halsim_ws/client"
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-apriltag/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ packages = ["src/native"]
artifact_id = "apriltag-cpp"
group_id = "org.wpilib.apriltag"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/apriltag"
libs = ["apriltag"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-datalog/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ packages = ["src/native"]
artifact_id = "datalog-cpp"
group_id = "org.wpilib.datalog"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/datalog"
libs = ["datalog"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-halsim-gui/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ packages = ["src/native"]
artifact_id = "halsim_gui"
group_id = "org.wpilib.halsim"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"
use_headers = true

extract_to = "src/native/halsim_gui"
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-ntcore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ packages = ["src/native"]
artifact_id = "ntcore-cpp"
group_id = "org.wpilib.ntcore"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/ntcore"
libs = ["ntcore"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-romi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ packages = ["src/native"]
artifact_id = "romiVendordep-cpp"
group_id = "org.wpilib.romiVendordep"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/romi"
libs = ["romiVendordep"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-wpihal/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ packages = ["src/native"]
artifact_id = "hal-cpp"
group_id = "org.wpilib.hal"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/wpihal"
libs = ["wpiHal"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-wpilib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ packages = ["src/native"]
artifact_id = "wpilibc-cpp"
group_id = "org.wpilib.wpilibc"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/wpilib"
libs = ["wpilibc"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-wpimath/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ packages = ["src/native"]
artifact_id = "wpimath-cpp"
group_id = "org.wpilib.wpimath"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/wpimath"
libs = ["wpimath"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-wpinet/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ packages = ["src/native"]
artifact_id = "wpinet-cpp"
group_id = "org.wpilib.wpinet"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/wpinet"
libs = ["wpinet"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-wpiutil/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ packages = ["src/native"]
artifact_id = "wpiutil-cpp"
group_id = "org.wpilib.wpiutil"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/wpiutil"
libs = ["wpiutil"]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-native-xrp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ packages = ["src/native"]
artifact_id = "xrpVendordep-cpp"
group_id = "org.wpilib.xrpVendordep"
repo_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
version = "2027.0.0-alpha-6-167-gdb3a9c428"
version = "2027.0.0-alpha-6-218-g3fa405550"

extract_to = "src/native/xrp"
libs = ["xrpVendordep"]
Expand Down
2 changes: 0 additions & 2 deletions subprojects/robotpy-wpilib/semiwrap/CounterBase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ classes:
CounterBase:
Get:
Reset:
GetPeriod:
SetMaxPeriod:
GetStopped:
GetDirection:
8 changes: 6 additions & 2 deletions subprojects/robotpy-wpilib/semiwrap/DifferentialDrive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ classes:
import wpilib.drive

class Robot(wpilib.TimedRobot):
def robotInit(self):
def __init__(self) -> None:
super().__init__()

self.front_left = wpilib.PWMVictorSPX(1)
self.rear_left = wpilib.PWMVictorSPX(2)
self.left = wpilib.MotorControllerGroup(self.front_left, self.rear_left)
Expand All @@ -53,7 +55,9 @@ classes:
import wpilib.drive

class Robot(wpilib.TimedRobot):
def robotInit(self):
def __init__(self) -> None:
super().__init__()

self.front_left = wpilib.PWMVictorSPX(1)
self.mid_left = wpilib.PWMVictorSPX(2)
self.rear_left = wpilib.PWMVictorSPX(3)
Expand Down
5 changes: 0 additions & 5 deletions subprojects/robotpy-wpilib/semiwrap/Encoder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,15 @@ classes:
default: wpi::Encoder::EncodingType::X4
Get:
Reset:
GetPeriod:
SetMaxPeriod:
GetStopped:
GetDirection:
GetRaw:
GetEncodingScale:
GetDistance:
GetRate:
SetMinRate:
SetDistancePerPulse:
GetDistancePerPulse:
SetReverseDirection:
SetSamplesToAverage:
GetSamplesToAverage:
SetSimDevice:
GetFPGAIndex:
InitSendable:
Loading
Loading