Skip to content

Commit 9caf4fe

Browse files
committed
Flatten wpimath namespaces
1 parent 439d385 commit 9caf4fe

File tree

137 files changed

+433
-830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+433
-830
lines changed

docs/conf.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,6 @@
7474

7575
# WPIMath
7676
gen_package(root, "wpimath")
77-
gen_package(root, "wpimath.controller")
78-
gen_package(root, "wpimath.estimator")
79-
gen_package(root, "wpimath.filter")
80-
gen_package(root, "wpimath.geometry")
81-
gen_package(root, "wpimath.interpolation")
82-
gen_package(root, "wpimath.kinematics")
83-
gen_package(root, "wpimath.optimization")
84-
gen_package(root, "wpimath.path")
85-
gen_package(root, "wpimath.spline")
86-
gen_package(root, "wpimath.system")
87-
gen_package(root, "wpimath.system.plant")
88-
gen_package(root, "wpimath.trajectory")
89-
gen_package(root, "wpimath.trajectory.constraint")
9077

9178
# WPINet
9279
gen_package(root, "wpinet")

subprojects/robotpy-apriltag/tests/test_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import cv2
22
import robotpy_apriltag
3-
from wpimath.geometry import Transform3d
3+
from wpimath import Transform3d
44

55
import math
66
import pathlib

subprojects/robotpy-romi/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ update_init = ["romi"]
4545
name = "romi"
4646
wraps = ["robotpy-native-romi"]
4747
depends = [
48-
"wpilib", "wpimath_geometry"
48+
"wpilib", "wpimath"
4949
]
5050

5151
[tool.semiwrap.extension_modules."romi._romi".headers]

