Skip to content

Commit

Permalink
测试
Browse files Browse the repository at this point in the history
  • Loading branch information
6-BennyLi-9 committed Aug 23, 2024
1 parent 17f5b3e commit 38018c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.firstinspires.ftc.teamcode.Hardwares.basic;

import static org.firstinspires.ftc.teamcode.Params.*;
import static org.firstinspires.ftc.teamcode.Params.AxialPosition;
import static org.firstinspires.ftc.teamcode.Params.LateralPosition;

import androidx.annotation.NonNull;

Expand Down Expand Up @@ -60,7 +61,11 @@ public void update(){

AxialTicks=(left.position+right.position)/2.0;
TurningTicks=(right.position-left.position)/2.0;
LateralTicks=middle.position-TurningTicks*vI;
if(AxialPosition==0){
LateralTicks=middle.position;
}else{
LateralTicks=middle.position-TurningTicks*vI;
}
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ public final class Params {
* 每Tick机器所旋转的角度
* @see org.firstinspires.ftc.teamcode.RIC_tuning.TurningDegPerTickTest
*/
public static double TurningDegPerTick = 0;
public static double TurningDegPerTick = 0.01339983622422392615201369761;
/**
* 每Tick机器所平移的距离
* @see org.firstinspires.ftc.teamcode.RIC_tuning.LateralInchPerTickTest
*/
public static double LateralInchPerTick=0;
public static double LateralInchPerTick=0.001135933358576296857251041272;
/**
* 每Tick机器所前进的距离
* @see org.firstinspires.ftc.teamcode.RIC_tuning.AxialInchPerTickTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public void whileActivating() {
robot.update();
drive.update();
robot.client.changeDate("POSITION",drive.localizer.getCurrentPose().toString());
robot.client.changeDate("X",drive.localizer.getCurrentPose().position.x);
robot.client.changeDate("Y",drive.localizer.getCurrentPose().position.y);
robot.client.changeDate("HEADING",Math.toDegrees(drive.localizer.getCurrentPose().heading.toDouble()));

robot.operateThroughGamePad(gamepad1,gamepad2);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.firstinspires.ftc.teamcode.RIC_tuning;

import com.acmerobotics.roadrunner.Pose2d;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;

import org.firstinspires.ftc.teamcode.utils.Annotation.TuningOpModes;
import org.firstinspires.ftc.teamcode.utils.AutonomousProgramTemplate;

@TeleOp(name = "TurningDegPerTickTest",group = "tune")
@TuningOpModes
public class TurningDegPerTickTest extends AutonomousProgramTemplate {
@Override
Expand Down

0 comments on commit 38018c1

Please sign in to comment.