Skip to content

Commit

Permalink
添加 InPerTick 的测量程序
Browse files Browse the repository at this point in the history
  • Loading branch information
6-BennyLi-9 committed Aug 21, 2024
1 parent 604b203 commit 2f15a86
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
public final class Params {
/**
* 每Tick机器所旋转的角度
* @see org.firstinspires.ftc.teamcode.RIC_tuning.TurningDegPerTickTest
*/
public static double TurningDegPerTick = 0;
/**
* 每Tick机器所平移的距离
* @see org.firstinspires.ftc.teamcode.RIC_tuning.LateralInchPerTickTest
*/
public static double LateralInchPerTick=0;
/**
* 每Tick机器所前进的距离
* @see org.firstinspires.ftc.teamcode.RIC_tuning.AxialInchPerTickTest
*/
public static double AxialInchPerTick=0;
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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.AutonomousProgramTemplate;

@TeleOp(name = "AxialInchPerTickTest",group = "tune")
public class AxialInchPerTickTest extends AutonomousProgramTemplate {
@Override
public void runOpMode() {
Init(new Pose2d(0,0,0));
robot.client.addData("Ticks","WAITING FOR REQUEST");

if(!WaitForStartRequest())return;

while (!isStopRequested()){
robot.update();
robot.client.changeDate("Ticks",String.valueOf(robot.classic.encoders.LateralTicks));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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.AutonomousProgramTemplate;

@TeleOp(name = "LateralInchPerTickTest",group = "tune")
public class LateralInchPerTickTest extends AutonomousProgramTemplate {
@Override
public void runOpMode() {
Init(new Pose2d(0,0,0));
robot.client.addData("Ticks","WAITING FOR REQUEST");

if(!WaitForStartRequest())return;

while (!isStopRequested()){
robot.update();
robot.client.changeDate("Ticks",String.valueOf(robot.classic.encoders.LateralTicks));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.firstinspires.ftc.teamcode.RIC_tuning;

import com.acmerobotics.roadrunner.Pose2d;

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

public class TurningDegPerTickTest extends AutonomousProgramTemplate {
@Override
public void runOpMode() {
Init(new Pose2d(0,0,0));
robot.client.addData("Ticks","WAITING FOR REQUEST");

if(!WaitForStartRequest())return;

while (!isStopRequested()){
robot.update();
robot.client.changeDate("Ticks",String.valueOf(robot.classic.encoders.TurningTicks));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public void update() {

sensors.update();
servos.update();
encoders.update();
if(RuntimeOption.driverUsingAxisPowerInsteadOfCurrentPower) {
motors.update(sensors.FirstAngle);
}else{
Expand Down

0 comments on commit 2f15a86

Please sign in to comment.