mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
New 2018 and later build setup (#1001)
This commit is contained in:
committed by
Peter Johnson
parent
cb2c9eb6d5
commit
7f88cf768d
@@ -44,6 +44,38 @@ public abstract class RobotBase {
|
||||
// This is usually 1, but it is best to make sure
|
||||
public static final long MAIN_THREAD_ID = Thread.currentThread().getId();
|
||||
|
||||
private static void setupCameraServerShared() {
|
||||
CameraServerShared shared = new CameraServerShared() {
|
||||
|
||||
@Override
|
||||
public void reportVideoServer(int id) {
|
||||
HAL.report(tResourceType.kResourceType_PCVideoServer, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportUsbCamera(int id) {
|
||||
HAL.report(tResourceType.kResourceType_PCVideoServer, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportDriverStationError(String error) {
|
||||
DriverStation.reportError(error, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportAxisCamera(int id) {
|
||||
HAL.report(tResourceType.kResourceType_AxisCamera, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getRobotMainThreadId() {
|
||||
return MAIN_THREAD_ID;
|
||||
}
|
||||
};
|
||||
|
||||
CameraServerSharedStore.setCameraServerShared(shared);
|
||||
}
|
||||
|
||||
protected final DriverStation m_ds;
|
||||
|
||||
/**
|
||||
@@ -57,6 +89,7 @@ public abstract class RobotBase {
|
||||
*/
|
||||
protected RobotBase() {
|
||||
NetworkTableInstance inst = NetworkTableInstance.getDefault();
|
||||
setupCameraServerShared();
|
||||
inst.setNetworkIdentity("Robot");
|
||||
inst.startServer("/home/lvuser/networktables.ini");
|
||||
m_ds = DriverStation.getInstance();
|
||||
|
||||
Reference in New Issue
Block a user