Skip to content

Commit

Permalink
Merge remote-tracking branch 'wpilibsuite/main' into mvp_cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger committed Nov 23, 2024
2 parents d8af9b3 + b7eb9fb commit ad12d35
Show file tree
Hide file tree
Showing 39 changed files with 1,467 additions and 43 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,16 @@ jobs:
task: "build"
outputs: "build/allOutputs"
- os: windows-2022
artifact-name: Win32
artifact-name: Win32FFI
architecture: x86
task: ":ntcoreffi:build"
build-options: "-Pntcoreffibuild \"-Dorg.gradle.jvmargs=-Xmx1096m\""
outputs: "ntcoreffi/build/outputs"
- os: windows-2022
artifact-name: Win64FFI
architecture: x64
task: ":ntcoreffi:build"
build-options: "-Pntcoreffibuild -Pbuildwinarm64"
outputs: "ntcoreffi/build/outputs"
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
Expand Down
27 changes: 27 additions & 0 deletions ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Portable File Dialogs wpigui/src/main/native/include/portable-file-dialogs.h
V8 export-template wpiutil/src/main/native/include/wpi/SymbolExports.h
GCEM wpimath/src/main/native/thirdparty/gcem/include/
Sleipnir wpimath/src/main/native/thirdparty/sleipnir
Debugging wpiutil/src/main/native/thirdparty/debugging

==============================================================================
Google Test License
Expand Down Expand Up @@ -1224,3 +1225,29 @@ Redistribution and use in source and binary forms, with or without modification,
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=================
Debugging License
=================
MIT License

Copyright (c) 2021-2022 René Ferdinand Rivera Morell
Copyright (c) 2018 Isabella Muerte

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public void clearFamilies() {
* @return Results (array of AprilTagDetection)
*/
public AprilTagDetection[] detect(Mat img) {
return AprilTagJNI.detect(m_native, img.cols(), img.rows(), img.cols(), img.dataAddr());
return AprilTagJNI.detect(m_native, img.cols(), img.rows(), (int) img.step1(), img.dataAddr());
}

private long m_native;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,34 @@ public Mat loadImage(String resource) throws IOException {
return image;
}

@Test
void testDecodeCropped() {
detector.addFamily("tag16h5");
detector.addFamily("tag36h11");

Mat image;
try {
image = loadImage("tag1_640_480.jpg");
} catch (IOException ex) {
fail(ex);
return;
}

// Pre-knowledge -- the tag is within this ROI of this particular test image
var cropped = image.submat(100, 400, 220, 570);

try {
AprilTagDetection[] results = detector.detect(cropped);
assertEquals(1, results.length);
assertEquals("tag36h11", results[0].getFamily());
assertEquals(1, results[0].getId());
assertEquals(0, results[0].getHamming());
} finally {
cropped.release();
image.release();
}
}

@Test
void testDecodeAndPose() {
detector.addFamily("tag16h5");
Expand Down
7 changes: 7 additions & 0 deletions hal/src/generate/Instances.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kLanguage_Java = 3
kLanguage_Python = 4
kLanguage_DotNet = 5
kLanguage_Kotlin = 6
kLanguage_Rust = 7
kCANPlugin_BlackJagBridge = 1
kCANPlugin_2CAN = 2
kFramework_Iterative = 1
Expand All @@ -13,6 +14,7 @@ kFramework_Timed = 4
kFramework_ROS = 5
kFramework_RobotBuilder = 6
kFramework_AdvantageKit = 7
kFramework_MagicBot = 8
kRobotDrive_ArcadeStandard = 1
kRobotDrive_ArcadeButtonSpin = 2
kRobotDrive_ArcadeRatioCurve = 3
Expand All @@ -26,6 +28,11 @@ kRobotDrive2_MecanumCartesian = 10
kRobotDrive2_MecanumPolar = 11
kRobotDrive2_KilloughCartesian = 12
kRobotDrive2_KilloughPolar = 13
kRobotDriveSwerve_Other = 14
kRobotDriveSwerve_YAGSL = 15
kRobotDriveSwerve_CTRE = 16
kRobotDriveSwerve_MaxSwerve = 17
kRobotDriveSwerve_AdvantageKit = 18
kDriverStationCIO_Analog = 1
kDriverStationCIO_DigitalIn = 2
kDriverStationCIO_DigitalOut = 3
Expand Down
1 change: 1 addition & 0 deletions hal/src/generate/ResourceType.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ kResourceType_Redux_future4 = 112
kResourceType_Redux_future5 = 113
kResourceType_RevSparkFlexCAN = 114
kResourceType_RevSparkFlexPWM = 115
kResourceType_BangBangController = 116
16 changes: 16 additions & 0 deletions hal/src/generated/main/java/edu/wpi/first/hal/FRCNetComm.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions hal/src/generated/main/native/include/hal/FRCUsageReporting.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions hal/src/generated/main/native/include/hal/UsageReporting.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ad12d35

Please sign in to comment.