Fix deprecation warnings in PhotonLib examples (#1699)

The following deprecation warnings have been fixed:
- `SwerveModuleState.optimize(desiredState, currentRotation);`, which is
now an instance method
- `AprilTagFields.kDefaultField.loadAprilTagLayoutField();`, which is
now `AprilTagFieldLayout.loadField(AprilTagFields.kDefaultField);`

WIP:
- [x] C++
- [x] Python
This commit is contained in:
DeltaDizzy
2025-01-11 23:30:24 -05:00
committed by GitHub
parent 159b848234
commit d487e1c466
12 changed files with 48 additions and 27 deletions

View File

@@ -0,0 +1,25 @@
# Check if the first argument is provided
if [ $# -eq 0 ]
then
echo "Error: No example-to-run provided."
exit 1
fi
# To run any example, we want to use photonlib out of this repo
# Build the wheel first
pushd ../photon-lib/py
if [ -d build ]
then rm -rdf build
fi
python3 setup.py bdist_wheel
popd
# Add the output directory to PYTHONPATH to make sure it gets picked up
export PHOTONLIBPY_ROOT=../photon-lib/py
export PYTHONPATH=$PHOTONLIBPY_ROOT
# Move to the right example folder
cd $1
# Run the example
robotpy sim