mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpimath] Reorganize LinearSystem factories (#8468)
This commit is contained in:
@@ -1560,17 +1560,15 @@ SplineHelper = "wpi/math/spline/SplineHelper.hpp"
|
||||
SplineParameterizer = "wpi/math/spline/SplineParameterizer.hpp"
|
||||
|
||||
# wpi/math/system
|
||||
DCMotor = "wpi/math/system/DCMotor.hpp"
|
||||
# Discretization = "wpi/math/system/Discretization.hpp"
|
||||
LinearSystem = "wpi/math/system/LinearSystem.hpp"
|
||||
LinearSystemLoop = "wpi/math/system/LinearSystemLoop.hpp"
|
||||
# LinearSystemUtil = "wpi/math/system/LinearSystemUtil.hpp"
|
||||
Models = "wpi/math/system/Models.hpp"
|
||||
# NumericalIntegration = "wpi/math/system/NumericalIntegration.hpp"
|
||||
# NumericalJacobian = "wpi/math/system/NumericalJacobian.hpp"
|
||||
|
||||
# wpi/math/system/plant
|
||||
DCMotor = "wpi/math/system/plant/DCMotor.hpp"
|
||||
LinearSystemId = "wpi/math/system/plant/LinearSystemId.hpp"
|
||||
|
||||
# wpi/math/trajectory
|
||||
ExponentialProfile = "wpi/math/trajectory/ExponentialProfile.hpp"
|
||||
Trajectory = "wpi/math/trajectory/Trajectory.hpp"
|
||||
|
||||
@@ -10,10 +10,6 @@ classes:
|
||||
wpi::units::volt_t, wpi::units::volt_t, wpi::units::unit_t<kv_unit>, wpi::units::unit_t<ka_unit>:
|
||||
Calculate:
|
||||
overloads:
|
||||
wpi::units::unit_t<Velocity>, wpi::units::unit_t<Acceleration> [const]:
|
||||
ignore: true
|
||||
wpi::units::unit_t<Velocity>, wpi::units::unit_t<Velocity>, wpi::units::second_t [const]:
|
||||
ignore: true
|
||||
wpi::units::unit_t<Velocity> [const]:
|
||||
wpi::units::unit_t<Velocity>, wpi::units::unit_t<Velocity> [const]:
|
||||
MaxAchievableVelocity:
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
classes:
|
||||
wpi::math::LinearSystemId:
|
||||
typealias:
|
||||
- kv_meters = wpi::units::unit_t<wpi::units::compound_unit<wpi::units::volts, wpi::units::inverse<wpi::units::meters_per_second>>>
|
||||
- kv_radians = wpi::units::unit_t<wpi::units::compound_unit<wpi::units::volts, wpi::units::inverse<wpi::units::radians_per_second>>>
|
||||
- ka_meters = wpi::units::unit_t<wpi::units::compound_unit<wpi::units::volts, wpi::units::inverse<wpi::units::meters_per_second_squared>>>
|
||||
- ka_radians = wpi::units::unit_t<wpi::units::compound_unit<wpi::units::volts, wpi::units::inverse<wpi::units::radians_per_second_squared>>>
|
||||
methods:
|
||||
ElevatorSystem:
|
||||
SingleJointedArmSystem:
|
||||
IdentifyVelocitySystem:
|
||||
rename: identifyVelocitySystemMeters
|
||||
cpp_code: |
|
||||
[](kv_meters kV, ka_meters kA) {
|
||||
return wpi::math::LinearSystemId::IdentifyVelocitySystem<wpi::units::meter>(kV, kA);
|
||||
}
|
||||
IdentifyPositionSystem:
|
||||
rename: identifyPositionSystemMeters
|
||||
cpp_code: |
|
||||
[](kv_meters kV, ka_meters kA) {
|
||||
return wpi::math::LinearSystemId::IdentifyPositionSystem<wpi::units::meter>(kV, kA);
|
||||
}
|
||||
IdentifyDrivetrainSystem:
|
||||
overloads:
|
||||
decltype(1_V/1_mps), decltype(1_V/1_mps_sq), decltype(1_V/1_mps), decltype(1_V/1_mps_sq):
|
||||
cpp_code: |
|
||||
[](kv_meters kVlinear, ka_meters kAlinear, kv_meters kVangular, ka_meters kAangular) {
|
||||
return wpi::math::LinearSystemId::IdentifyDrivetrainSystem(kVlinear, kAlinear, kVangular, kAangular);
|
||||
}
|
||||
decltype(1_V/1_mps), decltype(1_V/1_mps_sq), decltype(1_V/1_rad_per_s), decltype(1_V/1_rad_per_s_sq), wpi::units::meter_t:
|
||||
cpp_code: |
|
||||
[](kv_meters kVlinear, ka_meters kAlinear, kv_radians kVangular, ka_radians kAangular, wpi::units::meter_t trackWidth) {
|
||||
return wpi::math::LinearSystemId::IdentifyDrivetrainSystem(kVlinear, kAlinear, kVangular, kAangular, trackWidth);
|
||||
}
|
||||
FlywheelSystem:
|
||||
DCMotorSystem:
|
||||
overloads:
|
||||
DCMotor, wpi::units::kilogram_square_meter_t, double:
|
||||
decltype(1_V/Velocity_t<Distance> (1)), decltype(1_V/Acceleration_t<Distance> (1)):
|
||||
cpp_code: |
|
||||
[](kv_meters kv, ka_meters ka) {
|
||||
return wpi::math::LinearSystemId::DCMotorSystem<wpi::units::meter>(kv, ka);
|
||||
}
|
||||
DrivetrainVelocitySystem:
|
||||
|
||||
inline_code: |
|
||||
.def_static("DCMotorSystemRadians", [](kv_radians kV, ka_radians kA) {
|
||||
return wpi::math::LinearSystemId::DCMotorSystem<wpi::units::radian>(kV, kA);
|
||||
}, py::arg("kV"), py::arg("kA"), release_gil()
|
||||
)
|
||||
|
||||
.def_static("identifyVelocitySystemRadians", [](kv_radians kV, ka_radians kA) {
|
||||
return wpi::math::LinearSystemId::IdentifyVelocitySystem<wpi::units::radian>(kV, kA);
|
||||
}, py::arg("kV"), py::arg("kA"), release_gil()
|
||||
)
|
||||
.def_static("identifyPositionSystemRadians", [](kv_radians kV, ka_radians kA) {
|
||||
return wpi::math::LinearSystemId::IdentifyPositionSystem<wpi::units::radian>(kV, kA);
|
||||
}, py::arg("kV"), py::arg("kA"), release_gil()
|
||||
)
|
||||
14
wpimath/src/main/python/semiwrap/Models.yml
Normal file
14
wpimath/src/main/python/semiwrap/Models.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
classes:
|
||||
wpi::math::Models:
|
||||
methods:
|
||||
FlywheelFromPhysicalConstants:
|
||||
FlywheelFromSysId:
|
||||
ElevatorFromPhysicalConstants:
|
||||
ElevatorFromSysId:
|
||||
SingleJointedArmFromPhysicalConstants:
|
||||
SingleJointedArmFromSysId:
|
||||
DifferentialDriveFromPhysicalConstants:
|
||||
DifferentialDriveFromSysId:
|
||||
overloads:
|
||||
decltype(1_V/1_mps), decltype(1_V/1_mps_sq), decltype(1_V/1_mps), decltype(1_V/1_mps_sq):
|
||||
decltype(1_V/1_mps), decltype(1_V/1_mps_sq), decltype(1_V/1_rad_per_s), decltype(1_V/1_rad_per_s_sq), wpi::units::meter_t:
|
||||
@@ -60,7 +60,6 @@ from ._wpimath import (
|
||||
LinearQuadraticRegulator_2_1,
|
||||
LinearQuadraticRegulator_2_2,
|
||||
LinearQuadraticRegulator_3_2,
|
||||
LinearSystemId,
|
||||
LinearSystemLoop_1_1_1,
|
||||
LinearSystemLoop_2_1_1,
|
||||
LinearSystemLoop_2_1_2,
|
||||
@@ -94,6 +93,7 @@ from ._wpimath import (
|
||||
MecanumDriveWheelPositions,
|
||||
MecanumDriveWheelSpeeds,
|
||||
MedianFilter,
|
||||
Models,
|
||||
PIDController,
|
||||
Pose2d,
|
||||
Pose3d,
|
||||
@@ -247,7 +247,6 @@ __all__ = [
|
||||
"LinearQuadraticRegulator_2_1",
|
||||
"LinearQuadraticRegulator_2_2",
|
||||
"LinearQuadraticRegulator_3_2",
|
||||
"LinearSystemId",
|
||||
"LinearSystemLoop_1_1_1",
|
||||
"LinearSystemLoop_2_1_1",
|
||||
"LinearSystemLoop_2_1_2",
|
||||
@@ -281,6 +280,7 @@ __all__ = [
|
||||
"MecanumDriveWheelPositions",
|
||||
"MecanumDriveWheelSpeeds",
|
||||
"MedianFilter",
|
||||
"Models",
|
||||
"PIDController",
|
||||
"Pose2d",
|
||||
"Pose3d",
|
||||
|
||||
Reference in New Issue
Block a user