mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Revert "Return reference from GetInstance" (#3342)
This reverts commit a79faace1b.
This change will be superseded in a non-breaking way by changing to static functions and deprecating GetInstance() entirely.
This commit is contained in:
@@ -19,15 +19,15 @@ class Robot : public frc::TimedRobot {
|
||||
static void VisionThread() {
|
||||
// Get the Axis camera from CameraServer
|
||||
cs::AxisCamera camera =
|
||||
frc::CameraServer::GetInstance().AddAxisCamera("axis-camera.local");
|
||||
frc::CameraServer::GetInstance()->AddAxisCamera("axis-camera.local");
|
||||
// Set the resolution
|
||||
camera.SetResolution(640, 480);
|
||||
|
||||
// Get a CvSink. This will capture Mats from the Camera
|
||||
cs::CvSink cvSink = frc::CameraServer::GetInstance().GetVideo();
|
||||
cs::CvSink cvSink = frc::CameraServer::GetInstance()->GetVideo();
|
||||
// Setup a CvSource. This will send images back to the Dashboard
|
||||
cs::CvSource outputStream =
|
||||
frc::CameraServer::GetInstance().PutVideo("Rectangle", 640, 480);
|
||||
frc::CameraServer::GetInstance()->PutVideo("Rectangle", 640, 480);
|
||||
|
||||
// Mats are very memory expensive. Lets reuse this Mat.
|
||||
cv::Mat mat;
|
||||
|
||||
@@ -50,7 +50,7 @@ class Robot : public frc::TimedRobot {
|
||||
frc::DifferentialDrive m_robotDrive{m_left, m_right};
|
||||
|
||||
frc::Joystick m_stick{0};
|
||||
frc::LiveWindow& m_lw = frc::LiveWindow::GetInstance();
|
||||
frc::LiveWindow& m_lw = *frc::LiveWindow::GetInstance();
|
||||
frc::Timer m_timer;
|
||||
};
|
||||
|
||||
|
||||
@@ -24,15 +24,15 @@ class Robot : public frc::TimedRobot {
|
||||
static void VisionThread() {
|
||||
// Get the USB camera from CameraServer
|
||||
cs::UsbCamera camera =
|
||||
frc::CameraServer::GetInstance().StartAutomaticCapture();
|
||||
frc::CameraServer::GetInstance()->StartAutomaticCapture();
|
||||
// Set the resolution
|
||||
camera.SetResolution(640, 480);
|
||||
|
||||
// Get a CvSink. This will capture Mats from the Camera
|
||||
cs::CvSink cvSink = frc::CameraServer::GetInstance().GetVideo();
|
||||
cs::CvSink cvSink = frc::CameraServer::GetInstance()->GetVideo();
|
||||
// Setup a CvSource. This will send images back to the Dashboard
|
||||
cs::CvSource outputStream =
|
||||
frc::CameraServer::GetInstance().PutVideo("Rectangle", 640, 480);
|
||||
frc::CameraServer::GetInstance()->PutVideo("Rectangle", 640, 480);
|
||||
|
||||
// Mats are very memory expensive. Lets reuse this Mat.
|
||||
cv::Mat mat;
|
||||
|
||||
@@ -16,7 +16,7 @@ class Robot : public frc::TimedRobot {
|
||||
public:
|
||||
void RobotInit() override {
|
||||
#if defined(__linux__)
|
||||
frc::CameraServer::GetInstance().StartAutomaticCapture();
|
||||
frc::CameraServer::GetInstance()->StartAutomaticCapture();
|
||||
#else
|
||||
wpi::errs() << "Vision only available on Linux.\n";
|
||||
wpi::errs().flush();
|
||||
|
||||
Reference in New Issue
Block a user