Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Protobuf] Make MultiTarget result optional #1024

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
c95feb2
Bump to beta 2
mcm001 Oct 20, 2023
397d28d
Reduce copy paste spam going forwards
mcm001 Oct 20, 2023
2d5ccd6
Bump gradle
mcm001 Oct 20, 2023
acaefba
Maybe sorta half working
mcm001 Oct 21, 2023
0392f50
Merge branch 'master' into 2023-10-20_protobuf
srimanachanta Oct 22, 2023
a5f69e1
Remove optional
mcm001 Oct 25, 2023
20d7580
bump wpilib
mcm001 Oct 26, 2023
ebadcb7
Merge branch 'master' into 2023-10-20_protobuf
srimanachanta Oct 28, 2023
a6bd9f8
Merge branch 'master' into 2023-10-20_protobuf
srimanachanta Oct 31, 2023
95a0384
Merge remote-tracking branch 'upstream/master' into 2023-10-20_protobuf
mcm001 Nov 5, 2023
aebcfa0
Change targeting classes
srimanachanta Nov 6, 2023
5345b1b
Update OpenCVHelp.java
srimanachanta Nov 6, 2023
ce248c0
Merge branch '2023-10-20_protobuf' of https://github.com/mcm001/photo…
srimanachanta Nov 6, 2023
29e2df1
Merge branch 'master' into 2023-10-20_protobuf
srimanachanta Nov 6, 2023
42f1c4b
Update build.gradle
srimanachanta Nov 6, 2023
fd920fd
fix licence
srimanachanta Nov 6, 2023
bfb84d4
keep cleaning up
srimanachanta Nov 6, 2023
030f543
more formatting fixes
srimanachanta Nov 6, 2023
381e756
Update NTDataPublisher.java
srimanachanta Nov 6, 2023
c362730
Basic Protobuf Implementation
srimanachanta Nov 6, 2023
6f5b242
Update SimPhotonCamera.java
srimanachanta Nov 6, 2023
db6ad10
rename rawBytesEntry -> pipelineResults pub/sub
srimanachanta Nov 6, 2023
6d5759c
handle crap
srimanachanta Nov 6, 2023
fafe163
Formatting fixes
srimanachanta Nov 6, 2023
d9c32de
Add protobuf tests
srimanachanta Nov 6, 2023
7246a81
Fix bugs with packing and unpacking
srimanachanta Nov 6, 2023
5d100ce
Formatting fixes
srimanachanta Nov 6, 2023
2043802
prob wont fix but one can hope
srimanachanta Nov 8, 2023
6b9f0c9
add equality tests
srimanachanta Nov 8, 2023
4a5f145
fix assertion test
srimanachanta Nov 8, 2023
237b94d
revert to before CI crash
srimanachanta Nov 8, 2023
c9e04b8
Remove Packet stuff
srimanachanta Nov 8, 2023
c441321
general cleanup of photon-targetting
srimanachanta Nov 9, 2023
7412c18
todo, squash me
srimanachanta Nov 12, 2023
3eb4d40
add missing descriptor field
srimanachanta Nov 12, 2023
e5c15fa
add tests for Protobuf list pack and unpack
srimanachanta Nov 12, 2023
73eae67
Update PhotonPipelineResult.java
srimanachanta Nov 12, 2023
58fbe69
Make PhotonTrackedTarget final
srimanachanta Nov 12, 2023
a50e70e
Very broken gradle code lol
mcm001 Nov 13, 2023
c2a3c1e
Create unit test
mcm001 Nov 13, 2023
25e6b4b
Run lint
mcm001 Nov 13, 2023
07f7d49
bump wpilib version to fix gradle issue
srimanachanta Nov 14, 2023
48d1da5
add verifyVersion() call back
srimanachanta Nov 14, 2023
8bdb5b2
Revert "bump wpilib version to fix gradle issue"
srimanachanta Nov 14, 2023
c5c51e3
stupid shim
mcm001 Nov 14, 2023
067df21
Start on C++ things
mcm001 Nov 15, 2023
b4b71ac
Update PhotonCamera.cpp
mcm001 Nov 15, 2023
fa9b7c9
Merge branch 'master' into pr/974
srimanachanta Nov 15, 2023
82d2533
bump wpilib
srimanachanta Nov 16, 2023
465fe3b
Move geometry3d
mcm001 Nov 16, 2023
813f177
Merge branch '2023-10-20_protobuf' of github.com:mcm001/photonvision …
mcm001 Nov 16, 2023
aa8f0f5
wot
mcm001 Nov 16, 2023
fb192f5
Nuke packet
mcm001 Nov 16, 2023
22632b2
conform proto file to styleguide
srimanachanta Nov 16, 2023
932ee16
move sim stuff
srimanachanta Nov 16, 2023
f48ea8a
photon_types -> photon
srimanachanta Nov 17, 2023
99db4bf
Merge master
srimanachanta Nov 19, 2023
e7be5d0
stuff i missed
srimanachanta Nov 19, 2023
15a0eb6
move ctors to headers
srimanachanta Nov 20, 2023
6ec60a7
implement Protobuf into photon-targetting c++
srimanachanta Nov 20, 2023
ce3966c
Formatting fixes
srimanachanta Nov 20, 2023
69bafc1
update build for dependencies
srimanachanta Nov 20, 2023
31d2049
Update build.gradle
srimanachanta Nov 20, 2023
2a30b09
fix deprecation warning
srimanachanta Nov 20, 2023
e5cf987
Update OpenCVHelp.java
srimanachanta Nov 20, 2023
b3e8683
Merge branch 'master' into 2023-10-20_protobuf
srimanachanta Nov 20, 2023
b47eb45
Merge branch '2023-10-20_protobuf' of https://github.com/mcm001/photo…
srimanachanta Nov 20, 2023
68f9925
fix deprecations
srimanachanta Nov 20, 2023
defe690
Update setupBuild.gradle
srimanachanta Nov 20, 2023
57219e5
update build
srimanachanta Nov 20, 2023
3e7ed35
gib push
srimanachanta Nov 21, 2023
198d1f7
add comment
srimanachanta Nov 21, 2023
90620bd
Merge branch 'master' into 2023-10-20_protobuf
mcm001 Nov 21, 2023
479c6bf
json wpilib bump
srimanachanta Nov 21, 2023
b911394
fix PNPResult encoding bug
srimanachanta Nov 21, 2023
a6b669e
bump wpilib again
srimanachanta Nov 21, 2023
1a21927
fix gradle
srimanachanta Nov 21, 2023
5d931ff
look
srimanachanta Nov 22, 2023
558c1b4
Merge branch 'master' into 2023-10-20_protobuf
srimanachanta Nov 22, 2023
0ab58a7
remove modified files
srimanachanta Nov 22, 2023
3de2b6c
Merge branch '2023-10-20_protobuf' of https://github.com/mcm001/photo…
srimanachanta Nov 22, 2023
8ece13b
Manually initialize pnpresult
mcm001 Nov 23, 2023
d12eca5
Bump wpilib version in examples
mcm001 Nov 23, 2023
d18e3d1
Merge remote-tracking branch 'upstream/master' into 2023-10-20_protobuf
mcm001 Nov 23, 2023
9340e4f
Update javacommon.gradle
mcm001 Nov 23, 2023
1504f59
Update build.gradle
mcm001 Nov 23, 2023
f98ed57
Update build.gradle
mcm001 Nov 23, 2023
7e322e9
Merge branch 'master' into 2023-10-20_protobuf
srimanachanta Nov 23, 2023
98e0117
bump wpilib
srimanachanta Nov 23, 2023
a4d7617
Merge branch '2023-10-20_protobuf' of https://github.com/mcm001/photo…
srimanachanta Nov 24, 2023
cadbb09
Update build.gradle
mcm001 Nov 24, 2023
4456acc
make multitarget optional java
srimanachanta Nov 24, 2023
0f0727c
update java tests
srimanachanta Nov 24, 2023
ca15e66
Update cpp
srimanachanta Nov 24, 2023
4826b18
update tests
srimanachanta Nov 24, 2023
7123f30
Formatting fixes
srimanachanta Nov 24, 2023
d09f84e
oopsies
srimanachanta Nov 25, 2023
6382193
Merge branch 'master' into optional-multitag-pose
srimanachanta Nov 25, 2023
ddee664
Merge branch 'master' into optional-multitag-pose
srimanachanta Dec 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
plugins {
id "com.diffplug.spotless" version "6.22.0"
id "edu.wpi.first.NativeUtils" version "2024.3.2" apply false
id "edu.wpi.first.NativeUtils" version "2024.4.0" apply false
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3"
id 'edu.wpi.first.WpilibTools' version '1.3.0'
id 'com.google.protobuf' version '0.9.4' apply false
}

