Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8aa32fab5 | ||
|
|
e40761aaba | ||
|
|
354dd15620 | ||
|
|
07b299a076 | ||
|
|
0cec1eef9f | ||
|
|
68d8a943f7 | ||
|
|
9f0aebe4ce |
30
.github/workflows/build.yml
vendored
@@ -184,7 +184,7 @@ jobs:
|
||||
- name: Publish
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew photon-lib:publish
|
||||
./gradlew photon-lib:publish photon-targeting:publish
|
||||
env:
|
||||
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
|
||||
if: github.event_name == 'push'
|
||||
@@ -273,14 +273,20 @@ jobs:
|
||||
artifact-name: LinuxArm64
|
||||
image_suffix: RaspberryPi
|
||||
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_raspi.img.xz
|
||||
cpu: cortex-a7
|
||||
image_additional_mb: 0
|
||||
- os: ubuntu-latest
|
||||
artifact-name: LinuxArm64
|
||||
image_suffix: limelight2
|
||||
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_limelight.img.xz
|
||||
cpu: cortex-a7
|
||||
image_additional_mb: 0
|
||||
- os: ubuntu-latest
|
||||
artifact-name: LinuxArm64
|
||||
image_suffix: orangepi5
|
||||
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_opi5.img.xz
|
||||
cpu: cortex-a8
|
||||
image_additional_mb: 4096
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: "Build image - ${{ matrix.image_url }}"
|
||||
@@ -293,11 +299,23 @@ jobs:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: jar-${{ matrix.artifact-name }}
|
||||
# TODO- replace with the arm-runner action and run this inside of the chroot. but this works for now.
|
||||
- name: Generate image
|
||||
- uses: pguyot/arm-runner-action@v2
|
||||
name: Generate image
|
||||
id: generate_image
|
||||
with:
|
||||
base_image: ${{ matrix.image_url }}
|
||||
image_additional_mb: ${{ matrix.image_additional_mb }}
|
||||
optimize_image: yes
|
||||
cpu: ${{ matrix.cpu }}
|
||||
commands: |
|
||||
chmod +x scripts/armrunner.sh
|
||||
./scripts/armrunner.sh
|
||||
- name: Compress image
|
||||
run: |
|
||||
chmod +x scripts/generatePiImage.sh
|
||||
./scripts/generatePiImage.sh ${{ matrix.image_url }} ${{ matrix.image_suffix }}
|
||||
new_jar=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
|
||||
new_image_name=$(basename "${new_jar/.jar/_${{ matrix.image_suffix }}.img}")
|
||||
mv ${{ steps.generate_image.outputs.image }} $new_image_name
|
||||
sudo xz -T 0 -v $new_image_name
|
||||
- uses: actions/upload-artifact@v4
|
||||
name: Upload image
|
||||
with:
|
||||
@@ -320,6 +338,7 @@ jobs:
|
||||
files: |
|
||||
**/*.xz
|
||||
**/*.jar
|
||||
**/photonlib*.json
|
||||
if: github.event_name == 'push'
|
||||
# Upload all jars and xz archives
|
||||
- uses: softprops/action-gh-release@v1
|
||||
@@ -327,6 +346,7 @@ jobs:
|
||||
files: |
|
||||
**/*.xz
|
||||
**/*.jar
|
||||
**/photonlib*.json
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -144,6 +144,24 @@ public class TestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public enum WPI2024Images {
|
||||
kBackAmpZone_117in,
|
||||
kSpeakerCenter_143in;
|
||||
|
||||
public static double FOV = 68.5;
|
||||
|
||||
public final Path path;
|
||||
|
||||
Path getPath() {
|
||||
var filename = this.toString().substring(1);
|
||||
return Path.of("2024", filename + ".jpg");
|
||||
}
|
||||
|
||||
WPI2024Images() {
|
||||
this.path = getPath();
|
||||
}
|
||||
}
|
||||
|
||||
public enum WPI2023Apriltags {
|
||||
k162_36_Angle,
|
||||
k162_36_Straight,
|
||||
|
||||
@@ -16,10 +16,24 @@ m = re.search(
|
||||
# which should be PEP440 compliant
|
||||
if m:
|
||||
versionString = m.group(0)
|
||||
prefix = m.group(1)
|
||||
maturity = m.group(2)
|
||||
suffix = m.group(3).replace(".", "")
|
||||
versionString = f"{prefix}.{maturity}.{suffix}"
|
||||
# Hack -- for strings like v2024.1.1, do NOT add matruity/suffix
|
||||
if len(m.group(2)) > 0:
|
||||
print("using beta group matcher")
|
||||
prefix = m.group(1)
|
||||
maturity = m.group(2)
|
||||
suffix = m.group(3).replace(".", "")
|
||||
versionString = f"{prefix}.{maturity}.{suffix}"
|
||||
else:
|
||||
split = gitDescribeResult.split("-")
|
||||
if len(split) == 3:
|
||||
year, commits, sha = split
|
||||
# Chop off leading v from "v2024.1.2", and use "post" for commits to master since
|
||||
versionString = f"{year[1:]}post{commits}"
|
||||
print("using dev release " + versionString)
|
||||
else:
|
||||
year = gitDescribeResult
|
||||
versionString = year[1:]
|
||||
print("using full release " + versionString)
|
||||
|
||||
|
||||
else:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"https://maven.photonvision.org/repository/internal",
|
||||
"https://maven.photonvision.org/repository/snapshots"
|
||||
],
|
||||
"jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/PhotonLib-json/1.0/PhotonLib-json-1.0.json",
|
||||
"jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/photonlib-json/1.0/photonlib-json-1.0.json",
|
||||
"jniDependencies": [],
|
||||
"cppDependencies": [
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.photonvision.common.util.numbers.IntegerCouple;
|
||||
import org.photonvision.mrcal.MrCalJNILoader;
|
||||
import org.photonvision.raspi.LibCameraJNILoader;
|
||||
import org.photonvision.server.Server;
|
||||
import org.photonvision.vision.apriltag.AprilTagFamily;
|
||||
import org.photonvision.vision.camera.FileVisionSource;
|
||||
import org.photonvision.vision.opencv.CVMat;
|
||||
import org.photonvision.vision.opencv.ContourGroupingMode;
|
||||
@@ -261,6 +262,34 @@ public class Main {
|
||||
camConf2023.pipelineSettings = psList2023;
|
||||
}
|
||||
|
||||
CameraConfiguration camConf2024 =
|
||||
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("WPI2024");
|
||||
if (camConf2024 == null || true) {
|
||||
camConf2024 =
|
||||
new CameraConfiguration(
|
||||
"WPI2024",
|
||||
TestUtils.getResourcesFolderPath(true)
|
||||
.resolve("testimages")
|
||||
.resolve(TestUtils.WPI2024Images.kSpeakerCenter_143in.path)
|
||||
.toString());
|
||||
|
||||
camConf2024.FOV = TestUtils.WPI2024Images.FOV;
|
||||
// same camera as 2023
|
||||
camConf2024.calibrations.add(TestUtils.get2023LifeCamCoeffs(true));
|
||||
|
||||
var pipeline2024 = new AprilTagPipelineSettings();
|
||||
var path_split = Path.of(camConf2024.path).getFileName().toString();
|
||||
pipeline2024.pipelineNickname = path_split.replace(".jpg", "");
|
||||
pipeline2024.targetModel = TargetModel.kAprilTag6p5in_36h11;
|
||||
pipeline2024.tagFamily = AprilTagFamily.kTag36h11;
|
||||
pipeline2024.inputShouldShow = true;
|
||||
pipeline2024.solvePNPEnabled = true;
|
||||
|
||||
var psList2024 = new ArrayList<CVPipelineSettings>();
|
||||
psList2024.add(pipeline2024);
|
||||
camConf2024.pipelineSettings = psList2024;
|
||||
}
|
||||
|
||||
// Colored shape testing
|
||||
var camConfShape =
|
||||
ConfigManager.getInstance().getConfig().getCameraConfigurations().get("Shape");
|
||||
@@ -290,12 +319,14 @@ public class Main {
|
||||
var fvs2020 = new FileVisionSource(camConf2020);
|
||||
var fvs2022 = new FileVisionSource(camConf2022);
|
||||
var fvs2023 = new FileVisionSource(camConf2023);
|
||||
var fvs2024 = new FileVisionSource(camConf2024);
|
||||
|
||||
collectedSources.add(fvs2023);
|
||||
collectedSources.add(fvs2022);
|
||||
collectedSources.add(fvsShape);
|
||||
collectedSources.add(fvs2020);
|
||||
collectedSources.add(fvs2019);
|
||||
collectedSources.add(fvs2024);
|
||||
// collectedSources.add(fvs2023);
|
||||
// collectedSources.add(fvs2022);
|
||||
// collectedSources.add(fvsShape);
|
||||
// collectedSources.add(fvs2020);
|
||||
// collectedSources.add(fvs2019);
|
||||
|
||||
ConfigManager.getInstance().unloadCameraConfigs();
|
||||
VisionModuleManager.getInstance().addSources(collectedSources).forEach(VisionModule::start);
|
||||
|
||||
12
scripts/armrunner.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
###
|
||||
# Alternative ARM Runner installer to setup PhotonVision JAR
|
||||
# for ARM based builds such as Raspberry Pi, Orange Pi, etc.
|
||||
# This assumes that the image provided to arm-runner-action contains
|
||||
# the servicefile needed to auto-launch PhotonVision.
|
||||
###
|
||||
NEW_JAR=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
|
||||
echo "Using jar: " $(basename $NEW_JAR)
|
||||
|
||||
DEST_PV_LOCATION=/opt/photonvision
|
||||
sudo mkdir -p $DEST_PV_LOCATION
|
||||
sudo cp $NEW_JAR ${DEST_PV_LOCATION}/photonvision.jar
|
||||
BIN
test-resources/testimages/2024/Amp_42in.jpg
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
test-resources/testimages/2024/Amp_85in.jpg
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
test-resources/testimages/2024/BackAmpZone_117in.jpg
Normal file
|
After Width: | Height: | Size: 165 KiB |
BIN
test-resources/testimages/2024/GeneralField1.jpg
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
test-resources/testimages/2024/GeneralField2.jpg
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
test-resources/testimages/2024/GeneralField3.jpg
Normal file
|
After Width: | Height: | Size: 183 KiB |
BIN
test-resources/testimages/2024/GeneralField4.jpg
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
test-resources/testimages/2024/GeneralField5.jpg
Normal file
|
After Width: | Height: | Size: 135 KiB |
BIN
test-resources/testimages/2024/Loading_83in.jpg
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
test-resources/testimages/2024/Podium_103in.jpg
Normal file
|
After Width: | Height: | Size: 143 KiB |
13
test-resources/testimages/2024/README.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
This folder contains images of the AprilTags on the 2024 playing field. All measurements included
|
||||
are approximate and are intended to give a rough idea of views from various distances from field
|
||||
elements. All images were taken with a Microsoft Lifecam at 1280x720 resolution.
|
||||
Camera height: ~29.75 in
|
||||
Camera ~20 degrees pitch above horizontal
|
||||
The folder includes 2 types of images:
|
||||
1. "General Field" images which provide a
|
||||
general idea of the view from various spots on the field with a camera at this
|
||||
height and angle.
|
||||
2. Specific field element images which include a measurement away from a specific field element.
|
||||
The Amp, Loading, and Stage photos are measured to the face of the respective elements,
|
||||
approximately perpendicular from the face. The remaining photos are all measured to the center of
|
||||
the subwoofer face, perpendicular or diagonal as necessary.
|
||||
BIN
test-resources/testimages/2024/SpeakerCenter_143in.jpg
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
test-resources/testimages/2024/SpeakerCenter_19in.jpg
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
test-resources/testimages/2024/SpeakerCenter_63in.jpg
Normal file
|
After Width: | Height: | Size: 161 KiB |
BIN
test-resources/testimages/2024/StageLeft_51in.jpg
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
test-resources/testimages/2024/StageRight_51in.jpg
Normal file
|
After Width: | Height: | Size: 194 KiB |