blob: 1fe8ec2fa6ec04a67a0c78ea43f104f791dc81ac [file] [log] [blame]
James Kuszmauld6d37d12019-03-30 13:04:54 -07001syntax = "proto2";
2
3package y2019.vision;
4
5// Various proto definitions for use with the websocket server for debugging the
6// vision code.
7
8// Representation of a 2D pose on the field, generally referenced off of the
9// center of the driver's station wall with positive X out towards the field and
10// positive Y to the left from the driver's perspective. theta is zero when
11// pointed straight along the positive X axis and increases towards positive Y
12// (counter-clockwise).
13message Pose {
14 optional float x = 1; // meters
15 optional float y = 2; // meters
16 optional float theta = 3; // radians
17}
18
19// Debugging information for the line following.
20message LineFollowDebug {
21 // Pose of the target that we are currently latched onto.
22 optional Pose goal_target = 1;
23 // Whether we are currently in line following mode and so will freeze the
24 // target shortly.
25 optional bool frozen = 2;
26 // Whether we have chosen a target (otherwise, goal_target may be arbitrary).
27 optional bool have_target = 3;
28}
29
30// Data for a single camera at a given instance in time (corresponding to a
31// camera frame).
32message CameraDebug {
33 // The time that has passed, in seconds, since we last got a frame with a
34 // target in it.
35 optional float time_since_last_target = 1;
36 // The age of the most recent frame and the one that contains the targets included below.
37 optional float current_frame_age = 2;
38 // Target Pose is relative to the camera, *not* the field, so (0, 0) is at the
39 // camera.
40 repeated Pose targets = 3;
41}
42
Austin Schuh71ae7952019-04-14 15:12:52 -070043// Data for the current sensor values.
44message Sensors {
45 // Superstructure calibrated positions.
46 optional float wrist = 1;
47 optional float elevator = 2;
48 optional float intake = 3;
49 optional float stilts = 4;
Austin Schuh1a8fb572019-05-08 20:07:58 -070050 optional bool has_piece = 5;
Austin Schuh71ae7952019-04-14 15:12:52 -070051}
52
James Kuszmauld6d37d12019-03-30 13:04:54 -070053// The overall package of data that we send to the webpage.
54message DebugData {
55 optional Pose robot_pose = 1;
56 optional LineFollowDebug line_follow_debug = 2;
57 repeated CameraDebug camera_debug = 3;
Austin Schuh71ae7952019-04-14 15:12:52 -070058 optional Sensors sensors = 4;
James Kuszmauld6d37d12019-03-30 13:04:54 -070059}