-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconstants.py
158 lines (118 loc) · 3.57 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
class RobotPIDConstants():
note_tracking_pid = (0.07, 0, 0.004) # this probably isn't used anymore
note_translate_pid = note_tracking_pid
speaker_tracking_pid = (0.06, 0, 0)
# well, guess no, we don't want PID for that.
# It makes it squishy
straight_drive_pid = [0.04, 0, 0.001] # JRD Was 0.015, 0, 0.001
class RobotMotorMap():
# REAL CAN ASSIGNMENTS
# Swerve Motors
front_left_drive = 12
front_right_drive = 11
back_left_drive = 13
back_right_drive = 14
front_left_turn = 22
front_right_turn = 21
back_left_turn = 23
back_right_turn = 24
# Cancoders
front_left_turn_encoder = 32
front_right_turn_encoder = 31
back_left_turn_encoder = 33
back_right_turn_encoder = 34
# MIN CAN ID = 1 DO NOT USE ZERO FOR CAN ID
# MAX CAN ID = 62
# Can Ranges: Swerve Motors = 11-24, Swerve Cancoders = 31-34, Pigeon = 35,
# Shooter = 41-45, Intake = 51-52, Amp = 54-55, Climber = 57-58
# ## CHASSIS BOT ## #
# Swerve
# front_right_drive = 11
# front_right_turn = 21
# front_right_turn_encoder = 31
# front_left_drive = 12
# front_left_turn = 22
# front_left_turn_encoder = 32
# back_right_drive = 13
# back_right_turn = 23
# back_right_turn_encoder = 33
# back_left_drive = 14
# back_left_turn = 24
# back_left_turn_encoder = 34
# ## CHASSIS BOT ## #
intake_motor_feed = 51
amp_lift_motor = 54
amp_feed_motor = 55
# Climber Motors
climber_motor_left = 57
climber_motor_right = 58
# Shooter Motors
shooter_motor_left = 41
shooter_motor_right = 42
shooter_motor_feed_right = 46
shooter_motor_feed_left = 47
shooter_motor_tilt_left = 44
shooter_motor_tilt_right = 45
class RobotSensorMap():
# Gyro
pigeon2_id = 35
# Limit Switches DIO
amp_lift_bottom_limit_switch = 9
# Photoeyes DIO
intake_front_photoeye = 2
intake_hold_photoeye = 1
amp_hold_photoeye = 0
shooter_hold_photoeye = 3
# Encoders DIO
shooter_tilt_encoder = 7
climber_left_encoder = 4
climber_right_encoder = 5
# Addressable LEDS PWM
addressable_leds = 0
class RobotButtonMap():
# Controller ids
driver_controller = 0
commander_controller_1 = 1
commander_controller_2 = 2
# Driver button assignments
note_tracking = 5 # Left bumper
toggle_field_relative = 3
speaker_tracking = 6 # Right bumper
slow_drive_mode = 4 # Y Button
flip_heading = 1
swap_direction = 2
RESET_YAW = 8
# Button Panel List
# INTAKE: Intake Ready, Intake Eject
# SHOOTER: Load Shooter, On The Fly(OTF) Aim, Safe Spot Aim,
# Against Sub Aim, Shoot
# AMP: Load Amp, Go Amp Height, Go Trap Height, Eject Note
# OVERRIDES: Intake Up, Intake Down, Intake Feed In, Intake Feed Out
# MISC: Note Return to Home
# Commander button assignments
# # Controller 1 ## #
intake_ready_c1 = 9
intake_eject_c1 = 8
load_note_shooter_c1 = 7
shooter_aim_sub_c1 = 6
shooter_aim_otf_c1 = 3
shooter_aim_safe_c1 = 2
shooter_override_up_c1 = 4
shooter_override_down_c1 = 5
# ## Controller 2 ## #
load_note_amp_c2 = 6
amp_lift_home_c2 = 8
amp_lift_amp_c2 = 11
amp_lift_trap_c2 = 10
# Unused
amp_override_up_c2 = 9
amp_override_down_c2 = 7
amp_dump_note_c2 = 2
shooter_shoot_c2 = 4
shooter_spin_c2 = 3
# Reset odometry to whatever vision thinks we're at.
reset_odometry_c2 = 5
override_shooter_speed_c2 = 1
# Not used?
climber_up_c2 = 5
climber_down_c2 = 1