allprojects {
Expand All @@ -20,7 +21,7 @@ allprojects {
apply from: "versioningHelper.gradle"

ext {
wpilibVersion = "2024.1.1-beta-3"
wpilibVersion = "2024.1.1-beta-3-52-g9280054"
wpimathVersion = wpilibVersion
openCVversion = "4.8.0-2"
joglVersion = "2.4.0-rc-20200307"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.function.Consumer;
import java.util.function.Supplier;
import org.photonvision.common.dataflow.CVPipelineResultConsumer;
import org.photonvision.common.dataflow.structures.Packet;
import org.photonvision.common.logging.LogGroup;
import org.photonvision.common.logging.Logger;
import org.photonvision.common.networktables.NTTopicSet;
Expand Down Expand Up @@ -129,15 +128,13 @@ public void updateCameraNickname(String newCameraNickname) {

@Override
public void accept(CVPipelineResult result) {
var simplified =
var res =
new PhotonPipelineResult(
result.getLatencyMillis(),
TrackedTarget.simpleFromTrackedTargets(result.targets),
result.multiTagResult);
Packet packet = new Packet(simplified.getPacketSize());
simplified.populatePacket(packet);
result.getMultiTagResult().orElse(null));

ts.rawBytesEntry.set(packet.getData());
ts.pipelineResultsPublisher.set(res);

ts.pipelineIndexPublisher.set(pipelineIndexSupplier.get());
ts.driverModePublisher.set(driverModeSupplier.getAsBoolean());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ public void accept(CVPipelineResult result) {
dataMap.put("targets", uiTargets);

// Only send Multitag Results if they are present, similar to 3d pose
if (result.multiTagResult.estimatedPose.isPresent) {
var multitagData = new HashMap<String, Object>();
multitagData.put(
"bestTransform",
SerializationUtils.transformToHashMap(result.multiTagResult.estimatedPose.best));
multitagData.put("bestReprojectionError", result.multiTagResult.estimatedPose.bestReprojErr);
multitagData.put("fiducialIDsUsed", result.multiTagResult.fiducialIDsUsed);
dataMap.put("multitagResult", multitagData);
}
result
.getMultiTagResult()
.ifPresent(
v -> {
var multitagData = new HashMap<String, Object>();
multitagData.put("bestTransform", SerializationUtils.transformToHashMap(v.best));
multitagData.put("bestReprojectionError", v.bestReprojErr);
multitagData.put("fiducialIDsUsed", v.fiducialIDsUsed);
dataMap.put("multitagResult", multitagData);
});

var uiMap = new HashMap<Integer, HashMap<String, Object>>();
uiMap.put(index, dataMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDouble;
import org.photonvision.common.dataflow.structures.Packet;
import org.photonvision.vision.opencv.Releasable;

public class JsonMat implements Releasable {
Expand Down Expand Up @@ -121,9 +120,4 @@ public <R extends Num, C extends Num> Matrix<R, C> getAsWpilibMat() {
public void release() {
getAsMat().release();
}

public Packet populatePacket(Packet packet) {
packet.encode(this.data);
return packet;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import edu.wpi.first.apriltag.AprilTagFieldLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.photonvision.common.logging.LogGroup;
import org.photonvision.common.logging.Logger;
import org.photonvision.estimation.TargetModel;
Expand All @@ -32,13 +33,15 @@
/** Estimate the camera pose given multiple Apriltag observations */
public class MultiTargetPNPPipe
extends CVPipe<
List<TrackedTarget>, MultiTargetPNPResult, MultiTargetPNPPipe.MultiTargetPNPPipeParams> {
List<TrackedTarget>,
Optional<MultiTargetPNPResult>,
MultiTargetPNPPipe.MultiTargetPNPPipeParams> {
private static final Logger logger = new Logger(MultiTargetPNPPipe.class, LogGroup.VisionModule);

private boolean hasWarned = false;

@Override
protected MultiTargetPNPResult process(List<TrackedTarget> targetList) {
protected Optional<MultiTargetPNPResult> process(List<TrackedTarget> targetList) {
if (params == null
|| params.cameraCoefficients == null
|| params.cameraCoefficients.getCameraIntrinsicsMat() == null
Expand All @@ -48,13 +51,13 @@ protected MultiTargetPNPResult process(List<TrackedTarget> targetList) {
"Cannot perform solvePNP an uncalibrated camera! Please calibrate this resolution...");
hasWarned = true;
}
return new MultiTargetPNPResult();
return Optional.empty();
}

return calculateCameraInField(targetList);
}

private MultiTargetPNPResult calculateCameraInField(List<TrackedTarget> targetList) {
private Optional<MultiTargetPNPResult> calculateCameraInField(List<TrackedTarget> targetList) {
// Find tag IDs that exist in the tag layout
var tagIDsUsed = new ArrayList<Integer>();
for (var target : targetList) {
Expand All @@ -64,18 +67,18 @@ private MultiTargetPNPResult calculateCameraInField(List<TrackedTarget> targetLi

// Only run with multiple targets
if (tagIDsUsed.size() < 2) {
return new MultiTargetPNPResult();
return Optional.empty();
}

var estimatedPose =
var estimatedPoseOpt =
VisionEstimation.estimateCamPosePNP(
params.cameraCoefficients.cameraIntrinsics.getAsWpilibMat(),
params.cameraCoefficients.distCoeffs.getAsWpilibMat(),
TrackedTarget.simpleFromTrackedTargets(targetList),
params.atfl,
params.targetModel);

return new MultiTargetPNPResult(estimatedPose, tagIDsUsed);
return estimatedPoseOpt.map(res -> new MultiTargetPNPResult(res, tagIDsUsed));
}

public static class MultiTargetPNPPipeParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import edu.wpi.first.math.util.Units;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.photonvision.common.configuration.ConfigManager;
import org.photonvision.common.util.math.MathUtils;
import org.photonvision.estimation.TargetModel;
Expand Down Expand Up @@ -149,11 +150,11 @@ protected CVPipelineResult process(Frame frame, AprilTagPipelineSettings setting
}

// Do multi-tag pose estimation
MultiTargetPNPResult multiTagResult = new MultiTargetPNPResult();
Optional<MultiTargetPNPResult> multiTagResultOpt = Optional.empty();
if (settings.solvePNPEnabled && settings.doMultiTarget) {
var multiTagOutput = multiTagPNPPipe.run(targetList);
sumPipeNanosElapsed += multiTagOutput.nanosElapsed;
multiTagResult = multiTagOutput.output;
multiTagResultOpt = multiTagOutput.output;
}

// Do single-tag pose estimation
Expand All @@ -167,7 +168,8 @@ protected CVPipelineResult process(Frame frame, AprilTagPipelineSettings setting
AprilTagPoseEstimate tagPoseEstimate = null;
// Do single-tag estimation when "always enabled" or if a tag was not used for multitag
if (settings.doSingleTargetAlways
|| !multiTagResult.fiducialIDsUsed.contains(Integer.valueOf(detection.getId()))) {
|| multiTagResultOpt.isEmpty()
|| !multiTagResultOpt.get().fiducialIDsUsed.contains(detection.getId())) {
var poseResult = singleTagPoseEstimatorPipe.run(detection);
sumPipeNanosElapsed += poseResult.nanosElapsed;
tagPoseEstimate = poseResult.output;
Expand All @@ -180,7 +182,8 @@ protected CVPipelineResult process(Frame frame, AprilTagPipelineSettings setting
if (tagPose.isPresent()) {
var camToTag =
new Transform3d(
new Pose3d().plus(multiTagResult.estimatedPose.best), tagPose.get());
new Pose3d().plus(multiTagResultOpt.map(v -> v.best).orElse(new Transform3d())),
tagPose.get());
// match expected AprilTag coordinate system
camToTag =
CoordinateSystem.convert(camToTag, CoordinateSystem.NWU(), CoordinateSystem.EDN());
Expand Down Expand Up @@ -219,6 +222,7 @@ protected CVPipelineResult process(Frame frame, AprilTagPipelineSettings setting
var fpsResult = calculateFPSPipe.run(null);
var fps = fpsResult.output;

return new CVPipelineResult(sumPipeNanosElapsed, fps, targetList, multiTagResult, frame);
return new CVPipelineResult(
sumPipeNanosElapsed, fps, targetList, multiTagResultOpt.orElse(null), frame);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import edu.wpi.first.math.util.Units;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;
import org.opencv.objdetect.Objdetect;
Expand Down Expand Up @@ -170,11 +171,11 @@ protected CVPipelineResult process(Frame frame, ArucoPipelineSettings settings)
}

// Do multi-tag pose estimation
MultiTargetPNPResult multiTagResult = new MultiTargetPNPResult();
Optional<MultiTargetPNPResult> multiTagResultOpt = Optional.empty();
if (settings.solvePNPEnabled && settings.doMultiTarget) {
var multiTagOutput = multiTagPNPPipe.run(targetList);
sumPipeNanosElapsed += multiTagOutput.nanosElapsed;
multiTagResult = multiTagOutput.output;
multiTagResultOpt = multiTagOutput.output;
}

// Do single-tag pose estimation
Expand All @@ -186,9 +187,11 @@ protected CVPipelineResult process(Frame frame, ArucoPipelineSettings settings)

for (ArucoDetectionResult detection : tagDetectionPipeResult.output) {
AprilTagPoseEstimate tagPoseEstimate = null;

// Do single-tag estimation when "always enabled" or if a tag was not used for multitag
if (settings.doSingleTargetAlways
|| !multiTagResult.fiducialIDsUsed.contains(detection.getId())) {
|| multiTagResultOpt.isEmpty()
|| !multiTagResultOpt.get().fiducialIDsUsed.contains(detection.getId())) {
var poseResult = singleTagPoseEstimatorPipe.run(detection);
sumPipeNanosElapsed += poseResult.nanosElapsed;
tagPoseEstimate = poseResult.output;
Expand All @@ -198,10 +201,12 @@ protected CVPipelineResult process(Frame frame, ArucoPipelineSettings settings)
if (tagPoseEstimate == null) {
// compute this tag's camera-to-tag transform using the multitag result
var tagPose = atfl.getTagPose(detection.getId());

if (tagPose.isPresent()) {
var camToTag =
new Transform3d(
new Pose3d().plus(multiTagResult.estimatedPose.best), tagPose.get());
new Pose3d().plus(multiTagResultOpt.map(v -> v.best).orElse(new Transform3d())),
tagPose.get());
// match expected OpenCV coordinate system
camToTag =
CoordinateSystem.convert(camToTag, CoordinateSystem.NWU(), CoordinateSystem.EDN());
Expand Down Expand Up @@ -236,7 +241,8 @@ protected CVPipelineResult process(Frame frame, ArucoPipelineSettings settings)
var fpsResult = calculateFPSPipe.run(null);
var fps = fpsResult.output;

return new CVPipelineResult(sumPipeNanosElapsed, fps, targetList, multiTagResult, frame);
return new CVPipelineResult(
sumPipeNanosElapsed, fps, targetList, multiTagResultOpt.orElse(null), frame);
}

private void drawThresholdFrame(Mat greyMat, Mat outputMat, int windowSize, double constant) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.photonvision.common.logging.Logger;
import org.photonvision.common.util.SerializationUtils;
import org.photonvision.common.util.file.FileUtils;
import org.photonvision.targeting.MultiTargetPNPResult;
import org.photonvision.vision.calibration.CameraCalibrationCoefficients;
import org.photonvision.vision.frame.Frame;
import org.photonvision.vision.frame.FrameThresholdType;
Expand Down Expand Up @@ -147,7 +146,7 @@ protected CVPipelineResult process(Frame frame, Calibration3dPipelineSettings se
sumPipeNanosElapsed,
fps, // Unused but here in case
Collections.emptyList(),
new MultiTargetPNPResult(),
null,
new Frame(
new CVMat(), outputColorCVMat, FrameThresholdType.NONE, frame.frameStaticProperties));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.util.Collections;
import java.util.List;
import java.util.Optional;
import org.photonvision.common.util.math.MathUtils;
import org.photonvision.targeting.MultiTargetPNPResult;
import org.photonvision.vision.frame.Frame;
Expand All @@ -31,11 +32,11 @@ public class CVPipelineResult implements Releasable {
public final double fps;
public final List<TrackedTarget> targets;
public final Frame inputAndOutputFrame;
public MultiTargetPNPResult multiTagResult;
private final MultiTargetPNPResult multiTagResult;

public CVPipelineResult(
double processingNanos, double fps, List<TrackedTarget> targets, Frame inputFrame) {
this(processingNanos, fps, targets, new MultiTargetPNPResult(), inputFrame);
this(processingNanos, fps, targets, null, inputFrame);
}

public CVPipelineResult(
Expand Down Expand Up @@ -64,11 +65,12 @@ public boolean hasTargets() {
return !targets.isEmpty();
}

public void release() {
for (TrackedTarget tt : targets) {
tt.release();
}
if (inputAndOutputFrame != null) inputAndOutputFrame.release();
public long getImageCaptureTimestampNanos() {
return imageCaptureTimestampNanos;
}

public double getProcessingMillis() {
return MathUtils.nanosToMillis(processingNanos);
}

/**
Expand All @@ -82,15 +84,18 @@ public double getLatencyMillis() {
return MathUtils.nanosToMillis(now - imageCaptureTimestampNanos);
}

public double getProcessingMillis() {
return MathUtils.nanosToMillis(processingNanos);
}

public long getImageCaptureTimestampNanos() {
return imageCaptureTimestampNanos;
public Optional<MultiTargetPNPResult> getMultiTagResult() {
return Optional.ofNullable(multiTagResult);
}

public void setImageCaptureTimestampNanos(long imageCaptureTimestampNanos) {
this.imageCaptureTimestampNanos = imageCaptureTimestampNanos;
}

public void release() {
for (TrackedTarget tt : targets) {
tt.release();
}
if (inputAndOutputFrame != null) inputAndOutputFrame.release();
}
}
28 changes: 28 additions & 0 deletions photon-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,35 @@ task writeCurrentVersion {
}

build.mustRunAfter writeCurrentVersion
cppHeadersZip.dependsOn writeCurrentVersion

// Building photon-lib requires photon-targeting to generate its proto files. This technically shouldn't be required but is needed for it to build.
model {
components {
all {
it.sources.each {
it.exportedHeaders {
srcDirs "src/main/native/include"
srcDirs "src/generate/native/include"
}
}
it.binaries.all {
it.tasks.withType(CppCompile) {
it.dependsOn ":photon-targeting:generateProto"
}
}
}
}
testSuites {
all {
it.binaries.all {
it.tasks.withType(CppCompile) {
it.dependsOn ":photon-targeting:generateProto"
}
}
}
}
}
def vendorJson = artifacts.add('archives', file("$photonlibFileOutput"))

model {
Expand Down
Loading