Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions subprojects/robotpy-cscore/cscore/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ def main():
nt_server_group.add_argument(
"--team", help="Team number to specify robot", type=int
)
parser.add_argument(
"--nt-protocol",
choices=[3, 4],
type=int,
help="NetworkTables protocol",
default=4,
)
parser.add_argument(
"--nt-identity", default="cscore", help="NetworkTables identity"
)
Expand Down Expand Up @@ -118,10 +111,7 @@ def main():
else:
ntinst.setServer(args.robot)

if args.nt_protocol == 3:
ntinst.startClient3(args.nt_identity)
else:
ntinst.startClient4(args.nt_identity)
ntinst.startClient(args.nt_identity)

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


if __name__ == "__main__":
# Setup wpi::now on roborio when executed as __main__
try:
from ._cscore import _setupWpiNow # type: ignore

_setupWpiNow()
except ImportError:
pass

main()
12 changes: 1 addition & 11 deletions subprojects/robotpy-cscore/cscore/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

#include "cscore_cpp.h"

#ifdef __FRC_SYSTEMCORE__
extern "C" {
void WPI_Impl_SetupNowUseDefaultOnRio(void);
}
#endif

SEMIWRAP_PYBIND11_MODULE(m) {
initWrapper(m);

Expand All @@ -22,8 +16,4 @@ SEMIWRAP_PYBIND11_MODULE(m) {
CS_Shutdown();
});
m.add_object("_cleanup", cleanup);

#ifdef __FRC_SYSTEMCORE__
m.def("_setupWpiNow", WPI_Impl_SetupNowUseDefaultOnRio);
#endif
}
}
4 changes: 2 additions & 2 deletions subprojects/robotpy-wpilib/wpilib/cameraserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def launch(cls, vision_py: Optional[str] = None) -> None:
# who do not. cscore handle values indicate type with bits 24-30

if vision_py:
hal.reportUsage("RobotPy/CameraServer", vision_py)
if not vision_py.startswith("/"):
vision_py = "/home/systemcore/py/" + vision_py
args.append(vision_py)
hal.report(hal.tResourceType.kResourceType_PCVideoServer, 0x51)
else:
hal.report(hal.tResourceType.kResourceType_PCVideoServer, 0x52)
hal.reportUsage("RobotPy/CameraServer", "")

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