Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. package org.usfirst.frc.team4320.robot;
  2.  
  3. /**
  4. * The RobotMap is a mapping from the ports sensors and actuators are wired into
  5. * to a variable name. This provides flexibility changing wiring, makes checking
  6. * the wiring easier and significantly reduces the number of magic numbers
  7. * floating around.
  8. */
  9. public class RobotMap {
  10.  
  11. // Chassis - CAN
  12. public static final int REAR_LEFT_DRIVE = 1;
  13. public static final int FRONT_LEFT_DRIVE = 2;
  14. public static final int REAR_RIGHT_DRIVE = 3;
  15. public static final int FRONT_RIGHT_DRIVE = 4;
  16.  
  17. // Chassis encoders - DIO
  18. public static final int LEFT_ENCODER_A = 0;
  19. public static final int LEFT_ENCODER_B = 1;
  20. public static final int RIGHT_ENCODER_A = 2;
  21. public static final int RIGHT_ENCODER_B = 3;
  22.  
  23. // Gear Shifters - PCM
  24. public static final int SHIFTER_LEFT_OPEN = 0;
  25. public static final int SHIFTER_LEFT_CLOSE = 1;
  26. public static final int SHIFTER_RIGHT_OPEN = 2;
  27. public static final int SHIFTER_RIGHT_CLOSE = 3;
  28.  
  29. // Climbing motors - PWM
  30. public static final int CIMBING_MOTORS = 0;
  31.  
  32. // Climbing switches - DIO
  33. public static final int CLIMBER_SWITCH_1 = 4;
  34. public static final int CLIMBER_SWITCH_2 = 5;
  35.  
  36. // Gear catcher - PCM
  37. public static final int GEAR_CATCHER_OPEN = 4;
  38. public static final int GEAR_CATCHER_CLOSE = 5;
  39.  
  40. // Gear lifter - PCM
  41. public static final int GEAR_LIFTER_OPEN = 6;
  42. public static final int GEAR_LIFTER_CLOSE = 7;
  43.  
  44. // LED Control - Relay
  45. public static final int LED_SPIKE = 0;
  46.  
  47. // OI
  48. public static final int DRIVE_STICK = 1;
  49. public static final int XBOX_STICK = 2;
  50.  
  51. // Misc
  52. public static final double WHEEL_DIAMETER = 6 * 2.54;
  53. public static final double WHEEL_CIRCUMFERENCE = WHEEL_DIAMETER * Math.PI;
  54. public static final double LOW_SHIFTER_RATIO = 6.601;
  55. public static final double HIGH_SHIFTER_RATIO = 14.999;
  56. public static final double SHIFTER_ENCODER_RATIO = 3;
  57. public static final double ENCODER_STEPS_PER_REVOLUTION = 256;
  58. public static final double LOW_RATIO_DISTANCE_PER_PULSE = WHEEL_CIRCUMFERENCE*LOW_SHIFTER_RATIO*SHIFTER_ENCODER_RATIO/ENCODER_STEPS_PER_REVOLUTION;
  59. public static final double HIGH_RATIO_DISTANCE_PER_PULSE = WHEEL_CIRCUMFERENCE*HIGH_SHIFTER_RATIO*SHIFTER_ENCODER_RATIO/ENCODER_STEPS_PER_REVOLUTION;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement