mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -8,24 +8,24 @@
|
||||
#include "wpi/util/print.hpp"
|
||||
|
||||
int main() {
|
||||
wpi::print("hostname: {}\n", cs::GetHostname());
|
||||
wpi::util::print("hostname: {}\n", wpi::cs::GetHostname());
|
||||
std::puts("IPv4 network addresses:");
|
||||
for (const auto& addr : cs::GetNetworkInterfaces()) {
|
||||
wpi::print(" {}\n", addr);
|
||||
for (const auto& addr : wpi::cs::GetNetworkInterfaces()) {
|
||||
wpi::util::print(" {}\n", addr);
|
||||
}
|
||||
cs::UsbCamera camera{"usbcam", 0};
|
||||
camera.SetVideoMode(cs::VideoMode::kMJPEG, 320, 240, 30);
|
||||
cs::MjpegServer mjpegServer{"httpserver", 8081};
|
||||
wpi::cs::UsbCamera camera{"usbcam", 0};
|
||||
camera.SetVideoMode(wpi::cs::VideoMode::kMJPEG, 320, 240, 30);
|
||||
wpi::cs::MjpegServer mjpegServer{"httpserver", 8081};
|
||||
mjpegServer.SetSource(camera);
|
||||
|
||||
CS_Status status = 0;
|
||||
cs::AddListener(
|
||||
[&](const cs::RawEvent& event) {
|
||||
wpi::print("FPS={} MBPS={}\n", camera.GetActualFPS(),
|
||||
wpi::cs::AddListener(
|
||||
[&](const wpi::cs::RawEvent& event) {
|
||||
wpi::util::print("FPS={} MBPS={}\n", camera.GetActualFPS(),
|
||||
(camera.GetActualDataRate() / 1000000.0));
|
||||
},
|
||||
cs::RawEvent::kTelemetryUpdated, false, &status);
|
||||
cs::SetTelemetryPeriod(1.0);
|
||||
wpi::cs::RawEvent::kTelemetryUpdated, false, &status);
|
||||
wpi::cs::SetTelemetryPeriod(1.0);
|
||||
|
||||
std::getchar();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user