tele pose transfer
This commit is contained in:
@@ -19,6 +19,7 @@ import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||
|
||||
import org.firstinspires.ftc.teamcode.constants.Color;
|
||||
import org.firstinspires.ftc.teamcode.constants.ServoPositions;
|
||||
import org.firstinspires.ftc.teamcode.constants.TeleStart;
|
||||
import org.firstinspires.ftc.teamcode.pedroPathing.Constants;
|
||||
import org.firstinspires.ftc.teamcode.utilsv2.*;
|
||||
import org.firstinspires.ftc.teamcode.utils.MeasuringLoopTimes;
|
||||
@@ -388,9 +389,7 @@ public class Auto12Ball_Back_Sorted extends LinearOpMode {
|
||||
follower.update();
|
||||
pathStateMachine();
|
||||
Pose currentPose = follower.getPose();
|
||||
teleStartPoseX = currentPose.getX();
|
||||
teleStartPoseY = currentPose.getY();
|
||||
teleStartPoseH = Math.toDegrees(currentPose.getHeading());
|
||||
TeleStart.teleStart = currentPose;
|
||||
|
||||
spindexer.update();
|
||||
|
||||
@@ -402,9 +401,9 @@ public class Auto12Ball_Back_Sorted extends LinearOpMode {
|
||||
TELE.addData("Avg Loop Time", loopTimes.getAvgLoopTime());
|
||||
TELE.addData("Min Loop Time", loopTimes.getMinLoopTimeOneMin());
|
||||
TELE.addData("Max Loop Time", loopTimes.getMaxLoopTimeOneMin());
|
||||
TELE.addData("X:", currentPose.getX());
|
||||
TELE.addData("Y:", currentPose.getY());
|
||||
TELE.addData("H:", currentPose.getHeading());
|
||||
TELE.addData("X:", teleStartPoseX);
|
||||
TELE.addData("Y:", teleStartPoseY);
|
||||
TELE.addData("H:", teleStartPoseH);
|
||||
TELE.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.firstinspires.ftc.teamcode.constants;
|
||||
|
||||
import com.pedropathing.geometry.Pose;
|
||||
|
||||
public class TeleStart {
|
||||
public static Pose teleStart = new Pose(72,72,0);
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
|
||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||
|
||||
import org.firstinspires.ftc.teamcode.constants.Color;
|
||||
import org.firstinspires.ftc.teamcode.constants.TeleStart;
|
||||
import org.firstinspires.ftc.teamcode.pedroPathing.Constants;
|
||||
import org.firstinspires.ftc.teamcode.utils.MeasuringLoopTimes;
|
||||
import org.firstinspires.ftc.teamcode.utilsv2.*;
|
||||
@@ -50,8 +51,10 @@ public class TeleopV4 extends LinearOpMode {
|
||||
commander = new VelocityCommander();
|
||||
drivetrain = new Drivetrain(robot, TELE);
|
||||
follower = Constants.createFollower(hardwareMap);
|
||||
Pose start = new Pose(teleStartPoseX, teleStartPoseY, Math.toRadians(teleStartPoseH));
|
||||
follower.setStartingPose(start);
|
||||
follower.setStartingPose(TeleStart.teleStart);
|
||||
sleep(500);
|
||||
follower.setPose(TeleStart.teleStart);
|
||||
follower.update();
|
||||
|
||||
flywheel = new Flywheel(robot);
|
||||
turret = new Turret(robot);
|
||||
@@ -73,6 +76,9 @@ public class TeleopV4 extends LinearOpMode {
|
||||
|
||||
limelightUsed = true;
|
||||
|
||||
TELE.addLine("Initialization is done");
|
||||
TELE.update();
|
||||
|
||||
waitForStart();
|
||||
|
||||
if (isStopRequested()) return;
|
||||
|
||||
Reference in New Issue
Block a user