-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathParams.java
More file actions
170 lines (162 loc) · 5.99 KB
/
Params.java
File metadata and controls
170 lines (162 loc) · 5.99 KB
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
159
160
161
162
163
164
165
166
167
168
169
170
package org.firstinspires.ftc.teamcode;
import com.acmerobotics.dashboard.config.Config;
import org.firstinspires.ftc.teamcode.codes.tunings.SecPowerPerInchTuner;
import org.firstinspires.ftc.teamcode.codes.tunings.ThreeInOne_DeadWheelTuner;
import org.firstinspires.ftc.teamcode.utils.clients.Client;
import org.firstinspires.ftc.teamcode.utils.clients.DashboardClient;
import org.firstinspires.ftc.teamcode.utils.clients.TelemetryClient;
@Config
public enum Params {
;
@Config
public enum PIDParams{
;
//与底盘相关的kP理论值:SimpleMecanumDrive.Params.secPowerPerInch
//TODO:预设...[0]为底盘X,[1]为底盘Y,[2]为底盘方向
//TODO:若要更改,则请查看对该类型的访问中的序数是否需要改变
public static final double[] kP= {0.12, 0.15, 0.12};
public static final double[] kI= {0, 0, 0};
public static final double[] kD= {0.04, 0.05, 0.04};
public static final double[] MAX_I= {100, 100, 0};
}
/**
* 会在 Robot 的构造函数中修改
* @see Robot
* */
@Config
public enum Configs{
;
/**让机器自动在运行{@code update()}时,自动清除所有电机的{@code power}*/
public static boolean autoPrepareForNextOptionWhenUpdate = true;
/**让机器自动在执行提供的操作时,自动在更改任何{@code power}变量后执行{@code update()}*/
public static boolean runUpdateWhenAnyNewOptionsAdded;
/**在对舵机下达命令时,自动等待舵机到位*/
public static boolean waitForServoUntilThePositionIsInPlace;
/**让机器即使在不调用{@code pid}时,依然执行{@code pid.update()}*/
public static boolean alwaysRunPIDInAutonomous;
/**在自动程序中使用{@code pid}*/
public static boolean usePIDToDriveInAutonomous = true;
/**必须在自动程序中保持改变量为{@code true}*/
public static boolean driverUsingAxisPowerInsteadOfCurrentPower =true;
/**启用超时保护器*/
public static boolean useOutTimeProtection = true;
/**自动在初始化{@code IntegrationHardwareMap}时,登记所有硬件<p>适合单一队伍的程序*/
public static boolean autoRegisterAllHardwaresWhenInit = true;
/**
* 自动在{@code Client}定义时候加入 FtcDashboardTelemetry
* @see Client
*/
public static boolean clientAutoRegisteredFtcDashboardTelemetry=true;
/**
* 自动在{@code TelemetryClient.addData}时更新 DashboardClient
* @see TelemetryClient#addData(String, Object)
* @see DashboardClient#put(Object, Object)
*/
public static boolean dashboardAutoSyncWithTelemetry=true;
public static boolean sortDataInTelemetryClientUpdate=true;
public static void reset(){
driverUsingAxisPowerInsteadOfCurrentPower =true;
runUpdateWhenAnyNewOptionsAdded =false;
waitForServoUntilThePositionIsInPlace =false;
autoPrepareForNextOptionWhenUpdate =false;
alwaysRunPIDInAutonomous =false;
usePIDToDriveInAutonomous =true;
useOutTimeProtection =true;
autoRegisterAllHardwaresWhenInit =true;
clientAutoRegisteredFtcDashboardTelemetry =true;
dashboardAutoSyncWithTelemetry =true;
sortDataInTelemetryClientUpdate =true;
}
public static final String TuningAndTuneOpModesGroup = "0_Tunings";
public static final String SampleOpModesGroup = "0_Samples";
}
@Config
public enum HardwareNamespace {
;
public static final String leftFront ="leftFront";
public static final String rightFront ="rightFront";
public static final String leftRear ="leftBack";
public static final String rightRear ="rightBack";
public static final String placementArm ="rightLift";
public static final String intake ="intake";
public static final String frontClip ="frontClip";
public static final String rearClip ="rearClip";
public static final String suspensionArm ="rack";
public static final String imu ="imu";
}
@Config
public enum ServoConfigs{
;
public static double frontClipOpen;
public static double rearClipOpen;
public static double frontClipClose;
public static double rearClipClose;
}
@Config
public enum PositionalMotorConfigs{
;
public static int IDLEPlacement;
public static int LowPlacement;
public static int HighPlacement;
}
/**
* 每Tick机器所旋转的角度
* @see ThreeInOne_DeadWheelTuner
*/
public static final double TurningDegPerTick = 0.15;
/**
* 每Tick机器所前进的距离
* @see ThreeInOne_DeadWheelTuner
*/
public static final double AxialInchPerTick=0.00114285714285714285714285714286;
/**
* 每Tick机器所平移的距离
* @see ThreeInOne_DeadWheelTuner
*/
public static final double LateralInchPerTick= AxialInchPerTick;
/**
* 用1f的力,在1s后所前行的距离,单位:inch (time(1s)*power(1f)) [sf/inch]
* @see SecPowerPerInchTuner
*/
public static final double secPowerPerInch = 24;
/**
*positionErrorMargin,单位:inch
*/
public static final double pem=0.5;
/**
*angleErrorMargin,单位:度
*/
public static final double aem=1;
/**
* 机器的超时保护机制,如果超过该时间,机器仍未到达点位,则会强制取消点位的执行
*/
public static final double timeOutProtectionMills=1000;
/**
* 左侧死轮和右侧死轮的距离,单位:inch
*/
public static final double LateralPosition=21;
/**
* 机器中心到中间死轮(前端死轮)的距离,单位:inch
*/
public static final double AxialPosition=1;
/**
* 在执行手动程序时,由Classic下达的XPower命令的倍率因数
*/
public static final double factorXPower=1;
/**
* 在执行手动程序时,由Classic下达的YPower命令的倍率因数
*/
public static final double factorYPower=1;
/**
* 在执行手动程序时,由Classic下达的HeadingPower命令的倍率因数
*/
public static final double factorHeadingPower=1;
/**
* 在执行手动程序时,由Structure下达的IntakePower命令的倍率因数
*/
public static final double factorIntakePower=1;
/**
* 在执行手动程序时,由Structure下达的SuspensionArmPower命令的倍率因数
*/
public static final double factorSuspensionArmPower=1;
}