h
This commit is contained in:
parent
868b380755
commit
028a7d5e04
1 changed files with 162 additions and 157 deletions
|
@ -58,13 +58,6 @@ public class FTC2024WeRobotControl {
|
|||
this.timer = new ElapsedTime();
|
||||
}
|
||||
|
||||
/*
|
||||
* return a metre/sec speed
|
||||
*
|
||||
* @param motor_speed = (optional) double between 0 and 1; motor power; default
|
||||
* to 1
|
||||
*/
|
||||
|
||||
public void boxElv() {
|
||||
Parent.lmelevator.setVelocity(600);
|
||||
Parent.rmelevator.setVelocity(600);
|
||||
|
@ -76,6 +69,12 @@ public class FTC2024WeRobotControl {
|
|||
Parent.rmelevator.setMode(DcMotor.RunMode.RUN_TO_POSITION);
|
||||
Parent.rotation.setMode(DcMotor.RunMode.RUN_TO_POSITION);
|
||||
}
|
||||
/*
|
||||
* return a metre/sec speed
|
||||
*
|
||||
* @param motor_speed = (optional) double between 0 and 1; motor power; default
|
||||
* to 1
|
||||
*/
|
||||
|
||||
public double getSpeedFromMotorSpeed(double motor_speed) {
|
||||
double speed_tour_par_minutes = this.tour_par_minutes * motor_speed;
|
||||
|
@ -116,6 +115,12 @@ public class FTC2024WeRobotControl {
|
|||
Parent.rm.setPower(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* go forward
|
||||
* when only one argument passed:
|
||||
*
|
||||
* @param n_tiles number of tiles
|
||||
*/
|
||||
public void forward(double n_tiles) {
|
||||
this.forward(n_tiles, this.defaultspeed);
|
||||
}
|
||||
|
@ -146,6 +151,7 @@ public class FTC2024WeRobotControl {
|
|||
public void harvest(double motor_speed) {
|
||||
Parent.harvestmotor.setPower(motor_speed);
|
||||
}
|
||||
|
||||
public void harvest() {
|
||||
this.harvest(1.0);
|
||||
}
|
||||
|
@ -169,7 +175,8 @@ public class FTC2024WeRobotControl {
|
|||
if (Math.abs(angle) == 180) {
|
||||
angle = (double) (((double) Math.signum(angle)) * 179.9);
|
||||
}
|
||||
while(Parent.opModeIsActive() && (Math.abs(robotOrientation.getYaw(AngleUnit.DEGREES) - start_yaw) < Math.abs(angle))){
|
||||
while (Parent.opModeIsActive()
|
||||
&& (Math.abs(robotOrientation.getYaw(AngleUnit.DEGREES) - start_yaw) < Math.abs(angle))) {
|
||||
robotOrientation = Parent.imu.getRobotYawPitchRollAngles();
|
||||
double yaw = robotOrientation.getYaw(AngleUnit.DEGREES);
|
||||
Parent.telemetry.addData("Yaw", yaw);
|
||||
|
@ -181,11 +188,9 @@ public class FTC2024WeRobotControl {
|
|||
Parent.lm.setPower(0);
|
||||
Parent.rm.setPower(0);
|
||||
}
|
||||
|
||||
public void rotate(double angle) {
|
||||
this.rotate(angle, this.defaultspeed);
|
||||
}
|
||||
|
||||
public void test_forward_10_and_rotate_20deg(){
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue