Skip to content

Commit

Permalink
Add testing and testing assets. Add .ico and .icns icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliotScher committed Aug 14, 2024
1 parent 10fb944 commit f189ccd
Show file tree
Hide file tree
Showing 26 changed files with 675 additions and 353 deletions.
19 changes: 16 additions & 3 deletions wpical/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ project(wpical)
include(CompileWarnings)
include(GenResources)
include(LinkMacOSGUI)
include(AddTest)

configure_file(src/main/generate/WPILibVersion.cpp.in WPILibVersion.cpp)
generate_resources(src/main/native/resources generated/main/cpp OV ov wpical_resources_src)
generate_resources(src/main/native/resources generated/main/cpp WPIcal wpical wpical_resources_src)

file(GLOB wpical_src src/main/native/cpp/*.cpp ${CMAKE_CURRENT_BINARY_DIR}/WPILibVersion.cpp)

if(WIN32)
set(wpical_rc src/main/native/win/wpical.rc)
elseif(APPLE)
set(MACOSX_BUNDLE_ICON_FILE ov.icns)
set(APP_ICON_MACOSX src/main/native/mac/ov.icns)
set(MACOSX_BUNDLE_ICON_FILE wpical.icns)
set(APP_ICON_MACOSX src/main/native/mac/wpical.icns)
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
endif()

Expand All @@ -37,3 +38,15 @@ if(WIN32)
elseif(APPLE)
set_target_properties(wpical PROPERTIES MACOSX_BUNDLE YES OUTPUT_NAME "wpical")
endif()

if(WITH_TESTS)
wpilib_add_test(wpical src/test/native/cpp)
wpilib_link_macos_gui(wpical_test)
target_sources(wpical_test PRIVATE ${sysid_src})
target_compile_definitions(wpical_test PRIVATE RUNNING_WPICAL_TEST)
if(MSVC)
target_compile_options(wpical_test PRIVATE /utf-8)
endif()
target_include_directories(wpical_test PRIVATE src/main/native/cpp src/main/native/include)
target_link_libraries(wpical_test wpimath libglassnt libglass googletest)
endif()
296 changes: 296 additions & 0 deletions wpical/assets/2024-crescendo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
{
"tags": [
{
"ID": 1,
"pose": {
"translation": {
"x": 15.079471999999997,
"y": 0.24587199999999998,
"z": 1.355852
},
"rotation": {
"quaternion": {
"W": 0.5000000000000001,
"X": 0.0,
"Y": 0.0,
"Z": 0.8660254037844386
}
}
}
},
{
"ID": 2,
"pose": {
"translation": {
"x": 16.185134,
"y": 0.883666,
"z": 1.355852
},
"rotation": {
"quaternion": {
"W": 0.5000000000000001,
"X": 0.0,
"Y": 0.0,
"Z": 0.8660254037844386
}
}
}
},
{
"ID": 3,
"pose": {
"translation": {
"x": 16.579342,
"y": 4.982717999999999,
"z": 1.4511020000000001
},
"rotation": {
"quaternion": {
"W": 6.123233995736766e-17,
"X": 0.0,
"Y": 0.0,
"Z": 1.0
}
}
}
},
{
"ID": 4,
"pose": {
"translation": {
"x": 16.579342,
"y": 5.547867999999999,
"z": 1.4511020000000001
},
"rotation": {
"quaternion": {
"W": 6.123233995736766e-17,
"X": 0.0,
"Y": 0.0,
"Z": 1.0
}
}
}
},
{
"ID": 5,
"pose": {
"translation": {
"x": 14.700757999999999,
"y": 8.2042,
"z": 1.355852
},
"rotation": {
"quaternion": {
"W": -0.7071067811865475,
"X": -0.0,
"Y": 0.0,
"Z": 0.7071067811865476
}
}
}
},
{
"ID": 6,
"pose": {
"translation": {
"x": 1.8415,
"y": 8.2042,
"z": 1.355852
},
"rotation": {
"quaternion": {
"W": -0.7071067811865475,
"X": -0.0,
"Y": 0.0,
"Z": 0.7071067811865476
}
}
}
},
{
"ID": 7,
"pose": {
"translation": {
"x": -0.038099999999999995,
"y": 5.547867999999999,
"z": 1.4511020000000001
},
"rotation": {
"quaternion": {
"W": 1.0,
"X": 0.0,
"Y": 0.0,
"Z": 0.0
}
}
}
},
{
"ID": 8,
"pose": {
"translation": {
"x": -0.038099999999999995,
"y": 4.982717999999999,
"z": 1.4511020000000001
},
"rotation": {
"quaternion": {
"W": 1.0,
"X": 0.0,
"Y": 0.0,
"Z": 0.0
}
}
}
},
{
"ID": 9,
"pose": {
"translation": {
"x": 0.356108,
"y": 0.883666,
"z": 1.355852
},
"rotation": {
"quaternion": {
"W": 0.8660254037844387,
"X": 0.0,
"Y": 0.0,
"Z": 0.49999999999999994
}
}
}
},
{
"ID": 10,
"pose": {
"translation": {
"x": 1.4615159999999998,
"y": 0.24587199999999998,
"z": 1.355852
},
"rotation": {
"quaternion": {
"W": 0.8660254037844387,
"X": 0.0,
"Y": 0.0,
"Z": 0.49999999999999994
}
}
}
},
{
"ID": 11,
"pose": {
"translation": {
"x": 11.904726,
"y": 3.7132259999999997,
"z": 1.3208
},
"rotation": {
"quaternion": {
"W": -0.8660254037844387,
"X": -0.0,
"Y": 0.0,
"Z": 0.49999999999999994
}
}
}
},
{
"ID": 12,
"pose": {
"translation": {
"x": 11.904726,
"y": 4.49834,
"z": 1.3208
},
"rotation": {
"quaternion": {
"W": 0.8660254037844387,
"X": 0.0,
"Y": 0.0,
"Z": 0.49999999999999994
}
}
}
},
{
"ID": 13,
"pose": {
"translation": {
"x": 11.220196,
"y": 4.105148,
"z": 1.3208
},
"rotation": {
"quaternion": {
"W": 6.123233995736766e-17,
"X": 0.0,
"Y": 0.0,
"Z": 1.0
}
}
}
},
{
"ID": 14,
"pose": {
"translation": {
"x": 5.320792,
"y": 4.105148,
"z": 1.3208
},
"rotation": {
"quaternion": {
"W": 1.0,
"X": 0.0,
"Y": 0.0,
"Z": 0.0
}
}
}
},
{
"ID": 15,
"pose": {
"translation": {
"x": 4.641342,
"y": 4.49834,
"z": 1.3208
},
"rotation": {
"quaternion": {
"W": 0.5000000000000001,
"X": 0.0,
"Y": 0.0,
"Z": 0.8660254037844386
}
}
}
},
{
"ID": 16,
"pose": {
"translation": {
"x": 4.641342,
"y": 3.7132259999999997,
"z": 1.3208
},
"rotation": {
"quaternion": {
"W": -0.4999999999999998,
"X": -0.0,
"Y": 0.0,
"Z": 0.8660254037844387
}
}
}
}
],
"field": {
"length": 16.541,
"width": 8.211
}
}
30 changes: 30 additions & 0 deletions wpical/assets/camera calibration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"avg_reprojection_error": 0.4013144307258122,
"camera_matrix": [
1767.289258236593,
0.0,
989.375282791521,
0.0,
1762.888503314327,
540.8313845443114,
0.0,
0.0,
1.0
],
"distortion_coefficients": [
0.3860266675089004,
-2.563775891333845,
-0.0011477914008921702,
0.0017287037946633974,
5.69767996193624,
0.03549071109208592,
0.11781261237320696,
-0.22713730056480883,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
]
}
Binary file added wpical/assets/field video/long.mp4
Binary file not shown.
Binary file added wpical/assets/field video/short.mp4
Binary file not shown.
Binary file added wpical/assets/testcalibration.mp4
Binary file not shown.
4 changes: 2 additions & 2 deletions wpical/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ gradle.taskGraph.addTaskExecutionGraphListener { graph ->
}
}

def generateTask = createGenerateResourcesTask('main', 'OV', 'ov', project)
def generateTask = createGenerateResourcesTask('main', 'WPIcal', 'wpical', project)

project(':').libraryBuild.dependsOn build
tasks.withType(CppCompile) {
Expand All @@ -74,7 +74,7 @@ model {
// By default, a development executable will be generated. This is to help the case of
// testing specific functionality of the library.
"${nativeName}"(NativeExecutableSpec) {
baseName = 'outlineviewer'
baseName = 'wpical'
sources {
cpp {
source {
Expand Down
Loading

0 comments on commit f189ccd

Please sign in to comment.