Skip to content

Commit ebe80f9

Browse files
committed
Fix CameraServer on SystemCore
1 parent 4d656b7 commit ebe80f9

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

subprojects/robotpy-cscore/cscore/__main__.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def main():
8484
)
8585
parser.add_argument(
8686
"--nt-protocol",
87-
choices=[3, 4],
87+
choices=[4],
8888
type=int,
8989
help="NetworkTables protocol",
9090
default=4,
@@ -118,10 +118,7 @@ def main():
118118
else:
119119
ntinst.setServer(args.robot)
120120

121-
if args.nt_protocol == 3:
122-
ntinst.startClient3(args.nt_identity)
123-
else:
124-
ntinst.startClient4(args.nt_identity)
121+
ntinst.startClient(args.nt_identity)
125122

126123
# If stdin is a pipe, then die when the pipe goes away
127124
# -> this allows us to detect if a parent process exits
@@ -159,12 +156,4 @@ def main():
159156

160157

161158
if __name__ == "__main__":
162-
# Setup wpi::now on roborio when executed as __main__
163-
try:
164-
from ._cscore import _setupWpiNow # type: ignore
165-
166-
_setupWpiNow()
167-
except ImportError:
168-
pass
169-
170159
main()

subprojects/robotpy-cscore/cscore/src/main.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33

44
#include "cscore_cpp.h"
55

6-
#ifdef __FRC_SYSTEMCORE__
7-
extern "C" {
8-
void WPI_Impl_SetupNowUseDefaultOnRio(void);
9-
}
10-
#endif
11-
126
SEMIWRAP_PYBIND11_MODULE(m) {
137
initWrapper(m);
148

@@ -22,8 +16,4 @@ SEMIWRAP_PYBIND11_MODULE(m) {
2216
CS_Shutdown();
2317
});
2418
m.add_object("_cleanup", cleanup);
25-
26-
#ifdef __FRC_SYSTEMCORE__
27-
m.def("_setupWpiNow", WPI_Impl_SetupNowUseDefaultOnRio);
28-
#endif
29-
}
19+
}

subprojects/robotpy-wpilib/wpilib/cameraserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def launch(cls, vision_py: Optional[str] = None) -> None:
7272
# who do not. cscore handle values indicate type with bits 24-30
7373

7474
if vision_py:
75+
hal.reportUsage("RobotPy/CameraServer", vision_py)
7576
if not vision_py.startswith("/"):
7677
vision_py = "/home/systemcore/py/" + vision_py
7778
args.append(vision_py)
78-
hal.report(hal.tResourceType.kResourceType_PCVideoServer, 0x51)
7979
else:
80-
hal.report(hal.tResourceType.kResourceType_PCVideoServer, 0x52)
80+
hal.reportUsage("RobotPy/CameraServer", "")
8181

8282
# We open a pipe to it so that when this process exits, it dies
8383
proc = subprocess.Popen(

0 commit comments

Comments
 (0)