-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.py
71 lines (53 loc) · 1.67 KB
/
const.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
"""
Ctrl-Z FRC Team 4096
FIRST Robotics Competition 2016, "Stronghold"
Code for robot "Jaw-Z"
contact@team4096.org
"""
import wpilib
### CONSTANTS ###
# Which robot is this? Used to flip PWM values around.
# Next year, let's use same inputs on both robots?
COMPETITION_ROBOT = True
# PWM port IDs
#Roborio Accelerometer
NEGATIVE_ACCEL_VALUE = 0
# Drivetrain
ID_DRIVE_MOTOR_FRONT_LEFT = 9
ID_DRIVE_MOTOR_REAR_LEFT = 8
ID_DRIVE_MOTOR_FRONT_RIGHT = 4
ID_DRIVE_MOTOR_REAR_RIGHT = 5
ID_DRIVE_SOLENOID_SHIFTER_1 = 0
ID_DRIVE_SOLENOID_SHIFTER_2 = 1
DRIVE_CORRECTION_ENABLED = True
DRIVE_CORRECTION_ROTATION_THRESHOLD = 0.05
DRIVE_CORRECTION_PROPORTION = 0.04
DRIVE_MIN_ROTATION_OUTPUT = 0.15 # Min power output required to rotate robot at all
# Feeder
ID_VICTOR_BELTS = 3
ID_VICTOR_LIFT_1 = 7
ID_VICTOR_LIFT_2 = 1
FEEDER_HIGH_POINT = 3604
FEEDER_CENTER_POINT = 2380
FEEDER_LOW_POINT = 2077
# Indexer
ID_VICTOR_INDEXER = 2
INDEXER_POWER = 1.0
# Shooter
ID_VICTOR_WHEEL_1 = 6
ID_VICTOR_WHEEL_2 = 0
# This was measured by observing 289 pulses per full wheel revolution, 1.0 / 289 = 0.00346
SHOOTER_ENCODER_DISTANCE_PER_PULSE = 0.00346
SHOOTER_WHEEL_TARGET_RATE = 90
SHOOTER_WHEEL_WAIT_FOR_RATE = 100
SHOOTER_WHEEL_TARGET_RATE_TOLERANCE = 0.0
# IDs for state of drive shifter
ID_MECANUM = 0
ID_TANK = 1
# Camera constants
CAMERA_RES_X = 320
CAMERA_RES_Y = 240
CAMERA_FOV = 68 # used to be 84 when nolan was dumb
CAMERA_ALIGN_THRESHOLD = 1 # degrees
CAMERA_SHOOTER_PIXEL_OFFSET = 10 # Fudge factor used to adjust camera vs. shooter alignment, in pixels
# greater the pos value = aim more left