Skip to content

Commit

Permalink
Merge branch 'master' into 2023-11-08_mrcal
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta authored Jan 4, 2024
2 parents 0a4cf83 + d85bafa commit 1e70623
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,23 @@ jobs:
needs: [build-package]

if: ${{ github.event_name != 'pull_request' }}

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact-name: LinuxArm64
image_suffix: RaspberryPi
image_url: https://api.github.com/repos/photonvision/photon-pi-gen/releases/tags/v2023.1.3_arm64
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_raspi.img.xz
- os: ubuntu-latest
artifact-name: LinuxArm64
image_suffix: limelight2
image_url: https://api.github.com/repos/photonvision/photon-pi-gen/releases/tags/v2023.2.2_limelight-arm64
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_limelight.img.xz
- 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

runs-on: ${{ matrix.os }}
name: "Build image - ${{ matrix.image_url }}"
Expand All @@ -288,6 +293,7 @@ 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
run: |
chmod +x scripts/generatePiImage.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void accept(CVPipelineResult result) {
TrackedTarget.simpleFromTrackedTargets(result.targets),
result.multiTagResult);

ts.resultPublisher.accept(simplified, simplified.getPacketSize());
ts.resultPublisher.set(simplified, simplified.getPacketSize());
if (ConfigManager.getInstance().getConfig().getNetworkConfig().shouldPublishProto) {
ts.protoResultPublisher.set(simplified);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ private static Platform getCurrentPlatform() {
} else if (RuntimeDetector.isArm64()) {
// TODO - os detection needed?
return LINUX_AARCH64;
} else if (RuntimeDetector.isArm32()) {
return LINUX_ARM32;
} else {
// Unknown or otherwise unsupported platform
return Platform.UNKNOWN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ public void submitProcessedFrame(PhotonPipelineResult result) {
public void submitProcessedFrame(PhotonPipelineResult result, long receiveTimestamp) {
ts.latencyMillisEntry.set(result.getLatencyMillis(), receiveTimestamp);

ts.resultPublisher.accept(result, result.getPacketSize());
ts.resultPublisher.set(result, result.getPacketSize());

boolean hasTargets = result.hasTargets();
ts.hasTargetEntry.set(hasTargets, receiveTimestamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void submitProcessedFrame(
PhotonPipelineResult newResult =
new PhotonPipelineResult(latencyMillis, targetList, new MultiTargetPNPResult());

ts.resultPublisher.accept(newResult, newResult.getPacketSize());
ts.resultPublisher.set(newResult, newResult.getPacketSize());

boolean hasTargets = newResult.hasTargets();
ts.hasTargetEntry.set(hasTargets);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public PacketPublisher(RawPublisher publisher, PacketSerde<T> serde) {
this.serde = serde;
}

public void accept(T value, int byteSize) {
public void set(T value, int byteSize) {
var packet = new Packet(byteSize);
serde.pack(packet, value);
publisher.set(packet.getData());
}

public void accept(T value) {
accept(value, serde.getMaxByteSize());
public void set(T value) {
set(value, serde.getMaxByteSize());
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions scripts/generatePiImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ NEW_JAR=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
echo "Using jar: " $NEW_JAR
echo "Downloading image from" $1
sudo apt-get install -y xz-utils
curl -sk $1 | grep "browser_download_url.*xz" | cut -d : -f 2,3 | tr -d '"' | wget -qi -
wget -q $1
ls
FILE_NAME=$(ls | grep image_*.xz)
FILE_NAME=$(ls | grep *.xz)

if [ -z "$FILE_NAME" ]
then
Expand Down

0 comments on commit 1e70623

Please sign in to comment.