Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 1 | include "frc971/control_loops/control_loops.fbs"; |
| 2 | |
| 3 | namespace y2023.control_loops.superstructure; |
| 4 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 5 | table ArmPosition { |
| 6 | // Values of the encoder and potentiometer at the base of the proximal |
| 7 | // (connected to drivebase) arm in radians. |
milind-u | 18934eb | 2023-02-20 16:28:58 -0800 | [diff] [blame] | 8 | // Zero is upwards, positive is a forwards rotation |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 9 | proximal:frc971.PotAndAbsolutePosition (id: 0); |
Nikita Narang | 27610fc | 2023-02-08 19:40:31 -0800 | [diff] [blame] | 10 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 11 | // Values of the encoder and potentiometer at the base of the distal |
| 12 | // (connected to proximal) arm in radians. |
milind-u | 18934eb | 2023-02-20 16:28:58 -0800 | [diff] [blame] | 13 | // Zero is straight up, positive is a forwards rotation |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 14 | distal:frc971.PotAndAbsolutePosition (id: 1); |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame] | 15 | |
| 16 | // Zero for roll joint is up vertically |
| 17 | // Positive position would be rotated counterclockwise relative to the robot |
| 18 | roll_joint:frc971.PotAndAbsolutePosition (id: 2); |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 19 | } |
| 20 | |
milind-u | 738832d | 2023-02-24 19:55:54 -0800 | [diff] [blame] | 21 | table CANFalcon { |
| 22 | // The CAN id of the falcon |
| 23 | id:int (id: 0); |
| 24 | |
| 25 | // In Amps |
| 26 | supply_current:float (id: 1); |
| 27 | |
| 28 | // In Amps |
| 29 | // Stator current where positive current means torque is applied in |
| 30 | // the motor's forward direction as determined by its Inverted setting. |
| 31 | torque_current:float (id: 2); |
| 32 | |
| 33 | // In Volts |
| 34 | supply_voltage:float (id: 3); |
| 35 | |
| 36 | // In degrees Celsius |
| 37 | device_temp:float (id: 4); |
| 38 | |
| 39 | // Raw position |
| 40 | position:float (id: 5); |
Ravago Jones | 088ca77 | 2023-03-25 22:14:24 -0700 | [diff] [blame] | 41 | |
| 42 | // Nominal range is -1 to 1, but can be -2 to +2 |
| 43 | duty_cycle:float (id: 6); |
milind-u | 738832d | 2023-02-24 19:55:54 -0800 | [diff] [blame] | 44 | } |
| 45 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame] | 46 | table Position { |
| 47 | arm:ArmPosition (id: 0); |
Nikita Narang | 27610fc | 2023-02-08 19:40:31 -0800 | [diff] [blame] | 48 | |
Nikita Narang | 27610fc | 2023-02-08 19:40:31 -0800 | [diff] [blame] | 49 | // Zero for wrist is facing staright outward. |
| 50 | // Positive position would be upwards |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame] | 51 | wrist:frc971.AbsolutePosition (id: 1); |
Maxwell Henderson | 589cf27 | 2023-02-22 15:56:40 -0800 | [diff] [blame] | 52 | |
James Kuszmaul | cf451fb | 2023-03-10 20:42:36 -0800 | [diff] [blame] | 53 | // Estimated position of a cone in the gripper from the time-of-flight |
| 54 | // sensors. |
| 55 | // If greater than 0.9, indicates that we cannot see a cone. |
| 56 | // Will be larger when the cone is farther forwards on the robot when |
| 57 | // the wrist and arm positions are all at zero (this will typically mean |
| 58 | // that it is larger when the cone is to the robot's current right when |
| 59 | // trying to core). |
milind-u | 3a7f921 | 2023-02-24 20:46:59 -0800 | [diff] [blame] | 60 | cone_position:double (id: 2); |
Maxwell Henderson | 589cf27 | 2023-02-22 15:56:40 -0800 | [diff] [blame] | 61 | |
| 62 | // If this is true, the cube beam break is triggered. |
| 63 | end_effector_cube_beam_break:bool (id: 3); |
milind-u | 738832d | 2023-02-24 19:55:54 -0800 | [diff] [blame] | 64 | |
| 65 | // Roller falcon data |
| 66 | roller_falcon:CANFalcon (id: 4); |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | root_type Position; |