-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHwMap.java
53 lines (42 loc) · 1.89 KB
/
HwMap.java
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
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.hardware.HardwareMap;
import org.firstinspires.ftc.teamcode.Tools.Chassis.Chassis;
import org.firstinspires.ftc.teamcode.Tools.Chassis.MecanumChassis;
import org.firstinspires.ftc.teamcode.Tools.Chassis.NormalChassis;
import org.firstinspires.ftc.teamcode.Tools.DTypes.Position2D;
import org.firstinspires.ftc.teamcode.Tools.FieldNavigation;
import org.firstinspires.ftc.teamcode.Tools.Robot;
public class HwMap {
// robot
public Robot robot;
public FieldNavigation navi;
public Chassis chassis;
/* PLACE YOUR HARDWARE INTERFACES DOWN BELOW */
/* END SECTION */
/* PLACE YOUR CONSTANT VALUES DOWN BELOW*/
// driving speeds
public final double speed_full = 1.0;
public final double speed_normal = 0.8;
public final double speed_sneak = 0.5;
// autonomous values
public final double driving_accuracy = 1.5;
public final float rotation_accuracy = 3.0f;
/* END SECTION */
/**
* initialize the hardware
* @param hardwareMap just put the object "hardwareMap" in here
*/
public void initialize(HardwareMap hardwareMap) {
// get chassis
chassis = new MecanumChassis(); // most likely your chassis is a mecanumwheel driven chassis
chassis.setRotationAxis(2); /* (1=x,2=y,3=z,4=disabled) change this if needed : the value can be obtained with OpModes.Testing.GyroTest */
chassis.populateMotorArray(hardwareMap); // uses hardwareMap.get(...) to get motor interfaces as defined in the used chassis class
chassis.setRotation(0.0f); // start rotation is 0 degrees
// get field navigator
navi = new FieldNavigation(new Position2D(0.0, 0.0)); // start position is (0|0)
// get robot api object
robot = new Robot(navi, chassis);
/* INITIALIZE YOUR HARDWARE DOWN BELOW */
/* END SECTION */
}
}