forked from janetvenditti/CenterStage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from KookyBotz/dual
haha funny relocalization go brrrrr
- Loading branch information
Showing
17 changed files
with
181 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...irstinspires/ftc/teamcode/common/commandbase/cycleautocommand/StackRelocalizeCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.firstinspires.ftc.teamcode.common.commandbase.cycleautocommand; | ||
|
||
import com.arcrobotics.ftclib.command.InstantCommand; | ||
import com.arcrobotics.ftclib.command.SequentialCommandGroup; | ||
import com.arcrobotics.ftclib.command.WaitCommand; | ||
|
||
import org.firstinspires.ftc.teamcode.common.commandbase.drivecommand.PositionCommand; | ||
import org.firstinspires.ftc.teamcode.common.drive.pathing.geometry.Pose; | ||
import org.firstinspires.ftc.teamcode.common.hardware.RobotHardware; | ||
import org.firstinspires.ftc.teamcode.common.vision.StackPipeline; | ||
|
||
import java.util.function.DoubleSupplier; | ||
|
||
public class StackRelocalizeCommand extends SequentialCommandGroup { | ||
public StackRelocalizeCommand(StackPipeline stackPipeline, Pose targetPose) { | ||
super ( | ||
// new WaitCommand(50), // TODO: lower this. due to processing times with the pipeline, giving this a lenient time period | ||
new InstantCommand(() -> { | ||
double correction = stackPipeline.getStrafeCorrection(); | ||
System.out.println("CORRECTION342 " + correction); | ||
Pose currentPose = RobotHardware.getInstance().localizer.getPose(); | ||
System.out.println("CORRECTION342 " + currentPose); | ||
RobotHardware.getInstance().localizer.setPose(new Pose(currentPose.x + correction, currentPose.y, currentPose.heading)); | ||
System.out.println("CORRECTION342 " + RobotHardware.getInstance().localizer.getPose()); | ||
}), | ||
// new WaitCommand(100), | ||
new PositionCommand(targetPose) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.