mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
odo chooser stuff
This commit is contained in:
@@ -170,9 +170,7 @@ public class Robot extends TimedRobot {
|
|||||||
// SmartDashboard.putNumber("Odometry Y", m_robotContainer.getOdometry().getY());
|
// SmartDashboard.putNumber("Odometry Y", m_robotContainer.getOdometry().getY());
|
||||||
// SmartDashboard.putNumber("Odometry Theta", m_robotContainer.getOdometry().getRotation().getDegrees());
|
// SmartDashboard.putNumber("Odometry Theta", m_robotContainer.getOdometry().getRotation().getDegrees());
|
||||||
// odo chooser stuff
|
// odo chooser stuff
|
||||||
addOdoChoices(new Pose2d(1, 1, new Rotation2d(Math.PI/6)),
|
addOdoChoices(new Pose2d(3.2766, -0.9398, new Rotation2d(0)));
|
||||||
new Pose2d(1, 2, new Rotation2d(Math.PI/3)),
|
|
||||||
new Pose2d(1, 3, new Rotation2d(Math.PI/4)));
|
|
||||||
updateOdoChooser();
|
updateOdoChooser();
|
||||||
SmartDashboard.putData("Odometry Chooser", odoChooser);
|
SmartDashboard.putData("Odometry Chooser", odoChooser);
|
||||||
}
|
}
|
||||||
@@ -185,7 +183,7 @@ public class Robot extends TimedRobot {
|
|||||||
|
|
||||||
public void addOdoChoices(Pose2d... points) {
|
public void addOdoChoices(Pose2d... points) {
|
||||||
for (Pose2d point : points) {
|
for (Pose2d point : points) {
|
||||||
String key = "(" + point.getX() + ", " + point.getY() + ", " + point.getRotation().getDegrees() + "°)";
|
String key = "(" + point.getX() + ", " + point.getY() + ", " + point.getRotation().getDegrees() + ")";
|
||||||
odoChoices.put(key, point);
|
odoChoices.put(key, point);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,17 +251,13 @@ public class Robot extends TimedRobot {
|
|||||||
public void teleopInit() {
|
public void teleopInit() {
|
||||||
LOGGER.fine("teleopInit()");
|
LOGGER.fine("teleopInit()");
|
||||||
|
|
||||||
|
|
||||||
Robot.alliance = DriverStation.getAlliance();
|
Robot.alliance = DriverStation.getAlliance();
|
||||||
|
|
||||||
// m_robotContainer.m_robotSwerveDrive.m_gyro.addYaw(-1 * m_robotContainer.m_robotSwerveDrive.m_gyro.getYaw());
|
|
||||||
|
|
||||||
selectedOdo = odoChooser.getSelected();
|
selectedOdo = odoChooser.getSelected();
|
||||||
if (selectedOdo == null) {
|
if (selectedOdo == null) {
|
||||||
selectedOdo = m_robotContainer.getOdometry();
|
selectedOdo = m_robotContainer.getOdometry();
|
||||||
}
|
}
|
||||||
// m_robotContainer.resetOdometry(selectedOdo);
|
m_robotContainer.resetOdometry(selectedOdo);
|
||||||
|
|
||||||
|
|
||||||
// This makes sure that the autonomous stops running when
|
// This makes sure that the autonomous stops running when
|
||||||
// teleop starts running. If you want the autonomous to
|
// teleop starts running. If you want the autonomous to
|
||||||
|
|||||||
@@ -121,10 +121,8 @@ public class Shoot extends CommandBase {
|
|||||||
timerStarted = false;
|
timerStarted = false;
|
||||||
startTime = 0;
|
startTime = 0;
|
||||||
|
|
||||||
// this.turret.gotoMidpoint();
|
this.odoX = 0.9398;//-this.swerve.getOdometry().getY(); // 3.2766
|
||||||
|
this.odoY = -3.2766;//-this.swerve.getOdometry().getX(); // 0.9398
|
||||||
this.odoX = 0;//-m_swerve.getOdometry().getY();
|
|
||||||
this.odoY = -8;//-m_swerve.getOdometry().getX();
|
|
||||||
|
|
||||||
this.distance = Math.hypot(odoX, odoY);
|
this.distance = Math.hypot(odoX, odoY);
|
||||||
|
|
||||||
|
|||||||
@@ -153,8 +153,8 @@ public class Claws extends SubsystemBase {
|
|||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
public void periodic() {
|
public void periodic() {
|
||||||
SmartDashboard.putNumber("Servo Left Pos", m_leftClaw.getRaw());
|
// SmartDashboard.putNumber("Servo Left Pos", m_leftClaw.getRaw());
|
||||||
SmartDashboard.putNumber("Servo Right Pos", m_rightClaw.getRaw());
|
// SmartDashboard.putNumber("Servo Right Pos", m_rightClaw.getRaw());
|
||||||
// if (fullyOpen() || fullyClosed()) {
|
// if (fullyOpen() || fullyClosed()) {
|
||||||
// m_leftClaw.setSpeed(0.0);
|
// m_leftClaw.setSpeed(0.0);
|
||||||
// m_rightClaw.setSpeed(0.0);
|
// m_rightClaw.setSpeed(0.0);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class Hood extends SubsystemBase {
|
|||||||
@Override
|
@Override
|
||||||
public void periodic() {
|
public void periodic() {
|
||||||
// This method will be called once per scheduler run
|
// This method will be called once per scheduler run
|
||||||
SmartDashboard.putNumber("Hood Angle", m_angleEncoder.getPosition());
|
// SmartDashboard.putNumber("Hood Angle", m_angleEncoder.getPosition());
|
||||||
|
|
||||||
// * speed limiting near soft limits. tolerance (distance when ramping starts) is 20 rotations. speed at hard limits is 0.2 (percent output).
|
// * speed limiting near soft limits. tolerance (distance when ramping starts) is 20 rotations. speed at hard limits is 0.2 (percent output).
|
||||||
runVelocityRamping();
|
runVelocityRamping();
|
||||||
|
|||||||
Reference in New Issue
Block a user