Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
syntax = "proto3";
import "witness/api/error.proto";
import "witness/api/calibration.proto";
import "witness/api/tracking.proto";
package witness.api;
service WitnessCameraService {
// Opens a webcam by id.
rpc OpenWebcam(OpenWebcamRequest) returns (OpenWebcamReply);
// Starts a normal video recording.
rpc StartRecording(StartRecordingRequest) returns (StartRecordingReply);
// Stops any recording type, be it recording, timelapse, or monitor.
rpc StopRecording(StopRecordingRequest) returns (StopRecordingReply);
// Takes a photo.
rpc TakePhoto(TakePhotoRequest) returns (TakePhotoReply);
// Gets a list of files on the server's data directory.
rpc GetFileList(GetFileListRequest) returns (stream FileListReply);
// Clears all files on the server's data directory.
rpc ClearData(ClearDataRequest) returns (ClearDataReply);
// Starts a timelapse.
rpc StartTimelapse(StartTimelapseRequest) returns (StartTimelapseReply);
rpc GetServerState(ServerStateRequest) returns (ServerStateReply);
// Starts a security monitor.
rpc StartMonitor(StartMonitorRequest) returns (StartMonitorReply);
// Gets the version of the running server.
rpc GetServerVersion(VersionRequest) returns (VersionReply);
// Sets an angle for the camera's image to be rotated
rpc SetCameraRotation(CameraRotationRequest) returns (CameraRotationReply);
// Starts a april tag tracking service
rpc StartAprilTracking(StartAprilTrackingRequest) returns (stream StartAprilTrackingReply);
// Starts a calibration routine on the camera.
rpc StartCalibration(StartCalibrationRequest) returns (stream StartCalibrationReply);
// Gets the loaded calibration
rpc GetCalibration(GetCalibrationRequest) returns (GetCalibrationReply);
}
message ServerState {
State state = 1;
enum State {
// The server is idle (not actively in a recording loop).
IDLE = 0;
// The server is in a recording loop.
RECORDING = 1;
// The server is in a security monitor loop.
MONITORING = 2;
// The server is running a calibration routine on the active camera.
CALIBRATING = 3;
// The server is runing a tracking routine on the active camera.
TRACKING = 4;
}
}
message OpenWebcamRequest {
// Integer of webcam to open. video0 is 0, video1 is 1, etc.
// Note that this is almost always going to be the default value of zero, as this softare will
// almost always be running in a container, which can be translated by the docker volume command.
int32 webcam_id = 1;
}
message OpenWebcamReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {}
}
message StartRecordingRequest {
// If filename is not specified, the current date will be used as the file name.
string filename = 1;
}
message StartRecordingReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {}
}
message StopRecordingRequest {}
message StopRecordingReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {}
}
message TakePhotoRequest {
// If filename is not specified, the current date will be used as the file name.
string filename = 1;
}
message TakePhotoReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {
// Reply data is the saved file's name.
string filename = 1;
}
}
message GetFileListRequest {}
message FileListReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {
string filename = 1;
}
}
message ClearDataRequest {}
message ClearDataReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {}
}
message StartTimelapseRequest {
// If filename is not specified, the current date will be used as the file name.
string filename = 1;
// Desired sleep time between photos.
int32 sleep_for = 2;
}
message StartTimelapseReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {}
}
message ServerStateRequest {}
message ServerStateReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {
ServerState state = 1;
}
}
message StartMonitorRequest {}
message StartMonitorReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {}
}
message VersionRequest {}
message VersionReply {
// Server version, useful to check capabilities and definitions.
string version = 1;
}
message CameraRotationRequest {
// Rotation angle in degrees. Positive values mean counter-clockwise rotation
int32 degrees = 1;
}
message CameraRotationReply {
oneof result {
Error error = 1;
Data data = 2;
}
message Data {}
}