Skip to content

Commit 90bc263

Browse files
authored
Merge pull request #189 from auscompgeek/2027-cscore
Fix CameraServer on SystemCore
2 parents 5870aff + 1084b13 commit 90bc263

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

subprojects/robotpy-cscore/cscore/__main__.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ def main():
8282
nt_server_group.add_argument(
8383
"--team", help="Team number to specify robot", type=int
8484
)
85-
parser.add_argument(
86-
"--nt-protocol",
87-
choices=[3, 4],
88-
type=int,
89-
help="NetworkTables protocol",
90-
default=4,
91-
)
9285
parser.add_argument(
9386
"--nt-identity", default="cscore", help="NetworkTables identity"
9487
)
@@ -118,10 +111,7 @@ def main():
118111
else:
119112
ntinst.setServer(args.robot)
120113

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

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

160150

161151
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-
170152
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)