mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Compare commits
366 Commits
v2020.2.2
...
v2021.1.1-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a14d51806d | ||
|
|
0170977914 | ||
|
|
f61726b5ae | ||
|
|
fc27fdac57 | ||
|
|
47c59859ee | ||
|
|
6e76ab9c09 | ||
|
|
5f78b76702 | ||
|
|
5e0808c848 | ||
|
|
508f05a47e | ||
|
|
66b57f0323 | ||
|
|
cfac22b4c0 | ||
|
|
2ef67f20a7 | ||
|
|
7a73946ce1 | ||
|
|
6d22b5a3c6 | ||
|
|
50050a0e53 | ||
|
|
de17422793 | ||
|
|
6b5e83ce1d | ||
|
|
17d75d8a3b | ||
|
|
616405f7ae | ||
|
|
5c2dc043cd | ||
|
|
24a3c12f31 | ||
|
|
3e544282ff | ||
|
|
3c85a40648 | ||
|
|
ac3c336b98 | ||
|
|
f24f282442 | ||
|
|
0dfee4745c | ||
|
|
eb80f7a787 | ||
|
|
68fed2a1a6 | ||
|
|
10d118a8d0 | ||
|
|
e021c33191 | ||
|
|
7b7548196a | ||
|
|
e019c735e1 | ||
|
|
c253f2c7e2 | ||
|
|
0ce9133b55 | ||
|
|
6ac9683a32 | ||
|
|
1d7739d8da | ||
|
|
1de2a6d85c | ||
|
|
0a723a50dc | ||
|
|
34b91318f4 | ||
|
|
b11a7114a5 | ||
|
|
2ca5e1c8d6 | ||
|
|
7ae8c7b247 | ||
|
|
1e17e40868 | ||
|
|
1069019fd2 | ||
|
|
4422904a2e | ||
|
|
5d085b78bd | ||
|
|
0927c73b13 | ||
|
|
5fe8f9017f | ||
|
|
5cdffeaba1 | ||
|
|
6e7c7374fd | ||
|
|
fb7b41793b | ||
|
|
abbf9f01ab | ||
|
|
17698af5e3 | ||
|
|
b66fcdb3f7 | ||
|
|
7fc48b75dd | ||
|
|
07ac5370d8 | ||
|
|
7c8f1cf7af | ||
|
|
57a97e3fb3 | ||
|
|
061432147d | ||
|
|
8f3e5794b3 | ||
|
|
a112b5e231 | ||
|
|
67859aea44 | ||
|
|
37643ab0b2 | ||
|
|
b0ee11f7cc | ||
|
|
7647e29b21 | ||
|
|
a3e672f863 | ||
|
|
9058fe803d | ||
|
|
32f429a819 | ||
|
|
bf26656547 | ||
|
|
96e26247d7 | ||
|
|
8e538aa82f | ||
|
|
fa809b2c4b | ||
|
|
9a63cd36cd | ||
|
|
21d949daa8 | ||
|
|
330b90e046 | ||
|
|
693daafe29 | ||
|
|
c3b3fb8b74 | ||
|
|
62731bea20 | ||
|
|
c55fb583b8 | ||
|
|
9725aff83b | ||
|
|
1320691eb4 | ||
|
|
451f67c63d | ||
|
|
43b1b128b1 | ||
|
|
fc991cb59c | ||
|
|
17d3d2f754 | ||
|
|
73950b9857 | ||
|
|
61ee331f11 | ||
|
|
651319589c | ||
|
|
5479948bd4 | ||
|
|
1ec145ec87 | ||
|
|
8ab47cb075 | ||
|
|
b7b3dcf3ea | ||
|
|
f7da0b4525 | ||
|
|
f9a3380184 | ||
|
|
b61f08d3fa | ||
|
|
0503225928 | ||
|
|
d4d0b5501b | ||
|
|
6c5726c96f | ||
|
|
56972447b2 | ||
|
|
67e1796ef6 | ||
|
|
1ae8da3b3f | ||
|
|
3ed97f45fb | ||
|
|
ae2809cad4 | ||
|
|
b0a296477e | ||
|
|
629a4574db | ||
|
|
4be809499d | ||
|
|
b10063da9a | ||
|
|
5e54e13140 | ||
|
|
8f87c56312 | ||
|
|
1b18560e90 | ||
|
|
f86a5f9b09 | ||
|
|
f1b1bdb121 | ||
|
|
0365557b25 | ||
|
|
883d962838 | ||
|
|
35790a8990 | ||
|
|
8edc17dac9 | ||
|
|
502f5c8b5f | ||
|
|
bc28fb187c | ||
|
|
de0277713b | ||
|
|
1593eb4d47 | ||
|
|
70ba92f917 | ||
|
|
47cc71ea01 | ||
|
|
9453d67273 | ||
|
|
f758af826d | ||
|
|
6a1e5385e5 | ||
|
|
63487dca76 | ||
|
|
7d6f09f5c7 | ||
|
|
148eed3cdc | ||
|
|
05701317b4 | ||
|
|
7548fdae5d | ||
|
|
3e41d92c18 | ||
|
|
ad6c8b882e | ||
|
|
947ff655c5 | ||
|
|
183b7c85a1 | ||
|
|
4cf6947af7 | ||
|
|
b83709b269 | ||
|
|
c699d55175 | ||
|
|
781afaa852 | ||
|
|
007b03a2c2 | ||
|
|
ed18693345 | ||
|
|
7c99224bb7 | ||
|
|
c2c4090902 | ||
|
|
416288061a | ||
|
|
83376bc231 | ||
|
|
c0de98f9f2 | ||
|
|
70db0db221 | ||
|
|
526f26685d | ||
|
|
5d1220e629 | ||
|
|
b80fde4388 | ||
|
|
148f43b4a5 | ||
|
|
0d88213de5 | ||
|
|
36b8d74faa | ||
|
|
5021f28159 | ||
|
|
ee6a814576 | ||
|
|
807de9a0a9 | ||
|
|
9398b6b55b | ||
|
|
932bfcf374 | ||
|
|
e127bac7fd | ||
|
|
bccf13bf67 | ||
|
|
950bbd6dc2 | ||
|
|
e680ba85fa | ||
|
|
b23ede7d50 | ||
|
|
73047d8b35 | ||
|
|
ef5e0c2e75 | ||
|
|
dc9e560f9b | ||
|
|
ae5b07ba01 | ||
|
|
3384c23a56 | ||
|
|
c2259d42a8 | ||
|
|
370e9d089f | ||
|
|
cab8b18c68 | ||
|
|
3b283ab9aa | ||
|
|
e5b84e2f87 | ||
|
|
f86417d791 | ||
|
|
8dc3d23831 | ||
|
|
42993b15c6 | ||
|
|
ad817d4f23 | ||
|
|
77954bb3dd | ||
|
|
52f7a62e1e | ||
|
|
1b8ceb36fc | ||
|
|
ceea1f9d44 | ||
|
|
2f81f2b78a | ||
|
|
aba035eb3d | ||
|
|
5ca2702083 | ||
|
|
af588adce5 | ||
|
|
399684a58f | ||
|
|
5cf4c16f5b | ||
|
|
0fe2319dfc | ||
|
|
e759dad019 | ||
|
|
0c18abed33 | ||
|
|
89dad2fd84 | ||
|
|
a6a71f8c76 | ||
|
|
1fee190fd0 | ||
|
|
23ba3ca19e | ||
|
|
33d8363297 | ||
|
|
49dcf7cf59 | ||
|
|
9778445a74 | ||
|
|
c2cc90b27d | ||
|
|
b9feb81226 | ||
|
|
b06ddcdd86 | ||
|
|
16ef372b53 | ||
|
|
f0a34ea64e | ||
|
|
33f7dec5cf | ||
|
|
3005803598 | ||
|
|
eeaaf5d258 | ||
|
|
15819cc981 | ||
|
|
fe6bfb1ba2 | ||
|
|
5c8d7b2423 | ||
|
|
ff0801d783 | ||
|
|
ac4b0a3118 | ||
|
|
227084e92e | ||
|
|
a175f6e862 | ||
|
|
4043c461d7 | ||
|
|
b3b2aa6359 | ||
|
|
5bd2dca463 | ||
|
|
21740fd2c5 | ||
|
|
c11ef442fb | ||
|
|
b5a38001dd | ||
|
|
5b6f68cf72 | ||
|
|
3050e935a1 | ||
|
|
80a1fa9ece | ||
|
|
1851ba1434 | ||
|
|
c4b8a2505d | ||
|
|
a1d2d40ad3 | ||
|
|
a3881bb452 | ||
|
|
6e4ee8da2b | ||
|
|
2a0f79b90f | ||
|
|
5ccc98bc14 | ||
|
|
b1353e4d6e | ||
|
|
9f4de91554 | ||
|
|
d30d1088da | ||
|
|
c6e6346642 | ||
|
|
e08c8a1fc9 | ||
|
|
e50dbe0c43 | ||
|
|
d9c7bbd046 | ||
|
|
dac0e5b133 | ||
|
|
ce3bc91946 | ||
|
|
22c0e2813a | ||
|
|
9796987d59 | ||
|
|
4d275e4767 | ||
|
|
492d6c2826 | ||
|
|
765f009350 | ||
|
|
629e8b41f2 | ||
|
|
71c187a1ed | ||
|
|
00e991e2a0 | ||
|
|
8a80f97c06 | ||
|
|
3cbec411c7 | ||
|
|
3bcb89fb84 | ||
|
|
62b8a36ce9 | ||
|
|
27566abb06 | ||
|
|
dfb130270a | ||
|
|
1ba616f843 | ||
|
|
11fb0a4cb7 | ||
|
|
1557a4c3b0 | ||
|
|
ab28a7d65f | ||
|
|
d58a5e124a | ||
|
|
762347f005 | ||
|
|
4b76adf15b | ||
|
|
6be1b95241 | ||
|
|
38ad790612 | ||
|
|
86acb27e24 | ||
|
|
1b395fa21d | ||
|
|
92380485c8 | ||
|
|
27f9a21a2c | ||
|
|
cf7088a462 | ||
|
|
67554ef3b0 | ||
|
|
cf20b068ca | ||
|
|
0b9316d94a | ||
|
|
3011ebe547 | ||
|
|
4b77b0773e | ||
|
|
e5935a4737 | ||
|
|
a3a8472b82 | ||
|
|
212182d991 | ||
|
|
c82b8546bc | ||
|
|
fac4e3fcfc | ||
|
|
5b0122fed4 | ||
|
|
b46b5df16a | ||
|
|
cb51029335 | ||
|
|
e504b3ecbd | ||
|
|
0ad0ec0985 | ||
|
|
d1d32ada00 | ||
|
|
8058daa982 | ||
|
|
f4c5c0f5b5 | ||
|
|
2ecb8dab7d | ||
|
|
576d427f03 | ||
|
|
21aafea098 | ||
|
|
3ed2908563 | ||
|
|
2b188b54d8 | ||
|
|
306720e63e | ||
|
|
a308dd4471 | ||
|
|
8f33d21bc2 | ||
|
|
b9ee3ae030 | ||
|
|
c14b87b228 | ||
|
|
8a279aaf20 | ||
|
|
3a5e541b2d | ||
|
|
43574128b3 | ||
|
|
e4a9903844 | ||
|
|
0d30108dcb | ||
|
|
b7a79c70cc | ||
|
|
6e6f28d1ac | ||
|
|
d14978e549 | ||
|
|
1c28b729ad | ||
|
|
303194b08b | ||
|
|
2ee3bfaa25 | ||
|
|
029a94dd33 | ||
|
|
f6df9217b6 | ||
|
|
184fae4ba5 | ||
|
|
35b236651e | ||
|
|
c926770550 | ||
|
|
272eaf184f | ||
|
|
56fbb1fc33 | ||
|
|
33f6bf947e | ||
|
|
07326edb6b | ||
|
|
144610151c | ||
|
|
4228d3609e | ||
|
|
510936a2a0 | ||
|
|
5854e284ea | ||
|
|
a732606e55 | ||
|
|
84e300739c | ||
|
|
8edf9282c3 | ||
|
|
5a1acaaefc | ||
|
|
4fd7c210d8 | ||
|
|
a26a7d217d | ||
|
|
7b7f44d937 | ||
|
|
6cf89aa0f3 | ||
|
|
3be83784cd | ||
|
|
b6c163acd7 | ||
|
|
05a26b7279 | ||
|
|
35eb90c135 | ||
|
|
761f79385a | ||
|
|
554bda3332 | ||
|
|
2a968df779 | ||
|
|
30ccd13b69 | ||
|
|
60c09ea51f | ||
|
|
65eab93527 | ||
|
|
a226ad8509 | ||
|
|
31f4fd70ce | ||
|
|
7275ab9837 | ||
|
|
5b3facc63b | ||
|
|
0f313fb9ab | ||
|
|
05b7593e66 | ||
|
|
1b85066d26 | ||
|
|
e93b64f58d | ||
|
|
f0a18f31e7 | ||
|
|
29c82527a5 | ||
|
|
c165dc5e50 | ||
|
|
42da07396c | ||
|
|
20e6c04059 | ||
|
|
ff5d3e5b36 | ||
|
|
6cc68ab503 | ||
|
|
068465146b | ||
|
|
3bcf8057d4 | ||
|
|
8039a6c525 | ||
|
|
558c020cca | ||
|
|
7797da78f5 | ||
|
|
0ab81d768f | ||
|
|
1cee5ccb93 | ||
|
|
3ce01b5ac2 | ||
|
|
e6aa8f3ff4 | ||
|
|
9d7b087972 | ||
|
|
bb184ed481 | ||
|
|
b9b31069cc | ||
|
|
d0cf4e8882 | ||
|
|
02fb850761 | ||
|
|
ac8177e10d | ||
|
|
2eb5c54476 | ||
|
|
0e206e69cf |
@@ -3,24 +3,29 @@ Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
AccessModifierOffset: -1
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveMacros: false
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
@@ -29,6 +34,7 @@ BraceWrapping:
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
@@ -38,6 +44,7 @@ BraceWrapping:
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
@@ -50,6 +57,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DeriveLineEnding: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
@@ -58,15 +66,25 @@ ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^<ext/.*\.h>'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
- Regex: '^<.*\.h>'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
- Regex: '^<.*'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
- Regex: '.*'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
IncludeIsMainRegex: '([-_](test|unittest))?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
IndentCaseLabels: true
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 2
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
@@ -76,32 +94,73 @@ MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Never
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 1
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
PointerAlignment: Left
|
||||
RawStringFormats:
|
||||
- Language: Cpp
|
||||
Delimiters:
|
||||
- cc
|
||||
- CC
|
||||
- cpp
|
||||
- Cpp
|
||||
- CPP
|
||||
- 'c++'
|
||||
- 'C++'
|
||||
CanonicalDelimiter: ''
|
||||
BasedOnStyle: google
|
||||
- Language: TextProto
|
||||
Delimiters:
|
||||
- pb
|
||||
- PB
|
||||
- proto
|
||||
- PROTO
|
||||
EnclosingFunctions:
|
||||
- EqualsProto
|
||||
- EquivToProto
|
||||
- PARSE_PARTIAL_TEXT_PROTO
|
||||
- PARSE_TEST_PROTO
|
||||
- PARSE_TEXT_PROTO
|
||||
- ParseTextOrDie
|
||||
- ParseTextProtoOrDie
|
||||
CanonicalDelimiter: ''
|
||||
BasedOnStyle: google
|
||||
ReflowComments: true
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceBeforeSquareBrackets: false
|
||||
Standard: Auto
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
38
.github/CODEOWNERS
vendored
Normal file
38
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# Lines starting with '#' are comments.
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
|
||||
# More details are here: https://help.github.com/articles/about-codeowners/
|
||||
|
||||
# The '*' pattern is global owners.
|
||||
|
||||
# Order is important. The last matching pattern has the most precedence.
|
||||
|
||||
# The folders are ordered as a tree: by depth then alphabetically.
|
||||
# This should make it easy to add new rules without breaking existing ones.
|
||||
|
||||
# Global rule:
|
||||
* @wpilibsuite/wpilib
|
||||
|
||||
/cameraserver/ @wpilibsuite/camera-server
|
||||
|
||||
/cscore/ @wpilibsuite/camera-server
|
||||
|
||||
/hal/ @wpilibsuite/hardware
|
||||
/hal/src/main/java/**/sim/ @wpilibsuite/simulation
|
||||
/hal/src/main/native/include/mockdata/ @wpilibsuite/simulation
|
||||
/hal/src/main/native/include/simulation/ @wpilibsuite/simulation
|
||||
/hal/src/main/native/sim/ @wpilibsuite/simulation
|
||||
|
||||
/ntcore/ @wpilibsuite/network-tables
|
||||
|
||||
/simulation/ @wpilibsuite/simulation
|
||||
|
||||
/wpilibNewCommands/ @wpilibsuite/commandbased
|
||||
|
||||
/wpilibOldCommands/ @wpilibsuite/commandbased
|
||||
|
||||
/wpilibcExamples/ @wpilibsuite/wpilib @wpilibsuite/documentation
|
||||
|
||||
/wpilibjExamples/ @wpilibsuite/wpilib @wpilibsuite/documentation
|
||||
|
||||
/wpiutil/ @PeterJohnson
|
||||
30
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
30
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. ...
|
||||
2. ...
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. Windows]
|
||||
- Java version [e.g. 1.10.2]
|
||||
- C++ version [e.g. 17]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
20
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Question
|
||||
about: Ask about features or parts of this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the question you have.**
|
||||
A clear and concise description of what you want clarification on.
|
||||
|
||||
**Describe the reason for your confusion.**
|
||||
A clear and concise description of why the question requires clarification and what's confusing.
|
||||
|
||||
**Is your question related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the question here.
|
||||
238
.github/workflows/ci.yml
vendored
Normal file
238
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
name: CI
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
build-docker:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- container: wpilib/roborio-cross-ubuntu:2021-18.04
|
||||
artifact-name: Athena
|
||||
build-options: "-Ponlylinuxathena"
|
||||
- container: wpilib/raspbian-cross-ubuntu:10-18.04
|
||||
artifact-name: Raspbian
|
||||
build-options: "-Ponlylinuxraspbian"
|
||||
- container: wpilib/aarch64-cross-ubuntu:bionic-18.04
|
||||
artifact-name: Aarch64
|
||||
build-options: "-Ponlylinuxaarch64bionic"
|
||||
- container: wpilib/ubuntu-base:18.04
|
||||
artifact-name: Linux
|
||||
build-options: "-Dorg.gradle.jvmargs=-Xmx2g"
|
||||
name: "Build - ${{ matrix.artifact-name }}"
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set release environment variable
|
||||
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build -PbuildServer ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.artifact-name }}
|
||||
path: build/allOutputs
|
||||
|
||||
build-host:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
artifact-name: Win64
|
||||
architecture: x64
|
||||
- os: windows-latest
|
||||
artifact-name: Win32
|
||||
architecture: x86
|
||||
- os: macos-latest
|
||||
artifact-name: macOS
|
||||
architecture: x64
|
||||
name: "Build - ${{ matrix.artifact-name }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
architecture: ${{ matrix.architecture }}
|
||||
- name: Import Developer ID Certificate
|
||||
uses: wpilibsuite/import-signing-certificate@v1
|
||||
with:
|
||||
certificate-data: ${{ secrets.APPLE_CERTIFICATE_DATA }}
|
||||
certificate-passphrase: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
keychain-password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
|
||||
if: |
|
||||
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' &&
|
||||
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')))
|
||||
- name: Set Keychain Lock Timeout
|
||||
run: security set-keychain-settings -lut 3600
|
||||
if: |
|
||||
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' &&
|
||||
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')))
|
||||
- name: Set release environment variable
|
||||
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build -PbuildServer ${{ env.EXTRA_GRADLE_ARGS }}
|
||||
- name: Sign Libraries with Developer ID
|
||||
run: ./gradlew build -PbuildServer -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }} ${{ env.EXTRA_GRADLE_ARGS }}
|
||||
if: |
|
||||
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' &&
|
||||
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')))
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.artifact-name }}
|
||||
path: build/allOutputs
|
||||
|
||||
build-documentation:
|
||||
name: "Build - Documentation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 13
|
||||
- name: Set release environment variable
|
||||
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew docs:zipDocs -PbuildServer ${{ env.EXTRA_GRADLE_ARGS }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Documentation
|
||||
path: docs/build/outputs
|
||||
|
||||
build-cmake:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
name: Linux
|
||||
container: wpilib/roborio-cross-ubuntu:2020-18.04
|
||||
flags: ""
|
||||
- os: macos-latest
|
||||
name: macOS
|
||||
container: ""
|
||||
flags: "-DWITH_JAVA=OFF"
|
||||
name: "Build - CMake ${{ matrix.name }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "macOS" ]; then
|
||||
brew install opencv
|
||||
fi
|
||||
- name: configure
|
||||
run: mkdir build && cd build && cmake -DWITH_GUI=OFF ${{ matrix.flags }} ..
|
||||
- name: build
|
||||
working-directory: build
|
||||
run: make -j3
|
||||
- name: test
|
||||
working-directory: build
|
||||
run: make test
|
||||
|
||||
build-cmake-vcpkg:
|
||||
name: "Build - CMake Windows"
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Prepare vcpkg
|
||||
uses: lukka/run-vcpkg@v4
|
||||
with:
|
||||
vcpkgArguments: opencv
|
||||
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
|
||||
vcpkgGitCommitId: 544f8e4593764f78faa94bac2adb81cca5232943
|
||||
vcpkgTriplet: x64-windows
|
||||
- name: Configure & Build
|
||||
uses: lukka/run-cmake@v3
|
||||
with:
|
||||
buildDirectory: ${{ runner.workspace }}/build/
|
||||
cmakeAppendedArgs: -DWITH_JAVA=OFF
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
useVcpkgToolchainFile: true
|
||||
- name: Run Tests
|
||||
run: ctest -C "Debug"
|
||||
working-directory: ${{ runner.workspace }}/build/
|
||||
|
||||
wpiformat:
|
||||
name: "wpiformat"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Fetch all history and metadata
|
||||
run: |
|
||||
git fetch --prune --unshallow
|
||||
git checkout -b pr
|
||||
git branch -f master origin/master
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install clang-format
|
||||
run: sudo apt-get update -q && sudo apt-get install clang-format-10
|
||||
- name: Install wpiformat
|
||||
run: pip3 install wpiformat
|
||||
- name: Run
|
||||
run: wpiformat -clang 10
|
||||
- name: Check Output
|
||||
run: git --no-pager diff --exit-code HEAD
|
||||
|
||||
combine:
|
||||
name: Combine
|
||||
needs: [build-docker, build-host, build-documentation]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: wpilibsuite/build-tools
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: combiner/products/build/allOutputs
|
||||
- name: Flatten Artifacts
|
||||
run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/
|
||||
- name: Check version number exists
|
||||
run: |
|
||||
cat combiner/products/build/allOutputs/version.txt
|
||||
test -s combiner/products/build/allOutputs/version.txt
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Combine
|
||||
if: |
|
||||
!startsWith(github.ref, 'refs/tags/v') &&
|
||||
github.ref != 'refs/heads/master'
|
||||
run: cd combiner && ./gradlew publish -Pallwpilib
|
||||
- name: Combine (Master)
|
||||
if: |
|
||||
github.repository_owner == 'wpilibsuite' &&
|
||||
github.ref == 'refs/heads/master'
|
||||
run: cd combiner && ./gradlew publish -Pallwpilib
|
||||
env:
|
||||
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
|
||||
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
||||
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
- name: Combine (Release)
|
||||
if: |
|
||||
github.repository_owner == 'wpilibsuite' &&
|
||||
startsWith(github.ref, 'refs/tags/v')
|
||||
run: cd combiner && ./gradlew publish -Pallwpilib -PreleaseRepoPublish
|
||||
env:
|
||||
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
|
||||
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
||||
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Maven
|
||||
path: ~/releases
|
||||
@@ -1,5 +1,5 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
on: [push]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -222,3 +222,5 @@ compile_commands.json
|
||||
# clang configuration and clangd cache
|
||||
.clang
|
||||
.clangd/
|
||||
|
||||
imgui.ini
|
||||
|
||||
@@ -2,6 +2,7 @@ cppHeaderFileInclude {
|
||||
\.h$
|
||||
\.hpp$
|
||||
\.inc$
|
||||
\.inl$
|
||||
}
|
||||
|
||||
cppSrcFileInclude {
|
||||
@@ -18,16 +19,22 @@ repoRootNameOverride {
|
||||
}
|
||||
|
||||
includeOtherLibs {
|
||||
^Eigen/
|
||||
^cameraserver/
|
||||
^cscore
|
||||
^drake/
|
||||
^hal/
|
||||
^imgui
|
||||
^implot
|
||||
^mockdata/
|
||||
^networktables/
|
||||
^ntcore
|
||||
^opencv2/
|
||||
^support/
|
||||
^units/
|
||||
^unsupported/
|
||||
^vision/
|
||||
^wpi/
|
||||
^wpigui
|
||||
^wpimath/
|
||||
}
|
||||
|
||||
@@ -16,10 +16,6 @@ INCLUDE(CPack)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND MSVC)
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Default install dir on windows" FORCE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
@@ -44,23 +40,69 @@ IF("${isSystemDir}" STREQUAL "-1")
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/wpilib/lib")
|
||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
option(WITHOUT_JAVA "don't include java and JNI in the build" OFF)
|
||||
option(BUILD_SHARED_LIBS "build with shared libs (needed for JNI)" ON)
|
||||
option(WITHOUT_CSCORE "Don't build cscore (removes OpenCV requirement)" OFF)
|
||||
option(WITHOUT_ALLWPILIB "Don't build allwpilib (removes OpenCV requirement)" ON)
|
||||
option(WITH_TESTS "build unit tests (requires internet connection)" OFF)
|
||||
option(USE_EXTERNAL_HAL "Use a separately built HAL" OFF)
|
||||
# Options for building certain parts of the repo. Everything is built by default.
|
||||
option(BUILD_SHARED_LIBS "Build with shared libs (needed for JNI)" ON)
|
||||
option(WITH_JAVA "Include java and JNI in the build" ON)
|
||||
option(WITH_CSCORE "Build cscore (needs OpenCV)" ON)
|
||||
option(WITH_WPILIB "Build hal, wpilibc/j, wpimath, and myRobot (needs OpenCV)" ON)
|
||||
option(WITH_TESTS "Build unit tests (requires internet connection)" ON)
|
||||
option(WITH_GUI "Build GUI items" ON)
|
||||
option(WITH_SIMULATION_MODULES "Build simulation modules" ON)
|
||||
|
||||
# Options for external HAL.
|
||||
option(WITH_EXTERNAL_HAL "Use a separately built HAL" OFF)
|
||||
set(EXTERNAL_HAL_FILE "" CACHE FILEPATH "Location to look for an external HAL CMake File")
|
||||
|
||||
# Options for using a package manager (vcpkg) for certain dependencies.
|
||||
option(USE_VCPKG_LIBUV "Use vcpkg libuv" OFF)
|
||||
option(USE_VCPKG_EIGEN "Use vcpkg eigen" OFF)
|
||||
option(FLAT_INSTALL_WPILIB "Use a flat install directory" OFF)
|
||||
option(WITH_SIMULATION_MODULES "build simulation modules" OFF)
|
||||
|
||||
if (NOT WITHOUT_JAVA AND NOT BUILD_SHARED_LIBS)
|
||||
# Options for installation.
|
||||
option(WITH_FLAT_INSTALL "Use a flat install directory" OFF)
|
||||
|
||||
# Options for location of OpenCV Java.
|
||||
set(OPENCV_JAVA_INSTALL_DIR "" CACHE PATH "Location to search for the OpenCV jar file")
|
||||
|
||||
# Set default build type to release with debug info (i.e. release mode optimizations
|
||||
# are performed, but debug info still exists).
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
# We always want flat install with MSVC.
|
||||
if (MSVC)
|
||||
set(WITH_FLAT_INSTALL ON)
|
||||
endif()
|
||||
|
||||
if (WITH_JAVA AND NOT BUILD_SHARED_LIBS)
|
||||
message(FATAL_ERROR "
|
||||
FATAL: Cannot build static libs with Java enabled.
|
||||
Static libs requires both BUILD_SHARED_LIBS=OFF and
|
||||
WITHOUT_JAVA=ON
|
||||
WITH_JAVA=OFF
|
||||
")
|
||||
endif()
|
||||
|
||||
if (WITH_SIMULATION_MODULES AND NOT BUILD_SHARED_LIBS)
|
||||
message(FATAL_ERROR "
|
||||
FATAL: Cannot build static libs with simulation modules enabled.
|
||||
Static libs requires both BUILD_SHARED_LIBS=OFF and
|
||||
WITH_SIMULATION_MODULES=OFF
|
||||
")
|
||||
endif()
|
||||
|
||||
if (NOT WITH_JAVA OR NOT WITH_CSCORE)
|
||||
if(NOT "${OPENCV_JAVA_INSTALL_DIR}" STREQUAL "")
|
||||
message(WARNING "
|
||||
WARNING: OpenCV Java dir set but java is not enabled!
|
||||
It will be ignored.
|
||||
")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT WITH_WPILIB AND WITH_SIMULATION_MODULES)
|
||||
message(FATAL_ERROR "
|
||||
FATAL: Cannot build simulation modules with wpilib disabled.
|
||||
Enable wpilib by setting WITH_WPILIB=ON
|
||||
")
|
||||
endif()
|
||||
|
||||
@@ -70,7 +112,7 @@ set( main_lib_dest wpilib/lib )
|
||||
set( java_lib_dest wpilib/java )
|
||||
set( jni_lib_dest wpilib/jni )
|
||||
|
||||
if (MSVC OR FLAT_INSTALL_WPILIB)
|
||||
if (WITH_FLAT_INSTALL)
|
||||
set (wpilib_config_dir ${wpilib_dest})
|
||||
else()
|
||||
set (wpilib_config_dir share/wpilib)
|
||||
@@ -84,12 +126,13 @@ if (USE_VCPKG_EIGEN)
|
||||
set (EIGEN_VCPKG_REPLACE "find_package(Eigen3 CONFIG)")
|
||||
endif()
|
||||
|
||||
if (MSVC OR FLAT_INSTALL_WPILIB)
|
||||
if (WITH_FLAT_INSTALL)
|
||||
set(WPIUTIL_DEP_REPLACE "include($\{SELF_DIR\}/wpiutil-config.cmake)")
|
||||
set(NTCORE_DEP_REPLACE "include($\{SELF_DIR\}/ntcore-config.cmake)")
|
||||
set(CSCORE_DEP_REPLACE_IMPL "include(\${SELF_DIR}/cscore-config.cmake)")
|
||||
set(CAMERASERVER_DEP_REPLACE_IMPL "include(\${SELF_DIR}/cameraserver-config.cmake)")
|
||||
set(HAL_DEP_REPLACE_IMPL "include(\${SELF_DIR}/hal-config.cmake)")
|
||||
set(WPIMATH_DEP_REPLACE "include($\{SELF_DIR\}/wpimath-config.cmake)")
|
||||
set(WPILIBC_DEP_REPLACE_IMPL "include(\${SELF_DIR}/wpilibc-config.cmake)")
|
||||
else()
|
||||
set(WPIUTIL_DEP_REPLACE "find_dependency(wpiutil)")
|
||||
@@ -97,6 +140,7 @@ set(NTCORE_DEP_REPLACE "find_dependency(ntcore)")
|
||||
set(CSCORE_DEP_REPLACE_IMPL "find_dependency(cscore)")
|
||||
set(CAMERASERVER_DEP_REPLACE_IMPL "find_dependency(cameraserver)")
|
||||
set(HAL_DEP_REPLACE_IMPL "find_dependency(hal)")
|
||||
set(WPIMATH_DEP_REPLACE "find_dependency(wpimath)")
|
||||
set(WPILIBC_DEP_REPLACE_IMPL "find_dependency(wpilibc)")
|
||||
endif()
|
||||
|
||||
@@ -112,23 +156,28 @@ endif()
|
||||
add_subdirectory(wpiutil)
|
||||
add_subdirectory(ntcore)
|
||||
|
||||
if (NOT WITHOUT_CSCORE)
|
||||
if (WITH_GUI)
|
||||
add_subdirectory(imgui)
|
||||
add_subdirectory(wpigui)
|
||||
endif()
|
||||
|
||||
if (WITH_CSCORE)
|
||||
set(CSCORE_DEP_REPLACE ${CSCORE_DEP_REPLACE_IMPL})
|
||||
set(CAMERASERVER_DEP_REPLACE ${CAMERASERVER_DEP_REPLACE_IMPL})
|
||||
add_subdirectory(cscore)
|
||||
add_subdirectory(cameraserver)
|
||||
if (NOT WITHOUT_ALLWPILIB)
|
||||
if (WITH_WPILIB)
|
||||
set(HAL_DEP_REPLACE ${HAL_DEP_REPLACE_IMPL})
|
||||
set(WPILIBC_DEP_REPLACE ${WPILIBC_DEP_REPLACE_IMPL})
|
||||
add_subdirectory(hal)
|
||||
add_subdirectory(wpimath)
|
||||
add_subdirectory(wpilibj)
|
||||
add_subdirectory(wpilibc)
|
||||
add_subdirectory(myRobot)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WITH_SIMULATION_MODULES AND NOT USE_EXTERNAL_HAL)
|
||||
add_subdirectory(imgui)
|
||||
if (WITH_SIMULATION_MODULES AND NOT WITH_EXTERNAL_HAL)
|
||||
add_subdirectory(simulation)
|
||||
endif()
|
||||
|
||||
|
||||
131
CODE_OF_CONDUCT.md
Normal file
131
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,131 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Exhibiting Gracious Professionalism® at all times. Gracious Professionalism
|
||||
is a way of doing things that encourages high-quality work, emphasizes the
|
||||
value of others, and respects individuals and the community.
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
[conduct@wpilib.org](mailto:conduct@wpilib.org).
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
@@ -1,6 +1,6 @@
|
||||
# Contributing to WPILib
|
||||
|
||||
So you want to contribute your changes back to WPILib. Great! We have a few contributing rules that will help you make sure your changes will be accepted into the project. Please remember to follow the rules written here, and behave with Gracious Professionalism.
|
||||
So you want to contribute your changes back to WPILib. Great! We have a few contributing rules that will help you make sure your changes will be accepted into the project. Please remember to follow the rules in the [code of conduct](https://github.com/wpilibsuite/allwpilib/blob/master/CODE_OF_CONDUCT.md), and behave with Gracious Professionalism.
|
||||
|
||||
- [General Contribution Rules](#general-contribution-rules)
|
||||
- [What to Contribute](#what-to-contribute)
|
||||
@@ -37,7 +37,7 @@ So you want to contribute your changes back to WPILib. Great! We have a few cont
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
WPILib uses modified Google style guides for both C++ and Java, which can be found in the [styleguide repository](https://github.com/wpilibsuite/styleguide). Autoformatters are available for many popular editors at https://github.com/google/styleguide. Running wpiformat is required for all contributions and is enforced by our continuous integration system. We currently use clang-format 6.0 with wpiformat.
|
||||
WPILib uses modified Google style guides for both C++ and Java, which can be found in the [styleguide repository](https://github.com/wpilibsuite/styleguide). Autoformatters are available for many popular editors at https://github.com/google/styleguide. Running wpiformat is required for all contributions and is enforced by our continuous integration system. We currently use clang-format 10.0 with wpiformat.
|
||||
|
||||
While the library should be fully formatted according to the styles, additional elements of the style guide were not followed when the library was initially created. All new code should follow the guidelines. If you are looking for some easy ramp-up tasks, finding areas that don't follow the style guide and fixing them is very welcome.
|
||||
|
||||
@@ -45,12 +45,12 @@ While the library should be fully formatted according to the styles, additional
|
||||
|
||||
### Pull Request Format
|
||||
|
||||
Changes should be submitted as a Pull Request against the master branch of WPILib. For most changes, we ask that you squash your changes down to a single commit. For particularly large changes, multiple commits are ok, but assume one commit unless asked otherwise. No change will be merged unless it is up to date with the current master. We will also not merge any changes with merge commits in them; please rebase off of master before submitting a pull request. We do this to make sure that the git history isn't too cluttered.
|
||||
Changes should be submitted as a Pull Request against the master branch of WPILib. For most changes, commits will be squashed upon merge. For particularly large changes, multiple commits are ok, but assume one commit unless asked otherwise. We may ask you to break a PR into multiple standalone PRs or commits for rebase within one PR to separate unrelated changes. No change will be merged unless it is up to date with the current master. We do this to make sure that the git history isn't too cluttered.
|
||||
|
||||
### Merge Process
|
||||
|
||||
When you first submit changes, Travis-CI will attempt to run `./gradlew check` on your change. If this fails, you will need to fix any issues that it sees. Once Travis passes, we will begin the review process in more earnest. One or more WPILib team members will review your change. This will be a back-and-forth process with the WPILib team and the greater community. Once we are satisfied that your change is ready, we will allow our Jenkins instance to test it. This will run the full gamut of checks, including integration tests on actual hardware. Once all tests have passed and the team is satisfied, we will merge your change into the WPILib repository.
|
||||
When you first submit changes, GitHub Actions will attempt to run `./gradlew check` on your change. If this fails, you will need to fix any issues that it sees. Once Actions passes, we will begin the review process in more earnest. One or more WPILib team members will review your change. This will be a back-and-forth process with the WPILib team and the greater community. Once we are satisfied that your change is ready, we will allow our hosted instance to test it. This will run the full gamut of checks, including integration tests on actual hardware. Once all tests have passed and the team is satisfied, we will merge your change into the WPILib repository.
|
||||
|
||||
## Licensing
|
||||
|
||||
By contributing to WPILib, you agree that your code will be distributed with WPILib, and licensed under the license for the WPILib project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as WPILib is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](LICENSE.txt).
|
||||
By contributing to WPILib, you agree that your code will be distributed with WPILib, and licensed under the license for the WPILib project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as WPILib is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](LICENSE.md).
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# Faster Builds for Developers
|
||||
|
||||
When you run `./gradlew build`, it builds EVERYTHING. This means debug and release builds for desktop and all installed cross compilers. For many developers, this is way too much, and causes much developer pain.
|
||||
|
||||
To help with some of these things, common tasks have shortcuts to only build necessary things for common development and testing tasks.
|
||||
|
||||
## Development (Desktop)
|
||||
|
||||
For projects `wpiutil`, `ntcore`, `cscore`, `hal` `wpilibOldCommands`, `wpilibNewCommands` and `cameraserver`, a `testDesktopJava` and a `testDesktopCpp` task exists. These can be ran with `./gradlew :projectName:task`, and will only build the minimum things required to run those tests.
|
||||
|
||||
For `wpilibc`, a `testDesktopCpp` task exists. For `wpilibj`, a `testDesktopJava` task exists.
|
||||
|
||||
For `wpilibcExamples`, a `buildDesktopCpp` task exists (These can't be ran, but they can compile).
|
||||
|
||||
For `wpilibjExamples`, a `buildDesktopJava` task exists.
|
||||
@@ -1,18 +1,18 @@
|
||||
Copyright (c) 2009-2018 FIRST
|
||||
Copyright (c) 2009-2019 FIRST
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the FIRST nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the FIRST 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 FIRST AND CONTRIBUTORS``AS IS'' AND ANY
|
||||
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
|
||||
27
MAINTAINERS.md
Normal file
27
MAINTAINERS.md
Normal file
@@ -0,0 +1,27 @@
|
||||
## Publishing Third Party Dependencies
|
||||
Currently the 3rd party deps are imgui, opencv, and google test
|
||||
|
||||
For publishing these dependencies, the version needs to be manually updated in the publish.gradle file of their respective repository.
|
||||
Then, in the azure build for the dependency you want to build for, manually start a pipeline build (As of current, this is the `Run Pipeline` button).
|
||||
A variable needs to be added called `RUN_AZURE_ARTIFACTORY_RELEASE`, with a value of `true`. Then when the pipeline gets started, the final build outputs will be updated to artifactory.
|
||||
|
||||
To use newer versions of C++ dependencies, in `shared/config.gradle`, update the version related to the specific dependency.
|
||||
For Java dependencies, there is likely a file related to the specific dependency in the shared folder. Update the version in there.
|
||||
|
||||
Note, changing artifact locations (This includes changing the artifact year currently, I have an issue open to change this) requires updating the `native-utils` plugin
|
||||
|
||||
## Publishing allwpilib
|
||||
allwpilib publishes to the development repo on every push to master. To publish a release build, upload a new tag, and a release will automatically be built and published.
|
||||
|
||||
## Publishing desktop tools
|
||||
Desktop tools publish to the development repo on every push to master. To publish a release build, upload a new tag, and a release will automatically be built and published.
|
||||
|
||||
## Publishing VS Code
|
||||
Before publishing, make sure to update the gradlerio version in `vscode-wpilib/resources/gradle/version.txt` Also make sure the gradle wrapper version matches the wrapper required by gradlerio.
|
||||
Upon pushing a tag, a release will be built, and the files will be uploaded to the releases on GitHub. For publishing to the marketplace, you need a Microsoft account and to be added as a maintainer.
|
||||
|
||||
## Publishing GradleRIO
|
||||
Before publishing, make sure to update the version in build.gradle. Publishing must happen locally, using the command `./gradlew publishPlugin`. This does require your API key for publishing to be set.
|
||||
|
||||
## Building the installer
|
||||
Update the GradleRIO version in gradle.properties, and in the scripts folder in vscode, update the vscode extension. Then push, it will build the installer on azure.
|
||||
@@ -72,6 +72,10 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
|
||||
* hal
|
||||
* wpiutil
|
||||
|
||||
* halsim
|
||||
* imgui
|
||||
* wpiutil
|
||||
|
||||
* ntcore
|
||||
* wpiutil
|
||||
|
||||
@@ -85,7 +89,6 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
|
||||
* opencv
|
||||
* wpiutil
|
||||
|
||||
|
||||
* wpilibj
|
||||
* hal
|
||||
* cameraserver
|
||||
@@ -93,10 +96,35 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
|
||||
* cscore
|
||||
* wpiutil
|
||||
|
||||
|
||||
* wpilibc
|
||||
* hal
|
||||
* cameraserver
|
||||
* ntcore
|
||||
* cscore
|
||||
* wpiutil
|
||||
|
||||
* wpilibNewCommands
|
||||
* wpilibc
|
||||
* hal
|
||||
* cameraserver
|
||||
* ntcore
|
||||
* cscore
|
||||
* wpiutil
|
||||
|
||||
* wpilibNewCommands
|
||||
* wpilibc
|
||||
* hal
|
||||
* cameraserver
|
||||
* ntcore
|
||||
* cscore
|
||||
* wpiutil
|
||||
|
||||
### Third Party Artifacts
|
||||
|
||||
This repository provides the builds of the following third party software.
|
||||
|
||||
All artifacts are based at `edu.wpi.first.thirdparty.frcYEAR` in the repository.
|
||||
|
||||
* googletest
|
||||
* imgui
|
||||
* opencv
|
||||
|
||||
68
OtherVersions.md
Normal file
68
OtherVersions.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Installing Development Builds
|
||||
|
||||
This article contains instructions on building projects using a development build and a local WPILib build.
|
||||
|
||||
**Note:** This only applies to Java/C++ teams.
|
||||
|
||||
## Development Build
|
||||
|
||||
Development builds are the per-commit build hosted everytime a commit is pushed to the [allwpilib](https://github.com/wpilibsuite/allwpilib/) repository. These builds are then hosted on [artifactory](https://frcmaven.wpi.edu/artifactory/webapp/#/home).
|
||||
|
||||
In order to build a project using a development build, find the build.gradle file and open it. Then, add the following code below the plugin section and replace YEAR with the year of the development version.
|
||||
|
||||
```groovy
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.wpilibVersion = 'YEAR.+'
|
||||
```
|
||||
|
||||
The top of your ``build.gradle`` file should now look similar to the code below. Ignore any differences in versions.
|
||||
|
||||
Java
|
||||
```groovy
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2020.3.2"
|
||||
}
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.wpilibVersion = '2020.+'
|
||||
```
|
||||
|
||||
C++
|
||||
```groovy
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2020.3.2"
|
||||
}
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.wpilibVersion = '2020.+'
|
||||
```
|
||||
|
||||
## Local Build
|
||||
|
||||
Building with a local build is very similar to building with a development build. Ensure you have built and published WPILib by following the instructions attached [here](https://github.com/wpilibsuite/allwpilib#building-wpilib). Next, find the ``build.gradle`` file in your robot project and open it. Then, add the following code below the plugin section and replace ``YEAR`` with the year of the local version.
|
||||
|
||||
Java
|
||||
```groovy
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2020.3.2"
|
||||
}
|
||||
|
||||
wpi.maven.useFrcMavenLocalDevelopment = true
|
||||
wpi.wpilibVersion = 'YEAR.424242.+'
|
||||
```
|
||||
|
||||
C++
|
||||
```groovy
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2020.3.2"
|
||||
}
|
||||
|
||||
wpi.maven.useFrcMavenLocalDevelopment = true
|
||||
wpi.wpilibVersion = 'YEAR.424242.+'
|
||||
```
|
||||
@@ -1,6 +1,6 @@
|
||||
# WPILib CMake Support
|
||||
|
||||
WPILib is normally built with Gradle, however for some systems, such a linux based coprocessors, Gradle doesn't work correctly, especially if cscore is needed, which requires OpenCV. We provide the CMake build for these cases. Although it is supported on Windows, these docs will only go over linux builds.
|
||||
WPILib is normally built with Gradle, however for some systems, such as Linux based coprocessors, Gradle doesn't work correctly, especially if cscore is needed, which requires OpenCV. Furthermore, the CMake build can be used for C++ development because it provides better build caching compared to Gradle. We provide the CMake build for these cases. Although it is supported on Windows, these docs will only go over Linux builds.
|
||||
|
||||
## Libraries that get built
|
||||
* wpiutil
|
||||
@@ -9,56 +9,67 @@ WPILib is normally built with Gradle, however for some systems, such a linux bas
|
||||
* cameraserver
|
||||
* hal
|
||||
* wpilib
|
||||
* halsim
|
||||
* wpigui
|
||||
* wpimath
|
||||
|
||||
By default, all libraries except for the HAL and WPILib get built with a default cmake setup. The libraries are built as shared libraries, and include the JNI libraries as well as building the Java jars.
|
||||
By default, all libraries except for the HAL and WPILib get built with a default CMake setup. The libraries are built as shared libraries, and include the JNI libraries as well as building the Java JARs.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The most common prerequisite is going to be OpenCV. OpenCV needs to be findable by cmake. On systems like the Jetson, this is installed by default. Otherwise, you will need to build cmake from source and install it.
|
||||
The most common prerequisite is going to be OpenCV. OpenCV needs to be findable by CMake. On systems like the Jetson, this is installed by default. Otherwise, you will need to build OpenCV from source and install it.
|
||||
|
||||
In addition, if you want JNI and Java, you will need a JDK of at least version 8 installed. In addition, you need a `JAVA_HOME` environment variable set properly and set to the jdk directory.
|
||||
In addition, if you want JNI and Java, you will need a JDK of at least version 11 installed. In addition, you need a `JAVA_HOME` environment variable set properly and set to the JDK directory.
|
||||
|
||||
If you are building with unit tests or simulation modules, you will also need an Internet connection for the initial setup process, as CMake will clone google-test and imgui from GitHub.
|
||||
|
||||
## Build Options
|
||||
|
||||
The following build options are available:
|
||||
|
||||
* WITHOUT_JAVA (OFF Default)
|
||||
* Enabling this option will disable Java and JNI builds. If this is off, `BUILD_SHARED_LIBS` must be on. Otherwise cmake will error.
|
||||
* BUILD_SHARED_LIBS (ON Default)
|
||||
* Disabling this option will cause cmake to build static libraries instead of shared libraries. If this is off, `WITHOUT_JAVA` must be on. Otherwise cmake will error.
|
||||
* WITHOUT_CSCORE (OFF Default)
|
||||
* Enabling this option will cause cscore to not be built. This will also implicitly disable cameraserver, the hal and wpilib as well, irrespective of their specific options. If this is on, the opencv build requirement is removed.
|
||||
* WITHOUT_ALLWPILIB (ON Default)
|
||||
* Disabling this option will build the hal and wpilib during the build. The HAL is the simulator hal, unless the external hal options are used. The cmake build has no capability to build for the RoboRIO.
|
||||
* USE_EXTERNAL_HAL (OFF Default)
|
||||
* `WITH_JAVA` (ON Default)
|
||||
* This option will enable Java and JNI builds. If this is on, `WITH_SHARED_LIBS` must be on. Otherwise CMake will error.
|
||||
* `WITH_SHARED_LIBS` (ON Default)
|
||||
* This option will cause cmake to build static libraries instead of shared libraries. If this is off, `WITH_JAVA` must be off. Otherwise CMake will error.
|
||||
* `WITH_TESTS` (ON Default)
|
||||
* This option will build C++ unit tests. These can be run via `make test`.
|
||||
* `WITH_CSCORE` (ON Default)
|
||||
* This option will cause cscore to be built. Turning this off will implicitly disable cameraserver, the hal and wpilib as well, irrespective of their specific options. If this is off, the OpenCV build requirement is removed.
|
||||
* `WITH_WPILIB` (ON Default)
|
||||
* This option will build the hal, wpilibc/j, and wpimath during the build. The HAL is the simulator hal, unless the external hal options are used. The cmake build has no capability to build for the RoboRIO.
|
||||
* `WITH_SIMULATION_MODULES` (ON Default)
|
||||
* This option will build simulation modules, including wpigui and the HALSim plugins.
|
||||
* `WITH_EXTERNAL_HAL` (OFF Default)
|
||||
* TODO
|
||||
* EXTERNAL_HAL_FILE
|
||||
* `EXTERNAL_HAL_FILE`
|
||||
* TODO
|
||||
* `OPENCV_JAVA_INSTALL_DIR`
|
||||
* Set this option to the location of the archive of the OpenCV Java bindings (it should be called opencv-xxx.jar, with the x'es being version numbers). NOTE: set it to the LOCATION of the file, not the file itself!
|
||||
|
||||
## Build Setup
|
||||
|
||||
The WPILib CMake build does not allow in source builds. Because the `build` directory is used by gradle, we recommend a `buildcmake` directory in the root. This folder is included in the gitignore.
|
||||
The WPILib CMake build does not allow in source builds. Because the `build` directory is used by Gradle, we recommend a `buildcmake` directory in the root. This folder is included in the gitignore.
|
||||
|
||||
Once you have a build folder, run cmake configuration in that build directory with the following command.
|
||||
Once you have a build folder, run CMake configuration in that build directory with the following command.
|
||||
|
||||
```
|
||||
cmake path/to/allwpilib/root
|
||||
```
|
||||
|
||||
If you want to change any of the options, add `-DOPTIONHERE=VALUE` to the cmake command. This will check for any dependencies. If everything works properly this will succeed. If not, please check out the troubleshooting section for help.
|
||||
If you want to change any of the options, add `-DOPTIONHERE=VALUE` to the `cmake` command. This will check for any dependencies. If everything works properly this will succeed. If not, please check out the troubleshooting section for help.
|
||||
|
||||
If you want, you can also use `ccmake` in order to visually set these properties as well.
|
||||
https://cmake.org/cmake/help/v3.0/manual/ccmake.1.html
|
||||
Here is the link to the documentation for that program.
|
||||
If you want, you can also use `ccmake` in order to visually set these properties as well. [Here](https://cmake.org/cmake/help/v3.0/manual/ccmake.1.html) is the link to the documentation for that program.
|
||||
|
||||
## Building
|
||||
|
||||
Once you have cmake setup. run `make` from the directory you configured cmake in. This will build all libraries possible. If you have a multicore system, we recommend running make with multiple jobs. The usual rule of thumb is 1.5x the number of cores you have. To run a multiple job build, run the following command with x being the number of jobs you want.
|
||||
Once you have cmake setup. run `make` from the directory you configured CMake in. This will build all libraries possible. If you have a multicore system, we recommend running `make` with multiple jobs. The usual rule of thumb is 1.5x the number of cores you have. To run a multiple job build, run the following command with x being the number of jobs you want.
|
||||
|
||||
```
|
||||
make -jx
|
||||
```
|
||||
|
||||
The `ninja` generator is also supported, and can be enabled by passing `-GNinja` to the initial `cmake` command.
|
||||
|
||||
## Installing
|
||||
|
||||
After build, the easiest way to use the libraries is to install them. Run the following command to install the libraries. This will install them so that they can be used from external cmake projects.
|
||||
@@ -79,7 +90,7 @@ project(vision_app) # Project Name Here
|
||||
|
||||
find_package(wpilib REQUIRED)
|
||||
|
||||
add_executable(my_vision_app main.cpp) # exectuable name as first parameter
|
||||
add_executable(my_vision_app main.cpp) # executable name as first parameter
|
||||
target_link_libraries(my_vision_app cameraserver ntcore cscore wpiutil)
|
||||
```
|
||||
|
||||
@@ -135,4 +146,4 @@ CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:
|
||||
|
||||
If this happens, make sure you have a JDK of at least version 8 installed, and that your JAVA_HOME variable is set properly to point to the JDK.
|
||||
|
||||
In addition, if you do not need Java, you can disable it with `-DWITHOUT_JAVA=ON`.
|
||||
In addition, if you do not need Java, you can disable it with `-DWITH_JAVA=OFF`.
|
||||
|
||||
70
README.md
70
README.md
@@ -1,21 +1,28 @@
|
||||
# WPILib Project
|
||||
|
||||
[](https://dev.azure.com/wpilib/wpilib/_build/latest?definitionId=1)
|
||||

|
||||
|
||||
Welcome to the WPILib project. This repository contains the HAL, WPILibJ, and WPILibC projects. These are the core libraries for creating robot programs for the roboRIO.
|
||||
|
||||
- [WPILib Mission](#wpilib-mission)
|
||||
- [WPILib Project](#wpilib-project)
|
||||
- [WPILib Mission](#wpilib-mission)
|
||||
- [Building WPILib](#building-wpilib)
|
||||
- [Requirements](#requirements)
|
||||
- [Setup](#setup)
|
||||
- [Building](#building)
|
||||
- [Publishing](#publishing)
|
||||
- [Structure and Organization](#structure-and-organization)
|
||||
- [Requirements](#requirements)
|
||||
- [Setup](#setup)
|
||||
- [Building](#building)
|
||||
- [Faster builds](#faster-builds)
|
||||
- [Using Development Builds](#using-development-builds)
|
||||
- [Custom toolchain location](#custom-toolchain-location)
|
||||
- [Gazebo simulation](#gazebo-simulation)
|
||||
- [Formatting/linting with wpiformat](#formattinglinting-with-wpiformat)
|
||||
- [CMake](#cmake)
|
||||
- [Publishing](#publishing)
|
||||
- [Structure and Organization](#structure-and-organization)
|
||||
- [Contributing to WPILib](#contributing-to-wpilib)
|
||||
|
||||
## WPILib Mission
|
||||
|
||||
The WPILib Mission is to enable FIRST Robotics teams to focus on writing game-specific software rather than focusing on hardware details - "raise the floor, don't lower the ceiling". We work to enable teams with limited programming knowledge and/or mentor experience to be as successful as possible, while not hampering the abilities of teams with more advanced programming capabilities. We support Kit of Parts control system components directly in the library. We also strive to keep parity between major features of each language (Java, C++, and NI's LabVIEW), so that teams aren't at a disadvantage for choosing a specific programming language. WPILib is an open source project, licensed under the BSD 3-clause license. You can find a copy of the license [here](LICENSE.txt).
|
||||
The WPILib Mission is to enable FIRST Robotics teams to focus on writing game-specific software rather than focusing on hardware details - "raise the floor, don't lower the ceiling". We work to enable teams with limited programming knowledge and/or mentor experience to be as successful as possible, while not hampering the abilities of teams with more advanced programming capabilities. We support Kit of Parts control system components directly in the library. We also strive to keep parity between major features of each language (Java, C++, and NI's LabVIEW), so that teams aren't at a disadvantage for choosing a specific programming language. WPILib is an open source project, licensed under the BSD 3-clause license. You can find a copy of the license [here](LICENSE.md).
|
||||
|
||||
# Building WPILib
|
||||
|
||||
@@ -23,13 +30,13 @@ Using Gradle makes building WPILib very straightforward. It only has a few depen
|
||||
|
||||
## Requirements
|
||||
|
||||
- A C++ compiler
|
||||
- On Linux, GCC works fine
|
||||
- On Windows, you need Visual Studio 2019 (the free community edition works fine).
|
||||
Make sure to select the C++ Programming Language for installation
|
||||
- [ARM Compiler Toolchain](https://github.com/wpilibsuite/toolchain-builder/releases)
|
||||
* Note that for 2020 and beyond, you should use version 7 or greater of GCC
|
||||
- Doxygen (Only required if you want to build the C++ documentation)
|
||||
- [JDK 11](https://adoptopenjdk.net/)
|
||||
- C++ compiler
|
||||
- On Linux, install GCC
|
||||
- On Windows, install [Visual Studio Community 2019](https://visualstudio.microsoft.com/vs/community/) and select the C++ programming language during installation (Gradle can't use the build tools for Visual Studio 2019)
|
||||
- On macOS, install the Xcode command-line build tools via `xcode-select --install`
|
||||
- [ARM compiler toolchain](https://github.com/wpilibsuite/roborio-toolchain/releases)
|
||||
- For 2020 and beyond, use GCC version 7 or greater
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -51,12 +58,34 @@ To build a specific subproject, such as WPILibC, you must access the subproject
|
||||
./gradlew :wpilibc:build
|
||||
```
|
||||
|
||||
The gradlew wrapper only exists in the root of the main project, so be sure to run all commands from there. All of the subprojects have build tasks that can be run. Gradle automatically determines and rebuilds dependencies, so if you make a change in the HAL and then run `./gradlew :wpilibc:build`, the HAL will be rebuilt, then WPILibC.
|
||||
|
||||
There are a few tasks other than `build` available. To see them, run the meta-task `tasks`. This will print a list of all available tasks, with a description of each task.
|
||||
|
||||
### Faster builds
|
||||
|
||||
`./gradlew build` builds _everything_, which includes debug and release builds for desktop and all installed cross compilers. Many developers don't need or want to build all of this. Therefore, common tasks have shortcuts to only build necessary components for common development and testing tasks.
|
||||
|
||||
`./gradlew testDesktopCpp` and `./gradlew testDesktopJava` will build and run the tests for `wpilibc` and `wpilibj` respectively. They will only build the minimum components required to run the tests.
|
||||
|
||||
`testDesktopCpp` and `testDesktopJava` tasks also exist for the projects `wpiutil`, `ntcore`, `cscore`, `hal` `wpilibOldCommands`, `wpilibNewCommands` and `cameraserver`. These can be ran with `./gradlew :projectName:task`.
|
||||
|
||||
`./gradlew buildDesktopCpp` and `./gradlew buildDesktopJava` will compile `wpilibcExamples` and `wpilibjExamples` respectively. The results can't be ran, but they can compile.
|
||||
|
||||
### Using Development Builds
|
||||
|
||||
Please read the documentation available [here](OtherVersions.md)
|
||||
|
||||
### Custom toolchain location
|
||||
|
||||
If you have installed the FRC Toolchain to a directory other than the default, or if the Toolchain location is not on your System PATH, you can pass the `toolChainPath` property to specify where it is located. Example:
|
||||
|
||||
```bash
|
||||
./gradlew build -PtoolChainPath=some/path/to/frc/toolchain/bin
|
||||
```
|
||||
|
||||
### Gazebo simulation
|
||||
|
||||
If you also want simulation to be built, add -PmakeSim. This requires gazebo_transport. We have tested on 14.04 and 15.05, but any correct install of Gazebo should work, even on Windows if you build Gazebo from source. Correct means CMake needs to be able to find gazebo-config.cmake. See [The Gazebo website](https://gazebosim.org/) for installation instructions.
|
||||
|
||||
```bash
|
||||
@@ -73,12 +102,19 @@ cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
The gradlew wrapper only exists in the root of the main project, so be sure to run all commands from there. All of the subprojects have build tasks that can be run. Gradle automatically determines and rebuilds dependencies, so if you make a change in the HAL and then run `./gradlew :wpilibc:build`, the HAL will be rebuilt, then WPILibC.
|
||||
|
||||
There are a few tasks other than `build` available. To see them, run the meta-task `tasks`. This will print a list of all available tasks, with a description of each task.
|
||||
### Formatting/linting
|
||||
|
||||
#### wpiformat
|
||||
|
||||
wpiformat can be executed anywhere in the repository via `py -3 -m wpiformat` on Windows or `python3 -m wpiformat` on other platforms.
|
||||
|
||||
#### Java Code Quality Tools
|
||||
|
||||
The Java code quality tools (checkstyle, pmd, etc.) can be run with the `./gradlew javaFormat` task.
|
||||
|
||||
### CMake
|
||||
|
||||
CMake is also supported for building. See [README-CMAKE.md](README-CMAKE.md).
|
||||
|
||||
## Publishing
|
||||
|
||||
@@ -36,14 +36,18 @@ CoreUI wpiutil/src/main/native/resources/coreui-*
|
||||
Feather Icons wpiutil/src/main/native/resources/feather-*
|
||||
jQuery wpiutil/src/main/native/resources/jquery-*
|
||||
popper.js wpiutil/src/main/native/resources/popper-*
|
||||
units wpiutil/src/main/native/include/units/units.h
|
||||
Eigen wpiutil/src/main/native/eigeninclude/
|
||||
units wpimath/src/main/native/include/units/
|
||||
Eigen wpimath/src/main/native/eigeninclude/
|
||||
wpimath/src/main/native/include/unsupported/
|
||||
StackWalker wpiutil/src/main/native/windows/StackWalker.*
|
||||
Team 254 Library wpilibj/src/main/java/edu/wpi/first/wpilibj/spline/SplineParameterizer.java
|
||||
wpilibj/src/main/java/edu/wpi/first/wpilibj/trajectory/TrajectoryParameterizer.java
|
||||
wpilibc/src/main/native/include/spline/SplineParameterizer.h
|
||||
wpilibc/src/main/native/include/trajectory/TrajectoryParameterizer.h
|
||||
wpilibc/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp
|
||||
Portable File Dialogs wpigui/src/main/native/include/portable-file-dialogs.h
|
||||
Drake wpimath/src/main/native/cpp/drake/common/drake_assert_and_throw.cpp
|
||||
wpimath/src/main/native/cpp/drake/math/discrete_algebraic_riccati_equation.cpp
|
||||
|
||||
|
||||
==============================================================================
|
||||
@@ -806,3 +810,38 @@ 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.
|
||||
|
||||
=============
|
||||
Drake Library
|
||||
=============
|
||||
All components of Drake are licensed under the BSD 3-Clause License
|
||||
shown below. Where noted in the source code, some portions may
|
||||
be subject to other permissive, non-viral licenses.
|
||||
|
||||
Copyright 2012-2016 Robot Locomotion Group @ CSAIL
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer. Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution. Neither the name of
|
||||
the Massachusetts Institute of Technology 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.
|
||||
|
||||
@@ -15,7 +15,7 @@ stages:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
container:
|
||||
image: wpilib/roborio-cross-ubuntu:2020-18.04
|
||||
image: wpilib/roborio-cross-ubuntu:2021-18.04
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
|
||||
@@ -1,417 +0,0 @@
|
||||
# Gradle
|
||||
# Build your Java projects and run tests with Gradle using a Gradle wrapper script.
|
||||
# Add steps that analyze code, save build artifacts, deploy, and more:
|
||||
# https://docs.microsoft.com/vsts/pipelines/languages/java
|
||||
|
||||
resources:
|
||||
containers:
|
||||
- container: wpilib2020
|
||||
image: wpilib/roborio-cross-ubuntu:2020-18.04
|
||||
- container: raspbian
|
||||
image: wpilib/raspbian-cross-ubuntu:10-18.04
|
||||
- container: aarch64
|
||||
image: wpilib/aarch64-cross-ubuntu:bionic-18.04
|
||||
- container: ubuntu
|
||||
image: wpilib/ubuntu-base:18.04
|
||||
|
||||
variables:
|
||||
- group: Artifactory-Package-Publish
|
||||
|
||||
trigger:
|
||||
batch: true
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
|
||||
stages:
|
||||
- stage: Build
|
||||
jobs:
|
||||
- job: Linux_Arm
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
container: wpilib2020
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
steps:
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: false
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-Ponlylinuxathena -PbuildServer'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: false
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-Ponlylinuxathena -PreleaseMode -PbuildServer'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Athena'
|
||||
targetPath: 'build/allOutputs'
|
||||
|
||||
- job: Linux_Raspbian
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
container: raspbian
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
steps:
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-Ponlylinuxraspbian -PbuildServer'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-Ponlylinuxraspbian -PreleaseMode -PbuildServer'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Raspbian'
|
||||
targetPath: 'build/allOutputs'
|
||||
|
||||
- job: Linux_Aarch64
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
container: aarch64
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
steps:
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-Ponlylinuxaarch64bionic -PbuildServer'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-Ponlylinuxaarch64bionic -PreleaseMode -PbuildServer'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Aarch64'
|
||||
targetPath: 'build/allOutputs'
|
||||
|
||||
- job: Linux
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
container: ubuntu
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
steps:
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PbuildServer'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PreleaseMode -PbuildServer'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Linux'
|
||||
targetPath: 'build/allOutputs'
|
||||
|
||||
- job: Styleguide
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
container: ubuntu
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
sudo pip3 install wpiformat
|
||||
displayName: 'Install wpiformat'
|
||||
- script: |
|
||||
git checkout -b master
|
||||
wpiformat -clang 6.0
|
||||
displayName: 'Run wpiformat'
|
||||
- script: |
|
||||
# Ensure formatter made no changes
|
||||
git --no-pager diff --exit-code HEAD
|
||||
displayName: 'Check wpiformat Output'
|
||||
|
||||
- job: CMakeBuild
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
container: wpilib2020
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
steps:
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
cmakeArgs: '-DWITHOUT_ALLWPILIB=OFF ..'
|
||||
- script: |
|
||||
make -j3
|
||||
workingDirectory: 'build'
|
||||
displayName: 'Build'
|
||||
|
||||
- job: Windows_64_Bit
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
|
||||
timeoutInMinutes: 0
|
||||
steps:
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
jdkVersionOption: '1.11'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PskipPMD -PbuildServer'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
jdkVersionOption: '1.11'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PskipPMD -PreleaseMode -PbuildServer'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Win64'
|
||||
targetPath: 'build/allOutputs'
|
||||
|
||||
- job: Windows_32_Bit
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
|
||||
timeoutInMinutes: 0
|
||||
steps:
|
||||
- powershell: |
|
||||
mkdir build
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
wget "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x86-32_windows_hotspot_11.0.4_11.zip" -O "build\jdk.zip"
|
||||
displayName: 'Download JDK'
|
||||
- task: JavaToolInstaller@0
|
||||
inputs:
|
||||
jdkSourceOption: localDirectory
|
||||
jdkFile: 'build/jdk.zip'
|
||||
jdkDestinationDirectory: 'build/jdkinst'
|
||||
jdkArchitectureOption: x86
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx1024m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PskipPMD -PbuildServer'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx1024m'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PskipPMD -PreleaseMode -PbuildServer'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Win32'
|
||||
targetPath: 'build/allOutputs'
|
||||
|
||||
- job: Mac
|
||||
pool:
|
||||
vmImage: 'macOS-10.14'
|
||||
|
||||
timeoutInMinutes: 0
|
||||
steps:
|
||||
- script: |
|
||||
mkdir build
|
||||
export JAVA_HOME=`/usr/libexec/java_home -v 11`
|
||||
displayName: 'Setup JDK'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
jdkVersionOption: '1.11'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PbuildServer'
|
||||
|
||||
- task: Gradle@2
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
inputs:
|
||||
workingDirectory: ''
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
jdkVersionOption: '1.11'
|
||||
publishJUnitResults: true
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
tasks: 'build'
|
||||
options: '-PreleaseMode -PbuildServer'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Mac'
|
||||
targetPath: 'build/allOutputs'
|
||||
|
||||
- stage: Combine
|
||||
jobs:
|
||||
- job: CombineJob
|
||||
pool:
|
||||
vmImage: 'macOS-10.14'
|
||||
|
||||
timeoutInMinutes: 0
|
||||
|
||||
steps:
|
||||
- checkout: none
|
||||
- script: |
|
||||
git clone https://github.com/wpilibsuite/build-tools
|
||||
displayName: 'Clone Combiner'
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Mac'
|
||||
targetPath: 'build-tools/combiner/products/build/allOutputs'
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Win32'
|
||||
targetPath: 'build-tools/combiner/products/build/allOutputs'
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Win64'
|
||||
targetPath: 'build-tools/combiner/products/build/allOutputs'
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Linux'
|
||||
targetPath: 'build-tools/combiner/products/build/allOutputs'
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Raspbian'
|
||||
targetPath: 'build-tools/combiner/products/build/allOutputs'
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Athena'
|
||||
targetPath: 'build-tools/combiner/products/build/allOutputs'
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Aarch64'
|
||||
targetPath: 'build-tools/combiner/products/build/allOutputs'
|
||||
|
||||
# PR Builds
|
||||
- task: Gradle@2
|
||||
inputs:
|
||||
workingDirectory: 'build-tools/combiner'
|
||||
gradleWrapperFile: 'build-tools/combiner/gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
tasks: 'publish '
|
||||
options: '-Pallwpilib'
|
||||
condition: and(succeeded(), and(ne(variables['Build.SourceBranch'], 'refs/heads/master'), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))))
|
||||
|
||||
# Master Builds
|
||||
- task: Gradle@2
|
||||
inputs:
|
||||
workingDirectory: 'build-tools/combiner'
|
||||
gradleWrapperFile: 'build-tools/combiner/gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
tasks: 'publish '
|
||||
options: '-Pallwpilib'
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
||||
env:
|
||||
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
|
||||
ARTIFACTORY_PUBLISH_USERNAME: $(PublishUserName)
|
||||
ARTIFACTORY_PUBLISH_PASSWORD: $(PublishPassword)
|
||||
|
||||
# Tagged Builds
|
||||
- task: Gradle@2
|
||||
inputs:
|
||||
workingDirectory: 'build-tools/combiner'
|
||||
gradleWrapperFile: 'build-tools/combiner/gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
tasks: 'publish '
|
||||
options: '-Pallwpilib -PreleaseRepoPublish'
|
||||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
||||
env:
|
||||
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
|
||||
ARTIFACTORY_PUBLISH_USERNAME: $(PublishUserName)
|
||||
ARTIFACTORY_PUBLISH_PASSWORD: $(PublishPassword)
|
||||
|
||||
- script: |
|
||||
echo "##vso[task.setvariable variable=UserHome]$HOME"
|
||||
displayName: 'Set Home Variable'
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Maven'
|
||||
targetPath: $(UserHome)/releases
|
||||
28
build.gradle
28
build.gradle
@@ -2,7 +2,7 @@ import edu.wpi.first.toolchain.*
|
||||
|
||||
plugins {
|
||||
id 'base'
|
||||
id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '4.0.1'
|
||||
id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '4.0.2'
|
||||
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
|
||||
id 'edu.wpi.first.NativeUtils' apply false
|
||||
id 'edu.wpi.first.GradleJni' version '0.10.1'
|
||||
@@ -15,10 +15,12 @@ plugins {
|
||||
|
||||
if (project.hasProperty('buildServer')) {
|
||||
wpilibVersioning.buildServerMode = true
|
||||
wpilibVersioning.useAllTags = true
|
||||
}
|
||||
|
||||
if (project.hasProperty('releaseMode')) {
|
||||
wpilibVersioning.releaseMode = true
|
||||
wpilibVersioning.useAllTags = true
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -39,7 +41,7 @@ buildScan {
|
||||
publishAlways()
|
||||
}
|
||||
|
||||
ext.licenseFile = files("$rootDir/LICENSE.txt", "$rootDir/ThirdPartyNotices.txt")
|
||||
ext.licenseFile = files("$rootDir/LICENSE.md", "$rootDir/ThirdPartyNotices.txt")
|
||||
|
||||
if (project.hasProperty("publishVersion")) {
|
||||
wpilibVersioning.version.set(project.publishVersion)
|
||||
@@ -103,6 +105,26 @@ subprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sign outputs with Developer ID
|
||||
if (project.hasProperty("developerID")) {
|
||||
tasks.withType(AbstractLinkTask) { task ->
|
||||
// Don't sign any executables because codesign complains
|
||||
// about relative rpath.
|
||||
if (!(task instanceof LinkExecutable)) {
|
||||
doLast {
|
||||
// Get path to binary.
|
||||
String path = task.getLinkedFile().getAsFile().get().getAbsolutePath()
|
||||
exec {
|
||||
workingDir rootDir
|
||||
def args = ["sh", "-c", "codesign --force --strict --timestamp --options=runtime " +
|
||||
"--verbose -s ${project.findProperty("developerID")} ${path}"]
|
||||
commandLine args
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext.getCurrentArch = {
|
||||
@@ -110,5 +132,5 @@ ext.getCurrentArch = {
|
||||
}
|
||||
|
||||
wrapper {
|
||||
gradleVersion = '6.0'
|
||||
gradleVersion = '6.0.1'
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ repositories {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation "edu.wpi.first:native-utils:2020.7.2"
|
||||
implementation "edu.wpi.first:native-utils:2021.0.4"
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import org.gradle.api.GradleException;
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.Task;
|
||||
import org.gradle.api.tasks.Copy;
|
||||
import org.gradle.api.file.CopySpec;
|
||||
import org.gradle.api.file.FileTree;
|
||||
import org.gradle.api.tasks.compile.JavaCompile;
|
||||
import org.gradle.language.base.internal.ProjectLayout;
|
||||
@@ -32,6 +34,8 @@ import org.gradle.nativeplatform.toolchain.internal.ToolType;
|
||||
import org.gradle.nativeplatform.toolchain.internal.gcc.AbstractGccCompatibleToolChain;
|
||||
import org.gradle.nativeplatform.toolchain.internal.msvcpp.VisualCppToolChain;
|
||||
import org.gradle.nativeplatform.toolchain.internal.tools.ToolRegistry;
|
||||
import org.gradle.nativeplatform.tasks.CreateStaticLibrary;
|
||||
import org.gradle.nativeplatform.tasks.AbstractLinkTask;
|
||||
import org.gradle.platform.base.BinarySpec;
|
||||
import org.gradle.platform.base.ComponentSpec;
|
||||
import org.gradle.platform.base.ComponentSpecContainer;
|
||||
@@ -79,7 +83,7 @@ class SingleNativeBuild implements Plugin<Project> {
|
||||
components.each { component ->
|
||||
if (component.name == "${nativeName}Base") {
|
||||
base = (NativeLibrarySpec) component
|
||||
} else if (component.name == "${nativeName}" || component.name == "${nativeName}JNI") {
|
||||
} else if (component.name == "${nativeName}" || component.name == "${nativeName}JNI" || component.name == "${nativeName}JNICvStatic") {
|
||||
subs << component
|
||||
}
|
||||
}
|
||||
@@ -100,6 +104,23 @@ class SingleNativeBuild implements Plugin<Project> {
|
||||
baseBin = tmpBaseBin
|
||||
}
|
||||
}
|
||||
|
||||
if (binary instanceof StaticLibraryBinarySpec) {
|
||||
File intoDir = ((CreateStaticLibrary)((StaticLibraryBinarySpec)binary).tasks.createStaticLib).outputFile.get().asFile.parentFile
|
||||
File fromDir = ((CreateStaticLibrary)((StaticLibraryBinarySpec)baseBin).tasks.createStaticLib).outputFile.get().asFile.parentFile
|
||||
|
||||
def copyBasePdbName = "copyBasePdbFor" + binary.buildTask.name
|
||||
def copyTask = project.tasks.register(copyBasePdbName, Copy) { Copy t ->
|
||||
t.from (fromDir)
|
||||
t.include '*.pdb'
|
||||
t.into intoDir
|
||||
|
||||
t.dependsOn (((StaticLibraryBinarySpec)baseBin).tasks.createStaticLib)
|
||||
}
|
||||
((CreateStaticLibrary)((StaticLibraryBinarySpec)binary).tasks.createStaticLib).dependsOn(copyTask)
|
||||
|
||||
}
|
||||
|
||||
baseBin.tasks.withType(AbstractNativeSourceCompileTask) { oCompileTask ->
|
||||
def compileTask = (AbstractNativeSourceCompileTask) oCompileTask
|
||||
if (binary instanceof SharedLibraryBinarySpec) {
|
||||
|
||||
@@ -6,7 +6,7 @@ include(AddTest)
|
||||
find_package( OpenCV REQUIRED )
|
||||
|
||||
# Java bindings
|
||||
if (NOT WITHOUT_JAVA)
|
||||
if (WITH_JAVA)
|
||||
find_package(Java REQUIRED)
|
||||
include(UseJava)
|
||||
set(CMAKE_JAVA_COMPILE_FLAGS "-Xlint:unchecked")
|
||||
@@ -43,11 +43,11 @@ set_property(TARGET cameraserver PROPERTY FOLDER "libraries")
|
||||
install(TARGETS cameraserver EXPORT cameraserver DESTINATION "${main_lib_dest}")
|
||||
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/cameraserver")
|
||||
|
||||
if (NOT WITHOUT_JAVA AND MSVC)
|
||||
if (WITH_JAVA AND MSVC)
|
||||
install(TARGETS cameraserver RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
|
||||
endif()
|
||||
|
||||
if (MSVC OR FLAT_INSTALL_WPILIB)
|
||||
if (WITH_FLAT_INSTALL)
|
||||
set (cameraserver_config_dir ${wpilib_dest})
|
||||
else()
|
||||
set (cameraserver_config_dir share/cameraserver)
|
||||
|
||||
@@ -5,4 +5,5 @@ include(CMakeFindDependencyMacro)
|
||||
@CSCORE_DEP_REPLACE@
|
||||
find_dependency(OpenCV)
|
||||
|
||||
@FILENAME_DEP_REPLACE@
|
||||
include(${SELF_DIR}/cameraserver.cmake)
|
||||
|
||||
@@ -18,7 +18,7 @@ ext {
|
||||
|
||||
apply from: "${rootDir}/shared/opencv.gradle"
|
||||
|
||||
mainClassName = 'Main'
|
||||
mainClassName = 'edu.wpi.Main'
|
||||
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -37,7 +37,6 @@ import edu.wpi.first.networktables.NetworkTableInstance;
|
||||
* Singleton class for creating and keeping camera servers.
|
||||
* Also publishes camera information to NetworkTables.
|
||||
*/
|
||||
@SuppressWarnings("PMD.TooManyMethods")
|
||||
public final class CameraServer {
|
||||
public static final int kBasePort = 1181;
|
||||
|
||||
|
||||
5
cmake/modules/LinkMacOSGUI.cmake
Normal file
5
cmake/modules/LinkMacOSGUI.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
macro(wpilib_link_macos_gui target)
|
||||
if (APPLE)
|
||||
set_target_properties(${target} PROPERTIES LINK_FLAGS "-framework Metal -framework QuartzCore")
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,4 +1,4 @@
|
||||
set(GCC_COMPILER_VERSION "" CACHE STRING "GCC Compiler version")
|
||||
set(GNU_MACHINE "arm-frc2020-linux-gnueabi" CACHE STRING "GNU compiler triple")
|
||||
set(GNU_MACHINE "arm-frc2021-linux-gnueabi" CACHE STRING "GNU compiler triple")
|
||||
set(SOFTFP yes)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/arm.toolchain.cmake")
|
||||
|
||||
@@ -6,6 +6,7 @@ cppHeaderFileInclude {
|
||||
(?<!_c)\.h$
|
||||
\.hpp$
|
||||
\.inc$
|
||||
\.inl$
|
||||
}
|
||||
|
||||
cppSrcFileInclude {
|
||||
|
||||
@@ -3,6 +3,7 @@ project(cscore)
|
||||
include(SubDirList)
|
||||
include(CompileWarnings)
|
||||
include(AddTest)
|
||||
include(LinkMacOSGUI)
|
||||
|
||||
find_package( OpenCV REQUIRED )
|
||||
|
||||
@@ -39,7 +40,7 @@ set_property(TARGET cscore PROPERTY FOLDER "libraries")
|
||||
install(TARGETS cscore EXPORT cscore DESTINATION "${main_lib_dest}")
|
||||
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/cscore")
|
||||
|
||||
if (MSVC OR FLAT_INSTALL_WPILIB)
|
||||
if (WITH_FLAT_INSTALL)
|
||||
set (cscore_config_dir ${wpilib_dest})
|
||||
else()
|
||||
set (cscore_config_dir share/cscore)
|
||||
@@ -52,16 +53,29 @@ install(EXPORT cscore DESTINATION ${cscore_config_dir})
|
||||
SUBDIR_LIST(cscore_examples "${CMAKE_CURRENT_SOURCE_DIR}/examples")
|
||||
foreach(example ${cscore_examples})
|
||||
file(GLOB cscore_example_src examples/${example}/*.cpp)
|
||||
unset(add_libs)
|
||||
if(${example} STREQUAL "usbviewer")
|
||||
if(TARGET wpigui)
|
||||
set(add_libs wpigui)
|
||||
else()
|
||||
unset(cscore_example_src)
|
||||
endif()
|
||||
endif()
|
||||
if(cscore_example_src)
|
||||
add_executable(cscore_${example} ${cscore_example_src})
|
||||
wpilib_target_warnings(cscore_${example})
|
||||
target_link_libraries(cscore_${example} cscore)
|
||||
|
||||
if (${example} STREQUAL "usbviewer")
|
||||
wpilib_link_macos_gui(cscore_${example})
|
||||
endif()
|
||||
|
||||
target_link_libraries(cscore_${example} cscore ${add_libs})
|
||||
set_property(TARGET cscore_${example} PROPERTY FOLDER "examples")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Java bindings
|
||||
if (NOT WITHOUT_JAVA)
|
||||
if (WITH_JAVA)
|
||||
find_package(Java REQUIRED)
|
||||
find_package(JNI REQUIRED)
|
||||
include(UseJava)
|
||||
@@ -69,7 +83,9 @@ if (NOT WITHOUT_JAVA)
|
||||
|
||||
#find java files, copy them locally
|
||||
|
||||
set(OPENCV_JAVA_INSTALL_DIR ${OpenCV_INSTALL_PATH}/share/OpenCV/java/)
|
||||
if("${OPENCV_JAVA_INSTALL_DIR}" STREQUAL "")
|
||||
set(OPENCV_JAVA_INSTALL_DIR ${OpenCV_INSTALL_PATH}/share/OpenCV/java/)
|
||||
endif()
|
||||
|
||||
find_file(OPENCV_JAR_FILE NAMES opencv-${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.jar PATHS ${OPENCV_JAVA_INSTALL_DIR} ${OpenCV_INSTALL_PATH}/bin NO_DEFAULT_PATH)
|
||||
find_file(OPENCV_JNI_FILE NAMES libopencv_java${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.so
|
||||
|
||||
@@ -15,15 +15,60 @@ ext {
|
||||
|
||||
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
|
||||
|
||||
model {
|
||||
components {
|
||||
cscoreJNICvStatic(JniNativeLibrarySpec) {
|
||||
baseName = 'cscorejnicvstatic'
|
||||
|
||||
enableCheckTask true
|
||||
javaCompileTasks << compileJava
|
||||
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.roborio)
|
||||
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.raspbian)
|
||||
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.aarch64bionic)
|
||||
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/main/native/cpp'
|
||||
include '**/jni/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src/main/native/include'
|
||||
include '**/*.h'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
binaries.all {
|
||||
if (it instanceof StaticLibraryBinarySpec) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
|
||||
if (it.targetPlatform.operatingSystem.linux) {
|
||||
it.linker.args '-Wl,--version-script=' + file('src/main/native/LinuxSymbolScript.txt')
|
||||
} else if (it.targetPlatform.operatingSystem.macOsX) {
|
||||
it.linker.args '-exported_symbols_list'
|
||||
it.linker.args file('src/main/native/MacSymbolScript.txt').toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ext {
|
||||
sharedCvConfigs = [cscore : [],
|
||||
cscoreBase: [],
|
||||
cscoreDev : [],
|
||||
cscoreTest: [],
|
||||
cscoreJNIShared: []]
|
||||
staticCvConfigs = [cscoreJNI: []]
|
||||
staticCvConfigs = [cscoreJNI: [],
|
||||
cscoreJNICvStatic: []]
|
||||
useJava = true
|
||||
useCpp = true
|
||||
cvStaticBuild = true
|
||||
splitSetup = {
|
||||
if (it.targetPlatform.operatingSystem.isMacOsX()) {
|
||||
it.sources {
|
||||
@@ -112,22 +157,63 @@ nativeUtils.exportsConfigs {
|
||||
symbols.removeIf({ !it.startsWith('CS_') })
|
||||
}
|
||||
}
|
||||
cscoreJNICvStatic {
|
||||
x86SymbolFilter = { symbols ->
|
||||
symbols.removeIf({ !it.startsWith('CS_') })
|
||||
}
|
||||
x64SymbolFilter = { symbols ->
|
||||
symbols.removeIf({ !it.startsWith('CS_') })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model {
|
||||
components {
|
||||
examplesMap.each { key, value ->
|
||||
"${key}"(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
binaries.all {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib library: 'cscore', linkage: 'shared'
|
||||
if (key == "usbviewer") {
|
||||
if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian') && !project.hasProperty('onlylinuxaarch64bionic')) {
|
||||
"${key}"(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
binaries.all {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib library: 'cscore', linkage: 'shared'
|
||||
nativeUtils.useRequiredLibrary(it, 'imgui_static')
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.raspbian || it.targetPlatform.name == nativeUtils.wpi.platforms.aarch64bionic) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
|
||||
it.linker.args << '-framework' << 'Metal' << '-framework' << 'MetalKit' << '-framework' << 'Cocoa' << '-framework' << 'IOKit' << '-framework' << 'CoreFoundation' << '-framework' << 'CoreVideo' << '-framework' << 'QuartzCore'
|
||||
} else {
|
||||
it.linker.args << '-lX11'
|
||||
}
|
||||
}
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'examples/' + "${key}"
|
||||
include '**/*.cpp'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'examples/' + "${key}"
|
||||
include '**/*.cpp'
|
||||
} else {
|
||||
"${key}"(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
binaries.all {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib library: 'cscore', linkage: 'shared'
|
||||
}
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'examples/' + "${key}"
|
||||
include '**/*.cpp'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,5 @@ include(CMakeFindDependencyMacro)
|
||||
@WPIUTIL_DEP_REPLACE@
|
||||
find_dependency(OpenCV)
|
||||
|
||||
@FILENAME_DEP_REPLACE@
|
||||
include(${SELF_DIR}/cscore.cmake)
|
||||
|
||||
114
cscore/examples/usbviewer/usbviewer.cpp
Normal file
114
cscore/examples/usbviewer/usbviewer.cpp
Normal file
@@ -0,0 +1,114 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/spinlock.h>
|
||||
#include <wpigui.h>
|
||||
|
||||
#include "cscore.h"
|
||||
#include "cscore_cv.h"
|
||||
|
||||
namespace gui = wpi::gui;
|
||||
|
||||
int main() {
|
||||
std::atomic<cv::Mat*> latestFrame{nullptr};
|
||||
std::vector<cv::Mat*> sharedFreeList;
|
||||
wpi::spinlock sharedFreeListMutex;
|
||||
std::vector<cv::Mat*> sourceFreeList;
|
||||
std::atomic<bool> stopCamera{false};
|
||||
|
||||
cs::UsbCamera camera{"usbcam", 0};
|
||||
camera.SetVideoMode(cs::VideoMode::kMJPEG, 640, 480, 30);
|
||||
cs::CvSink cvsink{"cvsink"};
|
||||
cvsink.SetSource(camera);
|
||||
|
||||
std::thread thr([&] {
|
||||
cv::Mat frame;
|
||||
while (!stopCamera) {
|
||||
// get frame from camera
|
||||
uint64_t time = cvsink.GrabFrame(frame);
|
||||
if (time == 0) {
|
||||
wpi::outs() << "error: " << cvsink.GetError() << '\n';
|
||||
continue;
|
||||
}
|
||||
|
||||
// get or create a mat, prefer sourceFreeList over sharedFreeList
|
||||
cv::Mat* out;
|
||||
if (!sourceFreeList.empty()) {
|
||||
out = sourceFreeList.back();
|
||||
sourceFreeList.pop_back();
|
||||
} else {
|
||||
{
|
||||
std::scoped_lock lock(sharedFreeListMutex);
|
||||
for (auto mat : sharedFreeList) sourceFreeList.emplace_back(mat);
|
||||
sharedFreeList.clear();
|
||||
}
|
||||
if (!sourceFreeList.empty()) {
|
||||
out = sourceFreeList.back();
|
||||
sourceFreeList.pop_back();
|
||||
} else {
|
||||
out = new cv::Mat;
|
||||
}
|
||||
}
|
||||
|
||||
// convert to RGBA
|
||||
cv::cvtColor(frame, *out, cv::COLOR_BGR2RGBA);
|
||||
|
||||
// make available
|
||||
auto prev = latestFrame.exchange(out);
|
||||
|
||||
// put prev on free list
|
||||
if (prev) sourceFreeList.emplace_back(prev);
|
||||
}
|
||||
});
|
||||
|
||||
gui::CreateContext();
|
||||
gui::Initialize("Hello World", 1024, 768);
|
||||
gui::Texture tex;
|
||||
gui::AddEarlyExecute([&] {
|
||||
auto frame = latestFrame.exchange(nullptr);
|
||||
if (frame) {
|
||||
// create or update texture
|
||||
if (!tex || frame->cols != tex.GetWidth() ||
|
||||
frame->rows != tex.GetHeight()) {
|
||||
tex = gui::Texture(gui::kPixelRGBA, frame->cols, frame->rows,
|
||||
frame->data);
|
||||
} else {
|
||||
tex.Update(frame->data);
|
||||
}
|
||||
// put back on shared freelist
|
||||
std::scoped_lock lock(sharedFreeListMutex);
|
||||
sharedFreeList.emplace_back(frame);
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(640, 480), ImGuiCond_FirstUseEver);
|
||||
if (ImGui::Begin("Video")) {
|
||||
// render to window (best fit)
|
||||
if (tex && tex.GetWidth() != 0 && tex.GetHeight() != 0) {
|
||||
auto drawList = ImGui::GetWindowDrawList();
|
||||
ImVec2 windowPos = ImGui::GetWindowPos();
|
||||
ImVec2 imageMin = ImGui::GetWindowContentRegionMin();
|
||||
ImVec2 imageMax = ImGui::GetWindowContentRegionMax();
|
||||
gui::MaxFit(&imageMin, &imageMax, tex.GetWidth(), tex.GetHeight());
|
||||
drawList->AddImage(tex, windowPos + imageMin, windowPos + imageMax);
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
});
|
||||
gui::Main();
|
||||
stopCamera = true;
|
||||
thr.join();
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -120,6 +120,7 @@ public class CameraServerJNI {
|
||||
//
|
||||
// UsbCamera Source Functions
|
||||
//
|
||||
public static native void setUsbCameraPath(int source, String path);
|
||||
public static native String getUsbCameraPath(int source);
|
||||
public static native UsbCameraInfo getUsbCameraInfo(int source);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -40,6 +40,13 @@ public class UsbCamera extends VideoCamera {
|
||||
return CameraServerJNI.enumerateUsbCameras();
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the path to the device.
|
||||
*/
|
||||
void setPath(String path) {
|
||||
CameraServerJNI.setUsbCameraPath(m_handle, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to the device.
|
||||
*/
|
||||
|
||||
4
cscore/src/main/native/LinuxSymbolScript.txt
Normal file
4
cscore/src/main/native/LinuxSymbolScript.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
cscorejnicvstatic {
|
||||
global: CS_*; JNI_*; Java_*; # explicitly list symbols to be exported
|
||||
local: *; # hide everything else
|
||||
};
|
||||
3
cscore/src/main/native/MacSymbolScript.txt
Normal file
3
cscore/src/main/native/MacSymbolScript.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
_CS_*
|
||||
_JNI_*
|
||||
_Java_*
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -62,21 +62,21 @@ int ConfigurableSourceImpl::CreateProperty(const wpi::Twine& name,
|
||||
int maximum, int step,
|
||||
int defaultValue, int value) {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
int ndx = CreateOrUpdateProperty(name,
|
||||
[=] {
|
||||
return std::make_unique<PropertyImpl>(
|
||||
name, kind, minimum, maximum, step,
|
||||
defaultValue, value);
|
||||
},
|
||||
[&](PropertyImpl& prop) {
|
||||
// update all but value
|
||||
prop.propKind = kind;
|
||||
prop.minimum = minimum;
|
||||
prop.maximum = maximum;
|
||||
prop.step = step;
|
||||
prop.defaultValue = defaultValue;
|
||||
value = prop.value;
|
||||
});
|
||||
int ndx = CreateOrUpdateProperty(
|
||||
name,
|
||||
[=] {
|
||||
return std::make_unique<PropertyImpl>(name, kind, minimum, maximum,
|
||||
step, defaultValue, value);
|
||||
},
|
||||
[&](PropertyImpl& prop) {
|
||||
// update all but value
|
||||
prop.propKind = kind;
|
||||
prop.minimum = minimum;
|
||||
prop.maximum = maximum;
|
||||
prop.step = step;
|
||||
prop.defaultValue = defaultValue;
|
||||
value = prop.value;
|
||||
});
|
||||
m_notifier.NotifySourceProperty(*this, CS_SOURCE_PROPERTY_CREATED, name, ndx,
|
||||
kind, value, wpi::Twine{});
|
||||
return ndx;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -44,6 +44,11 @@ CS_Source CS_CreateUsbCameraPath(const char* name, const char* path,
|
||||
return cs::CreateUsbCameraPath(name, path, status);
|
||||
}
|
||||
|
||||
void CS_SetUsbCameraPath(CS_Source source, const char* path,
|
||||
CS_Status* status) {
|
||||
cs::SetUsbCameraPath(source, path, status);
|
||||
}
|
||||
|
||||
char* CS_GetUsbCameraPath(CS_Source source, CS_Status* status) {
|
||||
return ConvertToC(cs::GetUsbCameraPath(source, status));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -1026,6 +1026,20 @@ Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureManual
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: setUsbCameraPath
|
||||
* Signature: (ILjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setUsbCameraPath
|
||||
(JNIEnv* env, jclass, jint source, jstring path)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
cs::SetUsbCameraPath(source, JStringRef{env, path}.str(), &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: getUsbCameraPath
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -228,7 +228,7 @@ struct CS_Event {
|
||||
};
|
||||
|
||||
/**
|
||||
* USB camera infomation
|
||||
* USB camera information
|
||||
*/
|
||||
typedef struct CS_UsbCameraInfo {
|
||||
int dev;
|
||||
@@ -338,6 +338,7 @@ void CS_SetCameraExposureManual(CS_Source source, int value, CS_Status* status);
|
||||
* @defgroup cscore_usbcamera_cfunc UsbCamera Source Functions
|
||||
* @{
|
||||
*/
|
||||
void CS_SetUsbCameraPath(CS_Source source, const char* path, CS_Status* status);
|
||||
char* CS_GetUsbCameraPath(CS_Source source, CS_Status* status);
|
||||
CS_UsbCameraInfo* CS_GetUsbCameraInfo(CS_Source source, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -274,6 +274,7 @@ void SetCameraExposureManual(CS_Source source, int value, CS_Status* status);
|
||||
* @defgroup cscore_usbcamera_func UsbCamera Source Functions
|
||||
* @{
|
||||
*/
|
||||
void SetUsbCameraPath(CS_Source, const wpi::Twine& path, CS_Status* status);
|
||||
std::string GetUsbCameraPath(CS_Source source, CS_Status* status);
|
||||
UsbCameraInfo GetUsbCameraInfo(CS_Source source, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -444,6 +444,11 @@ class UsbCamera : public VideoCamera {
|
||||
*/
|
||||
static std::vector<UsbCameraInfo> EnumerateUsbCameras();
|
||||
|
||||
/**
|
||||
* Change the path to the device.
|
||||
*/
|
||||
void SetPath(const wpi::Twine& path);
|
||||
|
||||
/**
|
||||
* Get the path to the device.
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2015. All Rights Reserved. */
|
||||
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CSCORE_OO_INL_
|
||||
#define CSCORE_OO_INL_
|
||||
#ifndef CSCORE_CSCORE_OO_INL_
|
||||
#define CSCORE_CSCORE_OO_INL_
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace cs {
|
||||
|
||||
@@ -76,7 +80,7 @@ inline VideoProperty::VideoProperty(CS_Property handle) : m_handle(handle) {
|
||||
}
|
||||
|
||||
inline VideoProperty::VideoProperty(CS_Property handle, Kind kind)
|
||||
: m_status(0), m_handle(handle), m_kind(kind) {}
|
||||
: m_status(0), m_handle(handle), m_kind(kind) {}
|
||||
|
||||
inline VideoSource::VideoSource(const VideoSource& source)
|
||||
: m_handle(source.m_handle == 0 ? 0
|
||||
@@ -255,6 +259,11 @@ inline std::vector<UsbCameraInfo> UsbCamera::EnumerateUsbCameras() {
|
||||
return ::cs::EnumerateUsbCameras(&status);
|
||||
}
|
||||
|
||||
inline void UsbCamera::SetPath(const wpi::Twine& path) {
|
||||
m_status = 0;
|
||||
return ::cs::SetUsbCameraPath(m_handle, path, &m_status);
|
||||
}
|
||||
|
||||
inline std::string UsbCamera::GetPath() const {
|
||||
m_status = 0;
|
||||
return ::cs::GetUsbCameraPath(m_handle, &m_status);
|
||||
@@ -394,10 +403,10 @@ inline void ImageSource::SetDescription(const wpi::Twine& description) {
|
||||
}
|
||||
|
||||
inline VideoProperty ImageSource::CreateProperty(const wpi::Twine& name,
|
||||
VideoProperty::Kind kind,
|
||||
int minimum, int maximum,
|
||||
int step, int defaultValue,
|
||||
int value) {
|
||||
VideoProperty::Kind kind,
|
||||
int minimum, int maximum,
|
||||
int step, int defaultValue,
|
||||
int value) {
|
||||
m_status = 0;
|
||||
return VideoProperty{CreateSourceProperty(
|
||||
m_handle, name, static_cast<CS_PropertyKind>(static_cast<int>(kind)),
|
||||
@@ -405,35 +414,41 @@ inline VideoProperty ImageSource::CreateProperty(const wpi::Twine& name,
|
||||
}
|
||||
|
||||
inline VideoProperty ImageSource::CreateIntegerProperty(const wpi::Twine& name,
|
||||
int minimum, int maximum,
|
||||
int step, int defaultValue,
|
||||
int value) {
|
||||
int minimum,
|
||||
int maximum, int step,
|
||||
int defaultValue,
|
||||
int value) {
|
||||
m_status = 0;
|
||||
return VideoProperty{CreateSourceProperty(
|
||||
m_handle, name, static_cast<CS_PropertyKind>(static_cast<int>(VideoProperty::Kind::kInteger)),
|
||||
m_handle, name,
|
||||
static_cast<CS_PropertyKind>(
|
||||
static_cast<int>(VideoProperty::Kind::kInteger)),
|
||||
minimum, maximum, step, defaultValue, value, &m_status)};
|
||||
}
|
||||
|
||||
inline VideoProperty ImageSource::CreateBooleanProperty(const wpi::Twine& name,
|
||||
bool defaultValue,
|
||||
bool value) {
|
||||
bool defaultValue,
|
||||
bool value) {
|
||||
m_status = 0;
|
||||
return VideoProperty{CreateSourceProperty(
|
||||
m_handle, name, static_cast<CS_PropertyKind>(static_cast<int>(VideoProperty::Kind::kBoolean)),
|
||||
m_handle, name,
|
||||
static_cast<CS_PropertyKind>(
|
||||
static_cast<int>(VideoProperty::Kind::kBoolean)),
|
||||
0, 1, 1, defaultValue ? 1 : 0, value ? 1 : 0, &m_status)};
|
||||
}
|
||||
|
||||
inline VideoProperty ImageSource::CreateStringProperty(const wpi::Twine& name,
|
||||
const wpi::Twine& value) {
|
||||
inline VideoProperty ImageSource::CreateStringProperty(
|
||||
const wpi::Twine& name, const wpi::Twine& value) {
|
||||
m_status = 0;
|
||||
auto prop = VideoProperty{CreateSourceProperty(
|
||||
m_handle, name, static_cast<CS_PropertyKind>(static_cast<int>(VideoProperty::Kind::kString)),
|
||||
0, 0, 0, 0, 0, &m_status)};
|
||||
auto prop = VideoProperty{
|
||||
CreateSourceProperty(m_handle, name,
|
||||
static_cast<CS_PropertyKind>(
|
||||
static_cast<int>(VideoProperty::Kind::kString)),
|
||||
0, 0, 0, 0, 0, &m_status)};
|
||||
prop.SetString(value);
|
||||
return prop;
|
||||
}
|
||||
|
||||
|
||||
inline void ImageSource::SetEnumPropertyChoices(
|
||||
const VideoProperty& property, wpi::ArrayRef<std::string> choices) {
|
||||
m_status = 0;
|
||||
@@ -441,8 +456,8 @@ inline void ImageSource::SetEnumPropertyChoices(
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void ImageSource::SetEnumPropertyChoices(const VideoProperty& property,
|
||||
std::initializer_list<T> choices) {
|
||||
inline void ImageSource::SetEnumPropertyChoices(
|
||||
const VideoProperty& property, std::initializer_list<T> choices) {
|
||||
std::vector<std::string> vec;
|
||||
vec.reserve(choices.size());
|
||||
for (const auto& choice : choices) vec.emplace_back(choice);
|
||||
@@ -618,4 +633,4 @@ inline VideoListener::~VideoListener() {
|
||||
|
||||
} // namespace cs
|
||||
|
||||
#endif /* CSCORE_OO_INL_ */
|
||||
#endif // CSCORE_CSCORE_OO_INL_
|
||||
|
||||
@@ -223,6 +223,25 @@ static bool GetDescriptionIoctl(const char* cpath, std::string* desc) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IsVideoCaptureDevice(const char* cpath) {
|
||||
int fd = open(cpath, O_RDWR);
|
||||
if (fd < 0) return false;
|
||||
|
||||
struct v4l2_capability vcap;
|
||||
std::memset(&vcap, 0, sizeof(vcap));
|
||||
if (DoIoctl(fd, VIDIOC_QUERYCAP, &vcap) < 0) {
|
||||
close(fd);
|
||||
return false;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
return (vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE) != 0 &&
|
||||
(vcap.capabilities & V4L2_CAP_STREAMING) != 0 &&
|
||||
((vcap.capabilities & V4L2_CAP_DEVICE_CAPS) == 0 ||
|
||||
((vcap.device_caps & V4L2_CAP_VIDEO_CAPTURE) != 0 &&
|
||||
(vcap.device_caps & V4L2_CAP_STREAMING) != 0));
|
||||
}
|
||||
|
||||
static int GetDeviceNum(const char* cpath) {
|
||||
wpi::StringRef path{cpath};
|
||||
std::string pathBuf;
|
||||
@@ -264,10 +283,10 @@ UsbCameraImpl::UsbCameraImpl(const wpi::Twine& name, wpi::Logger& logger,
|
||||
Notifier& notifier, Telemetry& telemetry,
|
||||
const wpi::Twine& path)
|
||||
: SourceImpl{name, logger, notifier, telemetry},
|
||||
m_path{path.str()},
|
||||
m_fd{-1},
|
||||
m_command_fd{eventfd(0, 0)},
|
||||
m_active{true} {
|
||||
m_active{true},
|
||||
m_path{path.str()} {
|
||||
SetDescription(GetDescriptionImpl(m_path.c_str()));
|
||||
SetQuirks();
|
||||
|
||||
@@ -765,6 +784,22 @@ CS_StatusValue UsbCameraImpl::DeviceCmdSetProperty(
|
||||
return CS_OK;
|
||||
}
|
||||
|
||||
CS_StatusValue UsbCameraImpl::DeviceCmdSetPath(
|
||||
std::unique_lock<wpi::mutex>& lock, const Message& msg) {
|
||||
m_path = msg.dataStr;
|
||||
lock.unlock();
|
||||
// disconnect and reconnect
|
||||
bool wasStreaming = m_streaming;
|
||||
if (wasStreaming) DeviceStreamOff();
|
||||
if (m_fd >= 0) {
|
||||
DeviceDisconnect();
|
||||
DeviceConnect();
|
||||
}
|
||||
if (wasStreaming) DeviceStreamOn();
|
||||
lock.lock();
|
||||
return CS_OK;
|
||||
}
|
||||
|
||||
CS_StatusValue UsbCameraImpl::DeviceProcessCommand(
|
||||
std::unique_lock<wpi::mutex>& lock, const Message& msg) {
|
||||
if (msg.kind == Message::kCmdSetMode ||
|
||||
@@ -778,6 +813,8 @@ CS_StatusValue UsbCameraImpl::DeviceProcessCommand(
|
||||
} else if (msg.kind == Message::kNumSinksChanged ||
|
||||
msg.kind == Message::kNumSinksEnabledChanged) {
|
||||
return CS_OK;
|
||||
} else if (msg.kind == Message::kCmdSetPath) {
|
||||
return DeviceCmdSetPath(lock, msg);
|
||||
} else {
|
||||
return CS_OK;
|
||||
}
|
||||
@@ -1358,6 +1395,17 @@ void UsbCameraImpl::NumSinksEnabledChanged() {
|
||||
Send(Message{Message::kNumSinksEnabledChanged});
|
||||
}
|
||||
|
||||
void UsbCameraImpl::SetPath(const wpi::Twine& path, CS_Status* status) {
|
||||
Message msg{Message::kCmdSetPath};
|
||||
msg.dataStr = path.str();
|
||||
*status = SendAndWait(std::move(msg));
|
||||
}
|
||||
|
||||
std::string UsbCameraImpl::GetPath() const {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
return m_path;
|
||||
}
|
||||
|
||||
namespace cs {
|
||||
|
||||
CS_Source CreateUsbCameraDev(const wpi::Twine& name, int dev,
|
||||
@@ -1376,6 +1424,16 @@ CS_Source CreateUsbCameraPath(const wpi::Twine& name, const wpi::Twine& path,
|
||||
inst.telemetry, path));
|
||||
}
|
||||
|
||||
void SetUsbCameraPath(CS_Source source, const wpi::Twine& path,
|
||||
CS_Status* status) {
|
||||
auto data = Instance::GetInstance().GetSource(source);
|
||||
if (!data || data->kind != CS_SOURCE_USB) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
return;
|
||||
}
|
||||
static_cast<UsbCameraImpl&>(*data->source).SetPath(path, status);
|
||||
}
|
||||
|
||||
std::string GetUsbCameraPath(CS_Source source, CS_Status* status) {
|
||||
auto data = Instance::GetInstance().GetSource(source);
|
||||
if (!data || data->kind != CS_SOURCE_USB) {
|
||||
@@ -1453,6 +1511,8 @@ std::vector<UsbCameraInfo> EnumerateUsbCameras(CS_Status* status) {
|
||||
path += fname;
|
||||
info.path = path.str();
|
||||
|
||||
if (!IsVideoCaptureDevice(path.c_str())) continue;
|
||||
|
||||
info.name = GetDescriptionImpl(path.c_str());
|
||||
if (info.name.empty()) continue;
|
||||
|
||||
|
||||
@@ -66,12 +66,14 @@ class UsbCameraImpl : public SourceImpl {
|
||||
void NumSinksChanged() override;
|
||||
void NumSinksEnabledChanged() override;
|
||||
|
||||
std::string GetPath() { return m_path; }
|
||||
void SetPath(const wpi::Twine& path, CS_Status* status);
|
||||
std::string GetPath() const;
|
||||
|
||||
// Messages passed to/from camera thread
|
||||
struct Message {
|
||||
enum Kind {
|
||||
kNone = 0,
|
||||
kCmdSetPath,
|
||||
kCmdSetMode,
|
||||
kCmdSetPixelFormat,
|
||||
kCmdSetResolution,
|
||||
@@ -132,6 +134,8 @@ class UsbCameraImpl : public SourceImpl {
|
||||
const Message& msg);
|
||||
CS_StatusValue DeviceCmdSetProperty(std::unique_lock<wpi::mutex>& lock,
|
||||
const Message& msg);
|
||||
CS_StatusValue DeviceCmdSetPath(std::unique_lock<wpi::mutex>& lock,
|
||||
const Message& msg);
|
||||
|
||||
// Property helper functions
|
||||
int RawToPercentage(const UsbCameraProperty& rawProp, int rawValue);
|
||||
@@ -152,11 +156,6 @@ class UsbCameraImpl : public SourceImpl {
|
||||
static constexpr int kNumBuffers = 4;
|
||||
std::array<UsbCameraBuffer, kNumBuffers> m_buffers;
|
||||
|
||||
//
|
||||
// Path never changes, so not protected by mutex.
|
||||
//
|
||||
std::string m_path;
|
||||
|
||||
std::atomic_int m_fd;
|
||||
std::atomic_int m_command_fd; // for command eventfd
|
||||
|
||||
@@ -176,6 +175,9 @@ class UsbCameraImpl : public SourceImpl {
|
||||
mutable std::vector<Message> m_commands;
|
||||
mutable std::vector<std::pair<std::thread::id, CS_StatusValue>> m_responses;
|
||||
mutable wpi::condition_variable m_responseCv;
|
||||
|
||||
// Path
|
||||
std::string m_path;
|
||||
};
|
||||
|
||||
} // namespace cs
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -21,6 +21,11 @@ CS_Source CreateUsbCameraPath(const wpi::Twine& name, const wpi::Twine& path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetUsbCameraPath(CS_Source source, const wpi::Twine& path,
|
||||
CS_Status* status) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
std::string GetUsbCameraPath(CS_Source source, CS_Status* status) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
return std::string{};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -198,6 +198,20 @@ void UsbCameraImpl::NumSinksEnabledChanged() {
|
||||
SetCameraMessage, Message::kNumSinksEnabledChanged, nullptr);
|
||||
}
|
||||
|
||||
void UsbCameraImpl::SetPath(const wpi::Twine& path, CS_Status* status) {
|
||||
Message msg{Message::kCmdSetPath};
|
||||
msg.dataStr = path.str();
|
||||
auto result =
|
||||
m_messagePump->SendWindowMessage<CS_Status, Message::Kind, Message*>(
|
||||
SetCameraMessage, msg.kind, &msg);
|
||||
*status = result;
|
||||
}
|
||||
|
||||
std::string UsbCameraImpl::GetPath() const {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
return m_path;
|
||||
}
|
||||
|
||||
void UsbCameraImpl::StartMessagePump() {
|
||||
m_messagePump = std::make_unique<WindowsMessagePump>(
|
||||
[this](HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) {
|
||||
@@ -705,6 +719,16 @@ CS_StatusValue UsbCameraImpl::DeviceProcessCommand(
|
||||
DeviceStreamOn();
|
||||
}
|
||||
return CS_OK;
|
||||
} else if (msgKind == Message::kCmdSetPath) {
|
||||
{
|
||||
std::scoped_lock lock(m_mutex);
|
||||
m_path = msg->dataStr;
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_conv;
|
||||
m_widePath = utf8_conv.from_bytes(m_path.c_str());
|
||||
}
|
||||
DeviceDisconnect();
|
||||
DeviceConnect();
|
||||
return CS_OK;
|
||||
} else {
|
||||
return CS_OK;
|
||||
}
|
||||
@@ -966,6 +990,27 @@ void UsbCameraImpl::DeviceCacheVideoModes() {
|
||||
m_notifier.NotifySource(*this, CS_SOURCE_VIDEOMODES_UPDATED);
|
||||
}
|
||||
|
||||
static void ParseVidAndPid(wpi::StringRef path, int* pid, int* vid) {
|
||||
auto vidIndex = path.find_lower("vid_");
|
||||
auto pidIndex = path.find_lower("pid_");
|
||||
|
||||
if (vidIndex != wpi::StringRef::npos) {
|
||||
auto vidSlice = path.slice(vidIndex + 4, vidIndex + 8);
|
||||
uint16_t val = 0;
|
||||
if (!vidSlice.getAsInteger(16, val)) {
|
||||
*vid = val;
|
||||
}
|
||||
}
|
||||
|
||||
if (pidIndex != wpi::StringRef::npos) {
|
||||
auto pidSlice = path.slice(pidIndex + 4, pidIndex + 8);
|
||||
uint16_t val = 0;
|
||||
if (!pidSlice.getAsInteger(16, val)) {
|
||||
*pid = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<UsbCameraInfo> EnumerateUsbCameras(CS_Status* status) {
|
||||
std::vector<UsbCameraInfo> retval;
|
||||
|
||||
@@ -1012,6 +1057,10 @@ std::vector<UsbCameraInfo> EnumerateUsbCameras(CS_Status* status) {
|
||||
MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, buf,
|
||||
sizeof(buf) / sizeof(WCHAR), NULL);
|
||||
info.path = utf8_conv.to_bytes(buf);
|
||||
|
||||
// Try to parse path from symbolic link
|
||||
ParseVidAndPid(info.path, &info.productId, &info.vendorId);
|
||||
|
||||
retval.emplace_back(std::move(info));
|
||||
}
|
||||
|
||||
@@ -1052,6 +1101,16 @@ CS_Source CreateUsbCameraPath(const wpi::Twine& name, const wpi::Twine& path,
|
||||
return inst.CreateSource(CS_SOURCE_USB, source);
|
||||
}
|
||||
|
||||
void SetUsbCameraPath(CS_Source source, const wpi::Twine& path,
|
||||
CS_Status* status) {
|
||||
auto data = Instance::GetInstance().GetSource(source);
|
||||
if (!data || data->kind != CS_SOURCE_USB) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
return;
|
||||
}
|
||||
static_cast<UsbCameraImpl&>(*data->source).SetPath(path, status);
|
||||
}
|
||||
|
||||
std::string GetUsbCameraPath(CS_Source source, CS_Status* status) {
|
||||
auto data = Instance::GetInstance().GetSource(source);
|
||||
if (!data || data->kind != CS_SOURCE_USB) {
|
||||
@@ -1070,7 +1129,10 @@ UsbCameraInfo GetUsbCameraInfo(CS_Source source, CS_Status* status) {
|
||||
}
|
||||
|
||||
info.path = static_cast<UsbCameraImpl&>(*data->source).GetPath();
|
||||
// TODO: dev and name
|
||||
wpi::SmallVector<char, 64> buf;
|
||||
info.name = static_cast<UsbCameraImpl&>(*data->source).GetDescription(buf);
|
||||
ParseVidAndPid(info.path, &info.productId, &info.vendorId);
|
||||
info.dev = -1; // We have lost dev information by this point in time.
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -78,12 +78,14 @@ class UsbCameraImpl : public SourceImpl,
|
||||
void ProcessFrame(IMFSample* sample, const VideoMode& mode);
|
||||
void PostRequestNewFrame();
|
||||
|
||||
std::string GetPath() { return m_path; }
|
||||
void SetPath(const wpi::Twine& path, CS_Status* status);
|
||||
std::string GetPath() const;
|
||||
|
||||
// Messages passed to/from camera thread
|
||||
struct Message {
|
||||
enum Kind {
|
||||
kNone = 0,
|
||||
kCmdSetPath,
|
||||
kCmdSetMode,
|
||||
kCmdSetPixelFormat,
|
||||
kCmdSetResolution,
|
||||
@@ -116,9 +118,6 @@ class UsbCameraImpl : public SourceImpl,
|
||||
bool CacheProperties(CS_Status* status) const override;
|
||||
|
||||
private:
|
||||
// The camera processing thread
|
||||
void CameraThreadMain();
|
||||
|
||||
LRESULT PumpMain(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
bool CheckDeviceChange(WPARAM wParam, DEV_BROADCAST_HDR* pHdr,
|
||||
@@ -171,9 +170,6 @@ class UsbCameraImpl : public SourceImpl,
|
||||
std::unique_ptr<cs::WindowsMessagePump> m_messagePump;
|
||||
ComPtr<IMFMediaType> m_currentMode;
|
||||
|
||||
//
|
||||
// Path never changes, so not protected by mutex.
|
||||
//
|
||||
std::string m_path;
|
||||
|
||||
std::wstring m_widePath;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -56,6 +56,6 @@ class UsbCameraTest {
|
||||
private static int getNonexistentCameraDev() {
|
||||
return Arrays.stream(CameraServerJNI.enumerateUsbCameras())
|
||||
.mapToInt(info -> info.dev)
|
||||
.max().orElse(-1) + 1;
|
||||
.max().orElse(-1) + 20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ evaluationDependsOn(':ntcore')
|
||||
evaluationDependsOn(':cscore')
|
||||
evaluationDependsOn(':hal')
|
||||
evaluationDependsOn(':cameraserver')
|
||||
evaluationDependsOn(':wpimath')
|
||||
evaluationDependsOn(':wpilibc')
|
||||
evaluationDependsOn(':wpilibj')
|
||||
evaluationDependsOn(':wpilibOldCommands')
|
||||
@@ -30,14 +31,16 @@ cppProjectZips.add(project(':wpiutil').cppHeadersZip)
|
||||
cppProjectZips.add(project(':ntcore').cppHeadersZip)
|
||||
cppProjectZips.add(project(':cscore').cppHeadersZip)
|
||||
cppProjectZips.add(project(':cameraserver').cppHeadersZip)
|
||||
cppProjectZips.add(project(':wpimath').cppHeadersZip)
|
||||
cppProjectZips.add(project(':wpilibc').cppHeadersZip)
|
||||
cppProjectZips.add(project(':wpilibOldCommands').cppHeadersZip)
|
||||
cppProjectZips.add(project(':wpilibNewCommands').cppHeadersZip)
|
||||
|
||||
doxygen {
|
||||
executables {
|
||||
doxygen version : '1.8.16'
|
||||
}
|
||||
executables {
|
||||
doxygen version : '1.8.18',
|
||||
baseURI : 'https://frcmaven.wpi.edu/artifactory/generic-release-mirror/doxygen'
|
||||
}
|
||||
}
|
||||
|
||||
doxygen {
|
||||
@@ -101,17 +104,19 @@ ext {
|
||||
apply from: "${rootDir}/shared/opencv.gradle"
|
||||
|
||||
task generateJavaDocs(type: Javadoc) {
|
||||
classpath += project(":wpiutil").sourceSets.main.compileClasspath
|
||||
classpath += project(":wpimath").sourceSets.main.compileClasspath
|
||||
options.links("https://docs.oracle.com/en/java/javase/11/docs/api/")
|
||||
options.addStringOption "tag", "pre:a:Pre-Condition"
|
||||
options.addBooleanOption "Xdoclint:html,missing,reference,syntax", true
|
||||
options.addBooleanOption('html5', true)
|
||||
dependsOn project(':wpilibj').generateJavaVersion
|
||||
dependsOn project(':hal').generateUsageReporting
|
||||
dependsOn project(':wpimath').generateNat
|
||||
source project(':hal').sourceSets.main.java
|
||||
source project(':wpiutil').sourceSets.main.java
|
||||
source project(':cscore').sourceSets.main.java
|
||||
source project(':ntcore').sourceSets.main.java
|
||||
source project(':wpimath').sourceSets.main.java
|
||||
source project(':wpilibj').sourceSets.main.java
|
||||
source project(':cameraserver').sourceSets.main.java
|
||||
source project(':wpilibOldCommands').sourceSets.main.java
|
||||
@@ -125,7 +130,9 @@ task generateJavaDocs(type: Javadoc) {
|
||||
ext.entryPoint = "$destinationDir/index.html"
|
||||
|
||||
if (JavaVersion.current().isJava11Compatible()) {
|
||||
options.addBooleanOption('-no-module-directories', true)
|
||||
if (!JavaVersion.current().isJava12Compatible()) {
|
||||
options.addBooleanOption('-no-module-directories', true)
|
||||
}
|
||||
doLast {
|
||||
// This is a work-around for https://bugs.openjdk.java.net/browse/JDK-8211194. Can be removed once that issue is fixed on JDK's side
|
||||
// Since JDK 11, package-list is missing from javadoc output files and superseded by element-list file, but a lot of external tools still need it
|
||||
@@ -143,11 +150,10 @@ tasks.register("zipJavaDocs", Zip) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
addTaskToCopyAllOutputs(zipCppDocs)
|
||||
addTaskToCopyAllOutputs(zipJavaDocs)
|
||||
|
||||
build.dependsOn zipCppDocs
|
||||
build.dependsOn zipJavaDocs
|
||||
tasks.register("zipDocs") {
|
||||
dependsOn zipCppDocs
|
||||
dependsOn zipJavaDocs
|
||||
}
|
||||
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
|
||||
1
gradle.properties
Normal file
1
gradle.properties
Normal file
@@ -0,0 +1 @@
|
||||
org.gradle.jvmargs=-Xmx1g
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -37,7 +37,7 @@ set_target_properties(hal PROPERTIES DEBUG_POSTFIX "d")
|
||||
if(USE_EXTERNAL_HAL)
|
||||
include(${EXTERNAL_HAL_FILE})
|
||||
else()
|
||||
target_sources(hal PRIVATE ${hal_sim_native_src} ${hal_sim_jni_src})
|
||||
target_sources(hal PRIVATE ${hal_sim_native_src})
|
||||
endif()
|
||||
|
||||
configure_file(src/generate/FRCUsageReporting.h.in gen/hal/FRCUsageReporting.h)
|
||||
@@ -57,9 +57,9 @@ set_property(TARGET hal PROPERTY FOLDER "libraries")
|
||||
|
||||
install(TARGETS hal EXPORT hal DESTINATION "${main_lib_dest}")
|
||||
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/hal")
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gen DESTINATION "${include_dest}/hal")
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gen/ DESTINATION "${include_dest}/hal")
|
||||
|
||||
if (MSVC OR FLAT_INSTALL_WPILIB)
|
||||
if (WITH_FLAT_INSTALL)
|
||||
set (hal_config_dir ${wpilib_dest})
|
||||
else()
|
||||
set (hal_config_dir share/hal)
|
||||
@@ -70,7 +70,7 @@ install(FILES ${CMAKE_BINARY_DIR}/hal-config.cmake DESTINATION ${hal_config_dir}
|
||||
install(EXPORT hal DESTINATION ${hal_config_dir})
|
||||
|
||||
# Java bindings
|
||||
if (NOT WITHOUT_JAVA)
|
||||
if (WITH_JAVA)
|
||||
find_package(Java REQUIRED)
|
||||
find_package(JNI REQUIRED)
|
||||
include(UseJava)
|
||||
@@ -78,9 +78,7 @@ if (NOT WITHOUT_JAVA)
|
||||
|
||||
configure_file(src/generate/FRCNetComm.java.in FRCNetComm.java)
|
||||
|
||||
file(GLOB
|
||||
hal_shared_jni_src src/main/native/cpp/jni/*.cpp
|
||||
hal_sim_jni_src src/main/native/sim/jni/*.cpp)
|
||||
file(GLOB_RECURSE hal_shared_jni_src src/main/native/cpp/jni/*.cpp)
|
||||
|
||||
file(GLOB_RECURSE JAVA_SOURCES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FRCNetComm.java
|
||||
@@ -103,8 +101,6 @@ if (NOT WITHOUT_JAVA)
|
||||
|
||||
if(USE_EXTERNAL_HAL)
|
||||
include(${EXTERNAL_HAL_FILE})
|
||||
else()
|
||||
target_sources(haljni PRIVATE ${hal_sim_jni_src})
|
||||
endif()
|
||||
|
||||
set_target_properties(haljni PROPERTIES OUTPUT_NAME "wpiHaljni")
|
||||
|
||||
@@ -62,40 +62,13 @@ ext {
|
||||
|
||||
nativeName = 'hal'
|
||||
setBaseName = 'wpiHal'
|
||||
devMain = 'DevMain'
|
||||
devMain = 'edu.wpi.first.hal.DevMain'
|
||||
niLibraries = true
|
||||
generatedHeaders = "$buildDir/generated/headers"
|
||||
jniSplitSetup = {
|
||||
it.tasks.withType(AbstractNativeSourceCompileTask) {
|
||||
it.dependsOn generateUsageReporting
|
||||
}
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.sources {
|
||||
athenaJniCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs = ["${rootDir}/shared/singlelib", "$buildDir/generated/cpp"]
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src/main/native/include'
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
it.sources {
|
||||
simJniCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/sim'
|
||||
include '**/jni/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src/main/native/include'
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
splitSetup = {
|
||||
it.tasks.withType(AbstractNativeSourceCompileTask) {
|
||||
@@ -107,7 +80,6 @@ ext {
|
||||
source {
|
||||
srcDirs = ['src/main/native/athena']
|
||||
include '**/*.cpp'
|
||||
exclude '**/jni/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src/main/native/include'
|
||||
@@ -121,7 +93,6 @@ ext {
|
||||
source {
|
||||
srcDirs 'src/main/native/sim'
|
||||
include '**/*.cpp'
|
||||
exclude '**/jni/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src/main/native/include'
|
||||
@@ -134,7 +105,6 @@ ext {
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
|
||||
apply from: 'simjni.gradle'
|
||||
|
||||
sourceSets.main.java.srcDir "${buildDir}/generated/java/"
|
||||
|
||||
@@ -150,12 +120,6 @@ cppSourcesZip {
|
||||
from('src/main/native/sim') {
|
||||
into '/sim'
|
||||
}
|
||||
|
||||
from("$buildDir/generated/cpp") {
|
||||
into '/athena/jni'
|
||||
}
|
||||
|
||||
dependsOn generateAthenaSimFiles
|
||||
}
|
||||
|
||||
cppHeadersZip {
|
||||
|
||||
@@ -2,4 +2,5 @@ include(CMakeFindDependencyMacro)
|
||||
@FILENAME_DEP_REPLACE@
|
||||
@WPIUTIL_DEP_REPLACE@
|
||||
|
||||
@FILENAME_DEP_REPLACE@
|
||||
include(${SELF_DIR}/hal.cmake)
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
def athenaSimJniOutputDir = file("$buildDir/generated/cpp")
|
||||
def athenaSimJniOutputFile = file("$athenaSimJniOutputDir/simjni.cpp")
|
||||
|
||||
task generateAthenaSimFiles() {
|
||||
Set dirs = [];
|
||||
|
||||
def createdTask = it
|
||||
outputs.file athenaSimJniOutputFile
|
||||
|
||||
model {
|
||||
components {
|
||||
it.all { component ->
|
||||
if (component in getJniSpecClass()) {
|
||||
component.binaries.all { binary ->
|
||||
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
binary.tasks.withType(CppCompile) {
|
||||
it.dependsOn createdTask
|
||||
}
|
||||
component.jniHeaderLocations.each {
|
||||
dependsOn it.key
|
||||
createdTask.inputs.dir it.value
|
||||
dirs << it.value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doLast {
|
||||
def symbolList = []
|
||||
dirs.each {
|
||||
def tree = fileTree(dir: it)
|
||||
tree.each { file ->
|
||||
if (!file.name.contains('edu_wpi_first_hal_sim_mockdata_')) {
|
||||
return
|
||||
}
|
||||
boolean reading = false
|
||||
String currentLine = ''
|
||||
file.eachLine { line ->
|
||||
if (line.trim()) {
|
||||
if (line.contains(';') && reading) {
|
||||
currentLine += line.trim()
|
||||
reading = false
|
||||
symbolList << currentLine
|
||||
currentLine = ''
|
||||
}
|
||||
if (line.startsWith("JNIEXPORT ") && line.contains('JNICALL')) {
|
||||
if (line.contains(';')) {
|
||||
symbolList << line
|
||||
currentLine = ''
|
||||
reading = false
|
||||
} else {
|
||||
reading = true
|
||||
currentLine += line.trim()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
athenaSimJniOutputDir.mkdirs()
|
||||
athenaSimJniOutputFile.withWriter { out ->
|
||||
out.println '#include <jni.h>'
|
||||
out.println '''
|
||||
static JavaVM* jvm = nullptr;
|
||||
|
||||
namespace sim {
|
||||
jint SimOnLoad(JavaVM* vm, void* reserved) {
|
||||
jvm = vm;
|
||||
|
||||
JNIEnv *env;
|
||||
if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
return JNI_ERR;
|
||||
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
||||
void SimOnUnload(JavaVM * vm, void* reserved) {
|
||||
JNIEnv *env;
|
||||
if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
return;
|
||||
jvm = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
static void ThrowSimException(JNIEnv* env) {
|
||||
|
||||
}
|
||||
'''
|
||||
out.println 'extern "C" {'
|
||||
symbolList.each {
|
||||
def symbol = it.replace('JNIEnv *', 'JNIEnv * env')
|
||||
if (symbol.contains('JNIEXPORT void')) {
|
||||
symbol = symbol.replace(';', ''' {
|
||||
ThrowSimException(env);
|
||||
}''')
|
||||
} else {
|
||||
symbol = symbol.replace(';', ''' {
|
||||
ThrowSimException(env);
|
||||
return 0;
|
||||
}''')
|
||||
}
|
||||
out.println symbol
|
||||
}
|
||||
out.println '}'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
public final class DevMain {
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -20,6 +20,13 @@ public class CANAPIJNI extends JNIWrapper {
|
||||
|
||||
public static native void writeCANRTRFrame(int handle, int length, int apiId);
|
||||
|
||||
public static native int writeCANPacketNoThrow(int handle, byte[] data, int apiId);
|
||||
|
||||
public static native int writeCANPacketRepeatingNoThrow(int handle, byte[] data, int apiId,
|
||||
int repeatMs);
|
||||
|
||||
public static native int writeCANRTRFrameNoThrow(int handle, int length, int apiId);
|
||||
|
||||
public static native void stopCANPacketRepeating(int handle, int apiId);
|
||||
|
||||
public static native boolean readCANPacketNew(int handle, int apiId, CANData data);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -12,12 +12,14 @@ import java.nio.ByteBuffer;
|
||||
/**
|
||||
* JNI Wrapper for HAL<br>.
|
||||
*/
|
||||
@SuppressWarnings({"AbbreviationAsWordInName", "MethodName", "PMD.TooManyMethods"})
|
||||
@SuppressWarnings({"AbbreviationAsWordInName", "MethodName"})
|
||||
public final class HAL extends JNIWrapper {
|
||||
public static native void waitForDSData();
|
||||
|
||||
public static native boolean initialize(int timeout, int mode);
|
||||
|
||||
public static native void shutdown();
|
||||
|
||||
public static native boolean hasMain();
|
||||
|
||||
public static native void runMain();
|
||||
@@ -130,6 +132,8 @@ public final class HAL extends JNIWrapper {
|
||||
String details, String location, String callStack,
|
||||
boolean printMsg);
|
||||
|
||||
public static native int sendConsoleLine(String line);
|
||||
|
||||
public static native int getPortWithModule(byte module, byte channel);
|
||||
|
||||
public static native int getPort(byte channel);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -38,4 +38,6 @@ public class InterruptJNI extends JNIWrapper {
|
||||
|
||||
public static native void setInterruptUpSourceEdge(int interruptHandle, boolean risingEdge,
|
||||
boolean fallingEdge);
|
||||
|
||||
public static native void releaseWaitingInterrupt(int interruptHandle);
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
|
||||
import edu.wpi.first.hal.sim.mockdata.DriverStationDataJNI;
|
||||
|
||||
public class DriverStationSim {
|
||||
public CallbackStore registerEnabledCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = DriverStationDataJNI.registerEnabledCallback(callback, initialNotify);
|
||||
return new CallbackStore(uid, DriverStationDataJNI::cancelEnabledCallback);
|
||||
}
|
||||
public boolean getEnabled() {
|
||||
return DriverStationDataJNI.getEnabled();
|
||||
}
|
||||
public void setEnabled(boolean enabled) {
|
||||
DriverStationDataJNI.setEnabled(enabled);
|
||||
}
|
||||
|
||||
public CallbackStore registerAutonomousCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = DriverStationDataJNI.registerAutonomousCallback(callback, initialNotify);
|
||||
return new CallbackStore(uid, DriverStationDataJNI::cancelAutonomousCallback);
|
||||
}
|
||||
public boolean getAutonomous() {
|
||||
return DriverStationDataJNI.getAutonomous();
|
||||
}
|
||||
public void setAutonomous(boolean autonomous) {
|
||||
DriverStationDataJNI.setAutonomous(autonomous);
|
||||
}
|
||||
|
||||
public CallbackStore registerTestCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = DriverStationDataJNI.registerTestCallback(callback, initialNotify);
|
||||
return new CallbackStore(uid, DriverStationDataJNI::cancelTestCallback);
|
||||
}
|
||||
public boolean getTest() {
|
||||
return DriverStationDataJNI.getTest();
|
||||
}
|
||||
public void setTest(boolean test) {
|
||||
DriverStationDataJNI.setTest(test);
|
||||
}
|
||||
|
||||
public CallbackStore registerEStopCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = DriverStationDataJNI.registerEStopCallback(callback, initialNotify);
|
||||
return new CallbackStore(uid, DriverStationDataJNI::cancelEStopCallback);
|
||||
}
|
||||
public boolean getEStop() {
|
||||
return DriverStationDataJNI.getEStop();
|
||||
}
|
||||
public void setEStop(boolean eStop) {
|
||||
DriverStationDataJNI.setEStop(eStop);
|
||||
}
|
||||
|
||||
public CallbackStore registerFmsAttachedCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = DriverStationDataJNI.registerFmsAttachedCallback(callback, initialNotify);
|
||||
return new CallbackStore(uid, DriverStationDataJNI::cancelFmsAttachedCallback);
|
||||
}
|
||||
public boolean getFmsAttached() {
|
||||
return DriverStationDataJNI.getFmsAttached();
|
||||
}
|
||||
public void setFmsAttached(boolean fmsAttached) {
|
||||
DriverStationDataJNI.setFmsAttached(fmsAttached);
|
||||
}
|
||||
|
||||
public CallbackStore registerDsAttachedCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = DriverStationDataJNI.registerDsAttachedCallback(callback, initialNotify);
|
||||
return new CallbackStore(uid, DriverStationDataJNI::cancelDsAttachedCallback);
|
||||
}
|
||||
public boolean getDsAttached() {
|
||||
return DriverStationDataJNI.getDsAttached();
|
||||
}
|
||||
public void setDsAttached(boolean dsAttached) {
|
||||
DriverStationDataJNI.setDsAttached(dsAttached);
|
||||
}
|
||||
public void notifyNewData() {
|
||||
DriverStationDataJNI.notifyNewData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles suppression of DriverStation.reportError and reportWarning messages.
|
||||
*
|
||||
* @param shouldSend If false then messages will will be suppressed.
|
||||
*/
|
||||
public void setSendError(boolean shouldSend) {
|
||||
DriverStationDataJNI.setSendError(shouldSend);
|
||||
}
|
||||
|
||||
public void resetData() {
|
||||
DriverStationDataJNI.resetData();
|
||||
}
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
|
||||
import edu.wpi.first.hal.sim.mockdata.RoboRioDataJNI;
|
||||
|
||||
@SuppressWarnings({"PMD.ExcessivePublicCount", "PMD.TooManyMethods"})
|
||||
public class RoboRioSim {
|
||||
private final int m_index;
|
||||
|
||||
public RoboRioSim(int index) {
|
||||
m_index = index;
|
||||
}
|
||||
|
||||
public CallbackStore registerFPGAButtonCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerFPGAButtonCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelFPGAButtonCallback);
|
||||
}
|
||||
public boolean getFPGAButton() {
|
||||
return RoboRioDataJNI.getFPGAButton(m_index);
|
||||
}
|
||||
public void setFPGAButton(boolean fPGAButton) {
|
||||
RoboRioDataJNI.setFPGAButton(m_index, fPGAButton);
|
||||
}
|
||||
|
||||
public CallbackStore registerVInVoltageCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerVInVoltageCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelVInVoltageCallback);
|
||||
}
|
||||
public double getVInVoltage() {
|
||||
return RoboRioDataJNI.getVInVoltage(m_index);
|
||||
}
|
||||
public void setVInVoltage(double vInVoltage) {
|
||||
RoboRioDataJNI.setVInVoltage(m_index, vInVoltage);
|
||||
}
|
||||
|
||||
public CallbackStore registerVInCurrentCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerVInCurrentCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelVInCurrentCallback);
|
||||
}
|
||||
public double getVInCurrent() {
|
||||
return RoboRioDataJNI.getVInCurrent(m_index);
|
||||
}
|
||||
public void setVInCurrent(double vInCurrent) {
|
||||
RoboRioDataJNI.setVInCurrent(m_index, vInCurrent);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserVoltage6VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserVoltage6VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserVoltage6VCallback);
|
||||
}
|
||||
public double getUserVoltage6V() {
|
||||
return RoboRioDataJNI.getUserVoltage6V(m_index);
|
||||
}
|
||||
public void setUserVoltage6V(double userVoltage6V) {
|
||||
RoboRioDataJNI.setUserVoltage6V(m_index, userVoltage6V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserCurrent6VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserCurrent6VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserCurrent6VCallback);
|
||||
}
|
||||
public double getUserCurrent6V() {
|
||||
return RoboRioDataJNI.getUserCurrent6V(m_index);
|
||||
}
|
||||
public void setUserCurrent6V(double userCurrent6V) {
|
||||
RoboRioDataJNI.setUserCurrent6V(m_index, userCurrent6V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserActive6VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserActive6VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserActive6VCallback);
|
||||
}
|
||||
public boolean getUserActive6V() {
|
||||
return RoboRioDataJNI.getUserActive6V(m_index);
|
||||
}
|
||||
public void setUserActive6V(boolean userActive6V) {
|
||||
RoboRioDataJNI.setUserActive6V(m_index, userActive6V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserVoltage5VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserVoltage5VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserVoltage5VCallback);
|
||||
}
|
||||
public double getUserVoltage5V() {
|
||||
return RoboRioDataJNI.getUserVoltage5V(m_index);
|
||||
}
|
||||
public void setUserVoltage5V(double userVoltage5V) {
|
||||
RoboRioDataJNI.setUserVoltage5V(m_index, userVoltage5V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserCurrent5VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserCurrent5VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserCurrent5VCallback);
|
||||
}
|
||||
public double getUserCurrent5V() {
|
||||
return RoboRioDataJNI.getUserCurrent5V(m_index);
|
||||
}
|
||||
public void setUserCurrent5V(double userCurrent5V) {
|
||||
RoboRioDataJNI.setUserCurrent5V(m_index, userCurrent5V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserActive5VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserActive5VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserActive5VCallback);
|
||||
}
|
||||
public boolean getUserActive5V() {
|
||||
return RoboRioDataJNI.getUserActive5V(m_index);
|
||||
}
|
||||
public void setUserActive5V(boolean userActive5V) {
|
||||
RoboRioDataJNI.setUserActive5V(m_index, userActive5V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserVoltage3V3Callback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserVoltage3V3Callback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserVoltage3V3Callback);
|
||||
}
|
||||
public double getUserVoltage3V3() {
|
||||
return RoboRioDataJNI.getUserVoltage3V3(m_index);
|
||||
}
|
||||
public void setUserVoltage3V3(double userVoltage3V3) {
|
||||
RoboRioDataJNI.setUserVoltage3V3(m_index, userVoltage3V3);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserCurrent3V3Callback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserCurrent3V3Callback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserCurrent3V3Callback);
|
||||
}
|
||||
public double getUserCurrent3V3() {
|
||||
return RoboRioDataJNI.getUserCurrent3V3(m_index);
|
||||
}
|
||||
public void setUserCurrent3V3(double userCurrent3V3) {
|
||||
RoboRioDataJNI.setUserCurrent3V3(m_index, userCurrent3V3);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserActive3V3Callback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserActive3V3Callback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserActive3V3Callback);
|
||||
}
|
||||
public boolean getUserActive3V3() {
|
||||
return RoboRioDataJNI.getUserActive3V3(m_index);
|
||||
}
|
||||
public void setUserActive3V3(boolean userActive3V3) {
|
||||
RoboRioDataJNI.setUserActive3V3(m_index, userActive3V3);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserFaults6VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserFaults6VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserFaults6VCallback);
|
||||
}
|
||||
public int getUserFaults6V() {
|
||||
return RoboRioDataJNI.getUserFaults6V(m_index);
|
||||
}
|
||||
public void setUserFaults6V(int userFaults6V) {
|
||||
RoboRioDataJNI.setUserFaults6V(m_index, userFaults6V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserFaults5VCallback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserFaults5VCallback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserFaults5VCallback);
|
||||
}
|
||||
public int getUserFaults5V() {
|
||||
return RoboRioDataJNI.getUserFaults5V(m_index);
|
||||
}
|
||||
public void setUserFaults5V(int userFaults5V) {
|
||||
RoboRioDataJNI.setUserFaults5V(m_index, userFaults5V);
|
||||
}
|
||||
|
||||
public CallbackStore registerUserFaults3V3Callback(NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerUserFaults3V3Callback(m_index, callback, initialNotify);
|
||||
return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserFaults3V3Callback);
|
||||
}
|
||||
public int getUserFaults3V3() {
|
||||
return RoboRioDataJNI.getUserFaults3V3(m_index);
|
||||
}
|
||||
public void setUserFaults3V3(int userFaults3V3) {
|
||||
RoboRioDataJNI.setUserFaults3V3(m_index, userFaults3V3);
|
||||
}
|
||||
|
||||
public void resetData() {
|
||||
RoboRioDataJNI.resetData(m_index);
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class RoboRioDataJNI extends JNIWrapper {
|
||||
public static native int registerFPGAButtonCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelFPGAButtonCallback(int index, int uid);
|
||||
public static native boolean getFPGAButton(int index);
|
||||
public static native void setFPGAButton(int index, boolean fPGAButton);
|
||||
|
||||
public static native int registerVInVoltageCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelVInVoltageCallback(int index, int uid);
|
||||
public static native double getVInVoltage(int index);
|
||||
public static native void setVInVoltage(int index, double vInVoltage);
|
||||
|
||||
public static native int registerVInCurrentCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelVInCurrentCallback(int index, int uid);
|
||||
public static native double getVInCurrent(int index);
|
||||
public static native void setVInCurrent(int index, double vInCurrent);
|
||||
|
||||
public static native int registerUserVoltage6VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserVoltage6VCallback(int index, int uid);
|
||||
public static native double getUserVoltage6V(int index);
|
||||
public static native void setUserVoltage6V(int index, double userVoltage6V);
|
||||
|
||||
public static native int registerUserCurrent6VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserCurrent6VCallback(int index, int uid);
|
||||
public static native double getUserCurrent6V(int index);
|
||||
public static native void setUserCurrent6V(int index, double userCurrent6V);
|
||||
|
||||
public static native int registerUserActive6VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserActive6VCallback(int index, int uid);
|
||||
public static native boolean getUserActive6V(int index);
|
||||
public static native void setUserActive6V(int index, boolean userActive6V);
|
||||
|
||||
public static native int registerUserVoltage5VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserVoltage5VCallback(int index, int uid);
|
||||
public static native double getUserVoltage5V(int index);
|
||||
public static native void setUserVoltage5V(int index, double userVoltage5V);
|
||||
|
||||
public static native int registerUserCurrent5VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserCurrent5VCallback(int index, int uid);
|
||||
public static native double getUserCurrent5V(int index);
|
||||
public static native void setUserCurrent5V(int index, double userCurrent5V);
|
||||
|
||||
public static native int registerUserActive5VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserActive5VCallback(int index, int uid);
|
||||
public static native boolean getUserActive5V(int index);
|
||||
public static native void setUserActive5V(int index, boolean userActive5V);
|
||||
|
||||
public static native int registerUserVoltage3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserVoltage3V3Callback(int index, int uid);
|
||||
public static native double getUserVoltage3V3(int index);
|
||||
public static native void setUserVoltage3V3(int index, double userVoltage3V3);
|
||||
|
||||
public static native int registerUserCurrent3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserCurrent3V3Callback(int index, int uid);
|
||||
public static native double getUserCurrent3V3(int index);
|
||||
public static native void setUserCurrent3V3(int index, double userCurrent3V3);
|
||||
|
||||
public static native int registerUserActive3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserActive3V3Callback(int index, int uid);
|
||||
public static native boolean getUserActive3V3(int index);
|
||||
public static native void setUserActive3V3(int index, boolean userActive3V3);
|
||||
|
||||
public static native int registerUserFaults6VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserFaults6VCallback(int index, int uid);
|
||||
public static native int getUserFaults6V(int index);
|
||||
public static native void setUserFaults6V(int index, int userFaults6V);
|
||||
|
||||
public static native int registerUserFaults5VCallback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserFaults5VCallback(int index, int uid);
|
||||
public static native int getUserFaults5V(int index);
|
||||
public static native void setUserFaults5V(int index, int userFaults5V);
|
||||
|
||||
public static native int registerUserFaults3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserFaults3V3Callback(int index, int uid);
|
||||
public static native int getUserFaults3V3(int index);
|
||||
public static native void setUserFaults3V3(int index, int userFaults3V3);
|
||||
|
||||
public static native void resetData(int index);
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class AccelerometerDataJNI extends JNIWrapper {
|
||||
@@ -1,14 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.ConstBufferCallback;
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class AddressableLEDDataJNI extends JNIWrapper {
|
||||
@@ -38,4 +36,6 @@ public class AddressableLEDDataJNI extends JNIWrapper {
|
||||
public static native void setData(int index, byte[] data);
|
||||
|
||||
public static native void resetData(int index);
|
||||
|
||||
public static native int findForChannel(int channel);
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class AnalogGyroDataJNI extends JNIWrapper {
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class AnalogInDataJNI extends JNIWrapper {
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class AnalogOutDataJNI extends JNIWrapper {
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class AnalogTriggerDataJNI extends JNIWrapper {
|
||||
@@ -27,4 +26,6 @@ public class AnalogTriggerDataJNI extends JNIWrapper {
|
||||
public static native void setTriggerUpperBound(int index, double triggerUpperBound);
|
||||
|
||||
public static native void resetData(int index);
|
||||
|
||||
public static native int findForChannel(int channel);
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
public interface BufferCallback {
|
||||
void callback(String name, byte[] buffer, int count);
|
||||
@@ -1,11 +1,11 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
public interface ConstBufferCallback {
|
||||
void callback(String name, byte[] buffer, int count);
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class DIODataJNI extends JNIWrapper {
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class DigitalPWMDataJNI extends JNIWrapper {
|
||||
@@ -27,4 +26,6 @@ public class DigitalPWMDataJNI extends JNIWrapper {
|
||||
public static native void setPin(int index, int pin);
|
||||
|
||||
public static native void resetData(int index);
|
||||
|
||||
public static native int findForChannel(int channel);
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
|
||||
public class DriverStationDataJNI extends JNIWrapper {
|
||||
public static native int registerEnabledCallback(NotifyCallback callback, boolean initialNotify);
|
||||
@@ -41,15 +40,48 @@ public class DriverStationDataJNI extends JNIWrapper {
|
||||
public static native boolean getDsAttached();
|
||||
public static native void setDsAttached(boolean dsAttached);
|
||||
|
||||
public static native int registerAllianceStationIdCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelAllianceStationIdCallback(int uid);
|
||||
public static native int getAllianceStationId();
|
||||
public static native void setAllianceStationId(int allianceStationId);
|
||||
|
||||
public static native int registerMatchTimeCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelMatchTimeCallback(int uid);
|
||||
public static native double getMatchTime();
|
||||
public static native void setMatchTime(double matchTime);
|
||||
|
||||
public static native void setJoystickAxes(byte joystickNum, float[] axesArray);
|
||||
public static native void setJoystickPOVs(byte joystickNum, short[] povsArray);
|
||||
public static native void setJoystickButtons(byte joystickNum, int buttons, int count);
|
||||
public static native long getJoystickOutputs(int stick);
|
||||
public static native int getJoystickRumble(int stick, int rumbleNum);
|
||||
|
||||
public static native void setMatchInfo(String eventName, String gameSpecificMessage, int matchNumber, int replayNumber, int matchType);
|
||||
|
||||
public static native void registerAllCallbacks(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void notifyNewData();
|
||||
|
||||
public static native void setSendError(boolean shouldSend);
|
||||
public static native void setSendConsoleLine(boolean shouldSend);
|
||||
|
||||
public static native void setJoystickButton(int stick, int button, boolean state);
|
||||
public static native void setJoystickAxis(int stick, int axis, double value);
|
||||
public static native void setJoystickPOV(int stick, int pov, int value);
|
||||
public static native void setJoystickButtonsValue(int stick, int buttons);
|
||||
public static native void setJoystickAxisCount(int stick, int count);
|
||||
public static native void setJoystickPOVCount(int stick, int count);
|
||||
public static native void setJoystickButtonCount(int stick, int count);
|
||||
|
||||
public static native void setJoystickIsXbox(int stick, boolean isXbox);
|
||||
public static native void setJoystickType(int stick, int type);
|
||||
public static native void setJoystickName(int stick, String name);
|
||||
public static native void setJoystickAxisType(int stick, int axis, int type);
|
||||
|
||||
public static native void setGameSpecificMessage(String message);
|
||||
public static native void setEventName(String name);
|
||||
public static native void setMatchType(int type);
|
||||
public static native void setMatchNumber(int matchNumber);
|
||||
public static native void setReplayNumber(int replayNumber);
|
||||
|
||||
public static native void resetData();
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class DutyCycleDataJNI extends JNIWrapper {
|
||||
@@ -27,4 +26,6 @@ public class DutyCycleDataJNI extends JNIWrapper {
|
||||
public static native void setOutput(int index, double output);
|
||||
|
||||
public static native void resetData(int index);
|
||||
|
||||
public static native int findForChannel(int channel);
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class EncoderDataJNI extends JNIWrapper {
|
||||
@@ -51,5 +50,12 @@ public class EncoderDataJNI extends JNIWrapper {
|
||||
public static native int getSamplesToAverage(int index);
|
||||
public static native void setSamplesToAverage(int index, int samplesToAverage);
|
||||
|
||||
public static native void setDistance(int index, double distance);
|
||||
public static native double getDistance(int index);
|
||||
public static native void setRate(int index, double rate);
|
||||
public static native double getRate(int index);
|
||||
|
||||
public static native void resetData(int index);
|
||||
|
||||
public static native int findForChannel(int channel);
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.BufferCallback;
|
||||
import edu.wpi.first.hal.sim.ConstBufferCallback;
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class I2CDataJNI extends JNIWrapper {
|
||||
@@ -1,11 +1,11 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.HALValue;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class PCMDataJNI extends JNIWrapper {
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class PDPDataJNI extends JNIWrapper {
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class PWMDataJNI extends JNIWrapper {
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class RelayDataJNI extends JNIWrapper {
|
||||
@@ -0,0 +1,89 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class RoboRioDataJNI extends JNIWrapper {
|
||||
public static native int registerFPGAButtonCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelFPGAButtonCallback(int uid);
|
||||
public static native boolean getFPGAButton();
|
||||
public static native void setFPGAButton(boolean fPGAButton);
|
||||
|
||||
public static native int registerVInVoltageCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelVInVoltageCallback(int uid);
|
||||
public static native double getVInVoltage();
|
||||
public static native void setVInVoltage(double vInVoltage);
|
||||
|
||||
public static native int registerVInCurrentCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelVInCurrentCallback(int uid);
|
||||
public static native double getVInCurrent();
|
||||
public static native void setVInCurrent(double vInCurrent);
|
||||
|
||||
public static native int registerUserVoltage6VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserVoltage6VCallback(int uid);
|
||||
public static native double getUserVoltage6V();
|
||||
public static native void setUserVoltage6V(double userVoltage6V);
|
||||
|
||||
public static native int registerUserCurrent6VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserCurrent6VCallback(int uid);
|
||||
public static native double getUserCurrent6V();
|
||||
public static native void setUserCurrent6V(double userCurrent6V);
|
||||
|
||||
public static native int registerUserActive6VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserActive6VCallback(int uid);
|
||||
public static native boolean getUserActive6V();
|
||||
public static native void setUserActive6V(boolean userActive6V);
|
||||
|
||||
public static native int registerUserVoltage5VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserVoltage5VCallback(int uid);
|
||||
public static native double getUserVoltage5V();
|
||||
public static native void setUserVoltage5V(double userVoltage5V);
|
||||
|
||||
public static native int registerUserCurrent5VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserCurrent5VCallback(int uid);
|
||||
public static native double getUserCurrent5V();
|
||||
public static native void setUserCurrent5V(double userCurrent5V);
|
||||
|
||||
public static native int registerUserActive5VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserActive5VCallback(int uid);
|
||||
public static native boolean getUserActive5V();
|
||||
public static native void setUserActive5V(boolean userActive5V);
|
||||
|
||||
public static native int registerUserVoltage3V3Callback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserVoltage3V3Callback(int uid);
|
||||
public static native double getUserVoltage3V3();
|
||||
public static native void setUserVoltage3V3(double userVoltage3V3);
|
||||
|
||||
public static native int registerUserCurrent3V3Callback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserCurrent3V3Callback(int uid);
|
||||
public static native double getUserCurrent3V3();
|
||||
public static native void setUserCurrent3V3(double userCurrent3V3);
|
||||
|
||||
public static native int registerUserActive3V3Callback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserActive3V3Callback(int uid);
|
||||
public static native boolean getUserActive3V3();
|
||||
public static native void setUserActive3V3(boolean userActive3V3);
|
||||
|
||||
public static native int registerUserFaults6VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserFaults6VCallback(int uid);
|
||||
public static native int getUserFaults6V();
|
||||
public static native void setUserFaults6V(int userFaults6V);
|
||||
|
||||
public static native int registerUserFaults5VCallback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserFaults5VCallback(int uid);
|
||||
public static native int getUserFaults5V();
|
||||
public static native void setUserFaults5V(int userFaults5V);
|
||||
|
||||
public static native int registerUserFaults3V3Callback(NotifyCallback callback, boolean initialNotify);
|
||||
public static native void cancelUserFaults3V3Callback(int uid);
|
||||
public static native int getUserFaults3V3();
|
||||
public static native void setUserFaults3V3(int userFaults3V3);
|
||||
|
||||
public static native void resetData();
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class SPIAccelerometerDataJNI extends JNIWrapper {
|
||||
@@ -1,16 +1,12 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.BufferCallback;
|
||||
import edu.wpi.first.hal.sim.ConstBufferCallback;
|
||||
import edu.wpi.first.hal.sim.NotifyCallback;
|
||||
import edu.wpi.first.hal.sim.SpiReadAutoReceiveBufferCallback;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class SPIDataJNI extends JNIWrapper {
|
||||
@@ -1,11 +1,11 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface SimDeviceCallback {
|
||||
@@ -1,22 +1,23 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.sim.SimDeviceCallback;
|
||||
import edu.wpi.first.hal.sim.SimValueCallback;
|
||||
import edu.wpi.first.hal.HALValue;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class SimDeviceDataJNI extends JNIWrapper {
|
||||
public static native void setSimDeviceEnabled(String prefix, boolean enabled);
|
||||
public static native boolean isSimDeviceEnabled(String name);
|
||||
|
||||
public static native int registerSimDeviceCreatedCallback(String prefix, SimDeviceCallback callback, boolean initialNotify);
|
||||
public static native void cancelSimDeviceCreatedCallback(int uid);
|
||||
|
||||
public static native int registerSimDeviceFreedCallback(String prefix, SimDeviceCallback callback);
|
||||
public static native int registerSimDeviceFreedCallback(String prefix, SimDeviceCallback callback, boolean initialNotify);
|
||||
public static native void cancelSimDeviceFreedCallback(int uid);
|
||||
|
||||
public static native int getSimDeviceHandle(String name);
|
||||
@@ -30,10 +31,10 @@ public class SimDeviceDataJNI extends JNIWrapper {
|
||||
}
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
String name;
|
||||
public String name;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
int handle;
|
||||
public int handle;
|
||||
}
|
||||
public static native SimDeviceInfo[] enumerateSimDevices(String prefix);
|
||||
|
||||
@@ -54,16 +55,16 @@ public class SimDeviceDataJNI extends JNIWrapper {
|
||||
}
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
String name;
|
||||
public String name;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
int handle;
|
||||
public int handle;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
boolean readonly;
|
||||
public boolean readonly;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
HALValue value;
|
||||
public HALValue value;
|
||||
}
|
||||
public static native SimValueInfo[] enumerateSimValues(int device);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.HALValue;
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim.mockdata;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class SimulatorJNI extends JNIWrapper {
|
||||
public static native void setRuntimeType(int type);
|
||||
public static native void waitForProgramStart();
|
||||
public static native void setProgramStarted();
|
||||
public static native boolean getProgramStarted();
|
||||
public static native void restartTiming();
|
||||
public static native void pauseTiming();
|
||||
public static native void resumeTiming();
|
||||
public static native boolean isTimingPaused();
|
||||
public static native void stepTiming(long delta);
|
||||
public static native void stepTimingAsync(long delta);
|
||||
public static native void resetHandles();
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.sim;
|
||||
package edu.wpi.first.hal.simulation;
|
||||
|
||||
public interface SpiReadAutoReceiveBufferCallback {
|
||||
int callback(String name, int[] buffer, int numToRead);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -10,6 +10,7 @@ package edu.wpi.first.hal.util;
|
||||
/**
|
||||
* Exception indicating that the resource is already allocated.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AllocationException extends RuntimeException {
|
||||
/**
|
||||
* Create a new AllocationException.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -10,6 +10,7 @@ package edu.wpi.first.hal.util;
|
||||
/**
|
||||
* This exception represents an error in which a lower limit was set as higher than an upper limit.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BoundaryException extends RuntimeException {
|
||||
/**
|
||||
* Create a new exception with the given message.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -11,6 +11,7 @@ package edu.wpi.first.hal.util;
|
||||
* Exception indicating that the resource is already allocated This is meant to be thrown by the
|
||||
* resource class.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CheckedAllocationException extends Exception {
|
||||
/**
|
||||
* Create a new CheckedAllocationException.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -8,8 +8,9 @@
|
||||
package edu.wpi.first.hal.util;
|
||||
|
||||
/**
|
||||
* Exception indicating that an error has occured with a HAL Handle.
|
||||
* Exception indicating that an error has occurred with a HAL Handle.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class HalHandleException extends RuntimeException {
|
||||
/**
|
||||
* Create a new HalHandleException.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user