Skip to content

Commit b9e7ea0

Browse files
committed
formating fixes and auto code
1 parent f5ea867 commit b9e7ea0

5 files changed

Lines changed: 71 additions & 4 deletions

File tree

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PedroAutoSample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ public void initialize() {
113113
buildPaths();
114114

115115
// Create the autonomous command sequence
116-
SequentialCommandGroup autonomousSequence = new SequentialCommandGroup(
116+
SequentialCommandGroup autonomousSequence = new SequentialCommandGroup
117+
(
117118
// Score preload
118119
new FollowPathCommand(follower, scorePreload),
119120
openOuttakeClaw(),
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
package org.mrpsvt.capital_robotics;
22

3-
public class ArtifactIntake {
3+
public class ArtifactIntake
4+
{
5+
46
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
package org.mrpsvt.capital_robotics;
22

3-
public class ArtifactLauncher {
3+
public class ArtifactLauncher
4+
{
5+
46
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package org.mrpsvt.capital_robotics.auto;
2+
3+
import com.pedropathing.follower.Follower;
4+
import com.pedropathing.geometry.BezierLine;
5+
import com.pedropathing.geometry.Pose;
6+
import com.pedropathing.paths.PathChain;
7+
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
8+
import com.qualcomm.robotcore.hardware.HardwareMap;
9+
import com.seattlesolvers.solverslib.command.CommandOpMode;
10+
import com.seattlesolvers.solverslib.command.SequentialCommandGroup;
11+
import com.seattlesolvers.solverslib.pedroCommand.FollowPathCommand;
12+
13+
import org.firstinspires.ftc.teamcode.pedroPathing.Constants;
14+
import org.mrpsvt.capital_robotics.robot_core.DriveBase;
15+
16+
@Autonomous
17+
public abstract class scrimmageMoveForward extends CommandOpMode
18+
{
19+
private Follower followerElement;
20+
private PathChain pathElement;
21+
private boolean stop;
22+
private double speed;
23+
private HardwareMap hardwareImport;
24+
25+
//start and end points
26+
private Pose startPose = new Pose(0, 0, Math.toRadians(90));
27+
private Pose endPose = new Pose(48, 48, Math.toRadians(90));
28+
29+
//gives context to the follower via hardwareMap, and makes the linear pathElement
30+
public void compilePathChain()
31+
{
32+
followerElement = Constants.createFollower(DriveBase.getHardwareMap());
33+
pathElement = followerElement.pathBuilder()
34+
.addPath(new BezierLine(startPose, endPose))
35+
.setLinearHeadingInterpolation(startPose.getHeading(), endPose.getHeading())
36+
.build();
37+
}
38+
39+
@Override
40+
public void initialize()
41+
{
42+
//super.reset()
43+
followerElement.setStartingPose(startPose);
44+
compilePathChain();
45+
46+
SequentialCommandGroup order = new SequentialCommandGroup
47+
(
48+
new FollowPathCommand(followerElement, pathElement).setGlobalMaxPower(0.5)
49+
);
50+
}
51+
52+
@Override
53+
public void run()
54+
{
55+
super.run();
56+
}
57+
}

TeamCode/src/main/java/org/mrpsvt/capital_robotics/robot_core/DriveBase.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
public class DriveBase {
13-
HardwareMap hardwareMap;
13+
static HardwareMap hardwareMap;
1414
Motor frontLeft;
1515
Motor frontRight;
1616
Motor backLeft;
@@ -40,4 +40,9 @@ public RevIMU initIMU() {
4040
imu.init();
4141
return imu;
4242
}
43+
44+
public static HardwareMap getHardwareMap()
45+
{
46+
return hardwareMap;
47+
}
4348
}

0 commit comments

Comments
 (0)