subprojects/robotpy-wpilib/pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ scan_headers_ignore = [
7474
name = "wpilib"
7575
wraps = ["robotpy-native-wpilib"]
7676
depends = [
77-
"wpihal", "wpiutil", "ntcore",
78-
"wpimath", "wpimath_geometry", "wpimath_controls", "wpimath_filter",
77+
"wpihal", "wpiutil", "ntcore", "wpimath"
7978
]
8079
includes = ["wpilib/src"]
8180

@@ -227,7 +226,7 @@ SensorUtil = "wpi/util/SensorUtil.hpp"
227226
[tool.semiwrap.extension_modules."wpilib.simulation._simulation"]
228227
name = "wpilib_simulation"
229228
wraps = ["robotpy-native-wpilib"]
230-
depends = ["wpilib", "wpimath_controls", "wpimath_geometry", "wpimath_kinematics"]
229+
depends = ["wpilib", "wpimath"]
231230
yaml_path = "semiwrap/simulation"
232231

233232
[tool.semiwrap.extension_modules."wpilib.simulation._simulation".headers]

subprojects/robotpy-wpilib/wpilib/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
from . import _init__wpilib
22

3-
# TODO: robotpy-build subpackage bug
4-
from wpimath._controls._controls import trajectory as _
5-
63
# autogenerated by 'semiwrap create-imports wpilib wpilib._wpilib'
74
from ._wpilib import (
85
ADXL345_I2C,

subprojects/robotpy-wpilib/wpilib/simulation/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
from . import _init__simulation
22

3-
# needed for dcmotor return value, TODO fix in robotpy-build
4-
from wpimath._controls._controls import plant as _
5-
63
# autogenerated by 'semiwrap create-imports wpilib.simulation wpilib.simulation._simulation'
74
from ._simulation import (
85
ADXL345Sim,

subprojects/robotpy-wpimath/.gitignore

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,7 @@ MANIFEST
2222
/wpimath/wpimath.pc
2323
/wpimath/wpimath-casters.pc
2424
/wpimath/wpimath-casters.pybind11.json
25-
/wpimath/_controls/_init__controls.py
26-
/wpimath/_controls/wpimath_controls.pc
27-
/wpimath/_controls/trampolines/
28-
/wpimath/filter/_init__filter.py
29-
/wpimath/filter/wpimath_filter.pc
30-
/wpimath/filter/trampolines/
31-
/wpimath/geometry/_init__geometry.py
32-
/wpimath/geometry/wpimath_geometry.pc
33-
/wpimath/geometry/trampolines/
34-
/wpimath/interfaces/_init__interfaces.py
35-
/wpimath/interpolation/_init__interpolation.py
36-
/wpimath/interpolation/wpimath_interpolation.pc
37-
/wpimath/interpolation/trampolines/
38-
/wpimath/kinematics/_init__kinematics.py
39-
/wpimath/kinematics/wpimath_kinematics.pc
40-
/wpimath/kinematics/trampolines/
41-
/wpimath/spline/_init__spline.py
42-
/wpimath/spline/wpimath_spline.pc
43-
/wpimath/spline/trampolines/
44-
/wpimath/trajectory/_init__trajectory.py
45-
25+
/wpimath/trampolines
4626
rpy-include
4727
/wpimath/_impl/_init_wpimath_cpp.py
4828
/wpimath/_impl/pkgcfg.py

subprojects/robotpy-wpimath/meson.build

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,4 @@ wpimath_sources += files(
88
'wpimath/src/wpimath.cpp',
99
)
1010

11-
wpimath_controls_sources += files(
12-
'wpimath/_controls/controls.cpp',
13-
)
14-
15-
wpimath_filter_sources += files(
16-
'wpimath/filter/filter.cpp',
17-
)
18-
19-
wpimath_geometry_sources += files(
20-
'wpimath/geometry/geometry.cpp',
21-
)
22-
23-
wpimath_interpolation_sources += files(
24-
'wpimath/interpolation/interpolation.cpp',
25-
)
26-
27-
wpimath_kinematics_sources += files(
28-
'wpimath/kinematics/kinematics.cpp',
29-
)
30-
31-
wpimath_spline_sources += files(
32-
'wpimath/spline/spline.cpp',
33-
)
34-
3511
subdir('semiwrap/modules')

subprojects/robotpy-wpimath/pyproject.toml

Lines changed: 39 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,6 @@ packages = ["wpimath"]
4141
[tool.semiwrap]
4242
update_init = [
4343
"wpimath",
44-
"wpimath.controller wpimath._controls._controls.controller",
45-
"wpimath.estimator wpimath._controls._controls.estimator",
46-
"wpimath.filter",
47-
"wpimath.geometry",
48-
"wpimath.kinematics",
49-
"wpimath.interpolation",
50-
"wpimath.optimization wpimath._controls._controls.optimization",
51-
"wpimath.path wpimath._controls._controls.path",
52-
"wpimath.spline",
53-
"wpimath.system wpimath._controls._controls.system",
54-
"wpimath.trajectory wpimath._controls._controls.trajectory",
55-
"wpimath.trajectory.constraint wpimath._controls._controls.constraint",
5644
]
5745

5846
scan_headers_ignore = [
@@ -104,7 +92,7 @@ scan_headers_ignore = [
10492

10593
"wpi/math/util/MathShared.hpp",
10694

107-
"rpy/geometryToString.h",
95+
"geometryToString.h",
10896
"PyTrajectoryConstraint.h",
10997
"_units_base_type_caster.h",
11098
]
@@ -1465,35 +1453,53 @@ includes = ["wpimath/_impl/src"]
14651453
depends = ["wpiutil", "wpimath-casters"]
14661454

14671455
[tool.semiwrap.extension_modules."wpimath._wpimath".headers]
1468-
# frc
1456+
# wpi/math/util
14691457
ComputerVisionUtil = "wpi/math/util/ComputerVisionUtil.hpp"
14701458
# DARE = "wpi/math/linalg/DARE.hpp"
14711459
# EigenCore = "wpi/math/linalg/EigenCore.hpp"
14721460
MathUtil = "wpi/math/util/MathUtil.hpp"
14731461
# StateSpaceUtil = "wpi/math/util/StateSpaceUtil.hpp"
14741462

1463+
# wpi/math/controller
1464+
ArmFeedforward = "wpi/math/controller/ArmFeedforward.hpp"
1465+
BangBangController = "wpi/math/controller/BangBangController.hpp"
1466+
ControlAffinePlantInversionFeedforward = "wpi/math/controller/ControlAffinePlantInversionFeedforward.hpp"
1467+
DifferentialDriveAccelerationLimiter = "wpi/math/controller/DifferentialDriveAccelerationLimiter.hpp"
1468+
DifferentialDriveFeedforward = "wpi/math/controller/DifferentialDriveFeedforward.hpp"
1469+
DifferentialDriveWheelVoltages = "wpi/math/controller/DifferentialDriveWheelVoltages.hpp"
1470+
ElevatorFeedforward = "wpi/math/controller/ElevatorFeedforward.hpp"
1471+
ImplicitModelFollower = "wpi/math/controller/ImplicitModelFollower.hpp"
1472+
LTVDifferentialDriveController = "wpi/math/controller/LTVDifferentialDriveController.hpp"
1473+
LTVUnicycleController = "wpi/math/controller/LTVUnicycleController.hpp"
1474+
LinearPlantInversionFeedforward = "wpi/math/controller/LinearPlantInversionFeedforward.hpp"
1475+
LinearQuadraticRegulator = "wpi/math/controller/LinearQuadraticRegulator.hpp"
1476+
PIDController = "wpi/math/controller/PIDController.hpp"
1477+
ProfiledPIDController = "wpi/math/controller/ProfiledPIDController.hpp"
1478+
SimpleMotorFeedforward = "wpi/math/controller/SimpleMotorFeedforward.hpp"
14751479

1476-
[tool.semiwrap.extension_modules."wpimath.filter._filter"]
1477-
name = "wpimath_filter"
1478-
wraps = ["robotpy-native-wpimath"]
1479-
depends = ["wpimath"]
1480-
yaml_path = "semiwrap/filter"
1480+
# wpi/math/estimator
1481+
# AngleStatistics = "wpi/math/estimator/AngleStatistics.hpp"
1482+
DifferentialDrivePoseEstimator = "wpi/math/estimator/DifferentialDrivePoseEstimator.hpp"
1483+
DifferentialDrivePoseEstimator3d = "wpi/math/estimator/DifferentialDrivePoseEstimator3d.hpp"
1484+
ExtendedKalmanFilter = "wpi/math/estimator/ExtendedKalmanFilter.hpp"
1485+
KalmanFilter = "wpi/math/estimator/KalmanFilter.hpp"
1486+
# KalmanFilterLatencyCompensator = "wpi/math/estimator/KalmanFilterLatencyCompensator.hpp"
1487+
MecanumDrivePoseEstimator = "wpi/math/estimator/MecanumDrivePoseEstimator.hpp"
1488+
MecanumDrivePoseEstimator3d = "wpi/math/estimator/MecanumDrivePoseEstimator3d.hpp"
1489+
# MerweScaledSigmaPoints = "wpi/math/estimator/MerweScaledSigmaPoints.hpp"
1490+
PoseEstimator = "wpi/math/estimator/PoseEstimator.hpp"
1491+
PoseEstimator3d = "wpi/math/estimator/PoseEstimator3d.hpp"
1492+
SwerveDrivePoseEstimator = "wpi/math/estimator/SwerveDrivePoseEstimator.hpp"
1493+
SwerveDrivePoseEstimator3d = "wpi/math/estimator/SwerveDrivePoseEstimator3d.hpp"
1494+
# UnscentedKalmanFilter = "wpi/math/estimator/UnscentedKalmanFilter.hpp"
1495+
# UnscentedTransform = "wpi/math/estimator/UnscentedTransform.hpp"
14811496

1482-
[tool.semiwrap.extension_modules."wpimath.filter._filter".headers]
1497+
# wpi/math/filter
14831498
Debouncer = "wpi/math/filter/Debouncer.hpp"
14841499
LinearFilter = "wpi/math/filter/LinearFilter.hpp"
14851500
MedianFilter = "wpi/math/filter/MedianFilter.hpp"
14861501
SlewRateLimiter = "wpi/math/filter/SlewRateLimiter.hpp"
14871502

1488-
1489-
[tool.semiwrap.extension_modules."wpimath.geometry._geometry"]
1490-
name = "wpimath_geometry"
1491-
wraps = ["robotpy-native-wpimath"]
1492-
depends = ["wpimath"]
1493-
includes = ["wpimath/geometry/include"]
1494-
yaml_path = "semiwrap/geometry"
1495-
1496-
[tool.semiwrap.extension_modules."wpimath.geometry._geometry".headers]
14971503
# wpi/math/geometry
14981504
CoordinateAxis = "wpi/math/geometry/CoordinateAxis.hpp"
14991505
CoordinateSystem = "wpi/math/geometry/CoordinateSystem.hpp"
@@ -1511,24 +1517,9 @@ Translation3d = "wpi/math/geometry/Translation3d.hpp"
15111517
Twist2d = "wpi/math/geometry/Twist2d.hpp"
15121518
Twist3d = "wpi/math/geometry/Twist3d.hpp"
15131519

1514-
[tool.semiwrap.extension_modules."wpimath.interpolation._interpolation"]
1515-
name = "wpimath_interpolation"
1516-
wraps = ["robotpy-native-wpimath"]
1517-
depends = ["wpimath_geometry"]
1518-
yaml_path = "semiwrap/interpolation"
1519-
1520-
[tool.semiwrap.extension_modules."wpimath.interpolation._interpolation".headers]
15211520
# wpi/math/interpolation
15221521
TimeInterpolatableBuffer = "wpi/math/interpolation/TimeInterpolatableBuffer.hpp"
15231522

1524-
1525-
[tool.semiwrap.extension_modules."wpimath.kinematics._kinematics"]
1526-
name = "wpimath_kinematics"
1527-
wraps = ["robotpy-native-wpimath"]
1528-
depends = ["wpimath_geometry"]
1529-
yaml_path = "semiwrap/kinematics"
1530-
1531-
[tool.semiwrap.extension_modules."wpimath.kinematics._kinematics".headers]
15321523
# wpi/math/kinematics
15331524
ChassisSpeeds = "wpi/math/kinematics/ChassisSpeeds.hpp"
15341525
DifferentialDriveKinematics = "wpi/math/kinematics/DifferentialDriveKinematics.hpp"
@@ -1550,72 +1541,19 @@ SwerveDriveOdometry3d = "wpi/math/kinematics/SwerveDriveOdometry3d.hpp"
15501541
SwerveModulePosition = "wpi/math/kinematics/SwerveModulePosition.hpp"
15511542
SwerveModuleState = "wpi/math/kinematics/SwerveModuleState.hpp"
15521543

1544+
# wpi/math/optimization
1545+
SimulatedAnnealing = "wpi/math/optimization/SimulatedAnnealing.hpp"
15531546

1554-
[tool.semiwrap.extension_modules."wpimath.spline._spline"]
1555-
name = "wpimath_spline"
1556-
wraps = ["robotpy-native-wpimath"]
1557-
depends = ["wpimath_geometry"]
1558-
yaml_path = "semiwrap/spline"
1547+
# wpi/math/path
1548+
TravelingSalesman = "wpi/math/path/TravelingSalesman.hpp"
15591549

1560-
[tool.semiwrap.extension_modules."wpimath.spline._spline".headers]
15611550
# wpi/math/spline
15621551
CubicHermiteSpline = "wpi/math/spline/CubicHermiteSpline.hpp"
15631552
QuinticHermiteSpline = "wpi/math/spline/QuinticHermiteSpline.hpp"
15641553
Spline = "wpi/math/spline/Spline.hpp"
15651554
SplineHelper = "wpi/math/spline/SplineHelper.hpp"
15661555
SplineParameterizer = "wpi/math/spline/SplineParameterizer.hpp"
15671556

1568-
1569-
[tool.semiwrap.extension_modules."wpimath._controls._controls"]
1570-
name = "wpimath_controls"
1571-
wraps = ["robotpy-native-wpimath"]
1572-
depends = ["wpimath", "wpimath_geometry", "wpimath_kinematics", "wpimath_spline"]
1573-
yaml_path = "semiwrap/controls"
1574-
1575-
[tool.semiwrap.extension_modules."wpimath._controls._controls".headers]
1576-
# wpi/math/controller
1577-
ArmFeedforward = "wpi/math/controller/ArmFeedforward.hpp"
1578-
BangBangController = "wpi/math/controller/BangBangController.hpp"
1579-
ControlAffinePlantInversionFeedforward = "wpi/math/controller/ControlAffinePlantInversionFeedforward.hpp"
1580-
DifferentialDriveAccelerationLimiter = "wpi/math/controller/DifferentialDriveAccelerationLimiter.hpp"
1581-
DifferentialDriveFeedforward = "wpi/math/controller/DifferentialDriveFeedforward.hpp"
1582-
DifferentialDriveWheelVoltages = "wpi/math/controller/DifferentialDriveWheelVoltages.hpp"
1583-
ElevatorFeedforward = "wpi/math/controller/ElevatorFeedforward.hpp"
1584-
ImplicitModelFollower = "wpi/math/controller/ImplicitModelFollower.hpp"
1585-
LTVDifferentialDriveController = "wpi/math/controller/LTVDifferentialDriveController.hpp"
1586-
LTVUnicycleController = "wpi/math/controller/LTVUnicycleController.hpp"
1587-
LinearPlantInversionFeedforward = "wpi/math/controller/LinearPlantInversionFeedforward.hpp"
1588-
LinearQuadraticRegulator = "wpi/math/controller/LinearQuadraticRegulator.hpp"
1589-
PIDController = "wpi/math/controller/PIDController.hpp"
1590-
ProfiledPIDController = "wpi/math/controller/ProfiledPIDController.hpp"
1591-
SimpleMotorFeedforward = "wpi/math/controller/SimpleMotorFeedforward.hpp"
1592-
1593-
# wpi/math/estimator
1594-
# AngleStatistics = "wpi/math/estimator/AngleStatistics.hpp"
1595-
DifferentialDrivePoseEstimator = "wpi/math/estimator/DifferentialDrivePoseEstimator.hpp"
1596-
DifferentialDrivePoseEstimator3d = "wpi/math/estimator/DifferentialDrivePoseEstimator3d.hpp"
1597-
ExtendedKalmanFilter = "wpi/math/estimator/ExtendedKalmanFilter.hpp"
1598-
KalmanFilter = "wpi/math/estimator/KalmanFilter.hpp"
1599-
# KalmanFilterLatencyCompensator = "wpi/math/estimator/KalmanFilterLatencyCompensator.hpp"
1600-
MecanumDrivePoseEstimator = "wpi/math/estimator/MecanumDrivePoseEstimator.hpp"
1601-
MecanumDrivePoseEstimator3d = "wpi/math/estimator/MecanumDrivePoseEstimator3d.hpp"
1602-
# MerweScaledSigmaPoints = "wpi/math/estimator/MerweScaledSigmaPoints.hpp"
1603-
PoseEstimator = "wpi/math/estimator/PoseEstimator.hpp"
1604-
PoseEstimator3d = "wpi/math/estimator/PoseEstimator3d.hpp"
1605-
SwerveDrivePoseEstimator = "wpi/math/estimator/SwerveDrivePoseEstimator.hpp"
1606-
SwerveDrivePoseEstimator3d = "wpi/math/estimator/SwerveDrivePoseEstimator3d.hpp"
1607-
# UnscentedKalmanFilter = "wpi/math/estimator/UnscentedKalmanFilter.hpp"
1608-
# UnscentedTransform = "wpi/math/estimator/UnscentedTransform.hpp"
1609-
1610-
# wpi/math/optimization
1611-
SimulatedAnnealing = "wpi/math/optimization/SimulatedAnnealing.hpp"
1612-
1613-
# wpi/math/random
1614-
# Normal = "wpi/math/random/Normal.hpp"
1615-
1616-
# wpi/math/path
1617-
TravelingSalesman = "wpi/math/path/TravelingSalesman.hpp"
1618-
16191557
# wpi/math/system
16201558
# Discretization = "wpi/math/system/Discretization.hpp"
16211559
LinearSystem = "wpi/math/system/LinearSystem.hpp"

subprojects/robotpy-wpimath/semiwrap/controls/ArmFeedforward.yml renamed to subprojects/robotpy-wpimath/semiwrap/ArmFeedforward.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
defaults:
2-
subpackage: controller
3-
41
classes:
52
wpi::math::ArmFeedforward:
63
force_type_casters:

0 commit comments

Comments
 (0)