James Kuszmaul | d6d37d1 | 2019-03-30 13:04:54 -0700 | [diff] [blame] | 1 | syntax = "proto2"; |
| 2 | |
| 3 | package 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). |
| 13 | message 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. |
| 20 | message 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). |
| 32 | message 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 Schuh | 71ae795 | 2019-04-14 15:12:52 -0700 | [diff] [blame] | 43 | // Data for the current sensor values. |
| 44 | message 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 Schuh | 1a8fb57 | 2019-05-08 20:07:58 -0700 | [diff] [blame] | 50 | optional bool has_piece = 5; |
Austin Schuh | 71ae795 | 2019-04-14 15:12:52 -0700 | [diff] [blame] | 51 | } |
| 52 | |
James Kuszmaul | d6d37d1 | 2019-03-30 13:04:54 -0700 | [diff] [blame] | 53 | // The overall package of data that we send to the webpage. |
| 54 | message DebugData { |
| 55 | optional Pose robot_pose = 1; |
| 56 | optional LineFollowDebug line_follow_debug = 2; |
| 57 | repeated CameraDebug camera_debug = 3; |
Austin Schuh | 71ae795 | 2019-04-14 15:12:52 -0700 | [diff] [blame] | 58 | optional Sensors sensors = 4; |
James Kuszmaul | d6d37d1 | 2019-03-30 13:04:54 -0700 | [diff] [blame] | 59 | } |