blob: af3f06472bd1f4fd13b6e187160e938c0542c799 [file] [log] [blame]
Austin Schuh09c2b0b2016-02-13 15:53:16 -08001package y2016.control_loops.shooter;
Comran Morshed2a97bc82016-01-16 17:27:01 +00002
3import "aos/common/controls/control_loops.q";
4import "frc971/control_loops/control_loops.q";
5
Austin Schuh09c2b0b2016-02-13 15:53:16 -08006struct ShooterSideStatus {
7 // True if the shooter side is up to speed and stable.
8 bool ready;
9 // The current average velocity in radians/second.
10 double avg_angular_velocity;
11 // The current instantaneous filtered velocity in radians/second.
12 double angular_velocity;
13};
14
Comran Morshed2a97bc82016-01-16 17:27:01 +000015queue_group ShooterQueue {
16 implements aos.control_loops.ControlLoop;
17
Austin Schuh09c2b0b2016-02-13 15:53:16 -080018 // All angles are in radians, and angular velocities are in radians/second.
19 // For all angular velocities, positive is shooting the ball out of the robot.
Comran Morshed2a97bc82016-01-16 17:27:01 +000020
Comran Morshedcde50322016-01-18 15:10:36 +000021 message Goal {
Austin Schuh09c2b0b2016-02-13 15:53:16 -080022 // Angular velocity goals in radians/second.
23 double angular_velocity;
Comran Morshed2a97bc82016-01-16 17:27:01 +000024 };
25
26 message Position {
Austin Schuh09c2b0b2016-02-13 15:53:16 -080027 // Wheel angle in radians/second.
Comran Morshedcde50322016-01-18 15:10:36 +000028 double theta_left;
29 double theta_right;
30 };
31
32 message Status {
Austin Schuh09c2b0b2016-02-13 15:53:16 -080033 // Left side status.
34 ShooterSideStatus left;
35 // Right side status.
36 ShooterSideStatus right;
Comran Morshedcde50322016-01-18 15:10:36 +000037
Austin Schuh09c2b0b2016-02-13 15:53:16 -080038 // True if the shooter is ready. It is better to compare the velocities
39 // directly so there isn't confusion on if the goal is up to date.
40 bool ready;
Comran Morshedcde50322016-01-18 15:10:36 +000041 };
42
43 message Output {
Austin Schuh09c2b0b2016-02-13 15:53:16 -080044 // Voltage in volts of the left and right shooter motors.
Comran Morshedcde50322016-01-18 15:10:36 +000045 double voltage_left;
46 double voltage_right;
Comran Morshed2a97bc82016-01-16 17:27:01 +000047 };
48
49 queue Goal goal;
50 queue Position position;
Comran Morshedcde50322016-01-18 15:10:36 +000051 queue Output output;
Comran Morshed2a97bc82016-01-16 17:27:01 +000052 queue Status status;
53};
54
55queue_group ShooterQueue shooter_queue;