add some stuff
This commit is contained in:
parent
be6237fb94
commit
13a84719ce
3 changed files with 52 additions and 8 deletions
|
@ -1,2 +1,5 @@
|
||||||
# ftc2024-robotcode
|
# The 2024 [FIRST®](https://firstinspires.org) Tech Challenge robot competition WeRobot code
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
Work only with Rev Robotics Control Hub designed for [FIRST®](https://firstinspires.org) Tech Challenge competitions
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import com.qualcomm.robotcore.util.ElapsedTime;
|
||||||
@Autonomous
|
@Autonomous
|
||||||
|
|
||||||
public class ftc2024_autonome_api extends LinearOpMode {
|
public class ftc2024_autonome_api extends LinearOpMode {
|
||||||
|
public String autonomous_mode;
|
||||||
public DcMotor lm;
|
public DcMotor lm;
|
||||||
public DcMotor rm;
|
public DcMotor rm;
|
||||||
public DcMotor harvestmotor;
|
public DcMotor harvestmotor;
|
||||||
|
@ -51,12 +52,53 @@ public class ftc2024_autonome_api extends LinearOpMode {
|
||||||
robotOrientation = imu.getYawPitchRollAngles();
|
robotOrientation = imu.getYawPitchRollAngles();
|
||||||
|
|
||||||
if(opModeIsRunning()){
|
if(opModeIsRunning()){
|
||||||
robot.forward(0.5);
|
/*
|
||||||
robot.rotate(-90.0);
|
* autonomous_mode differents possibles values respect the next scheme:
|
||||||
robot.forward(1.5);
|
* team_color_shortcode + start_line_index + direct_or_no
|
||||||
robot.harvest(-1);
|
*
|
||||||
robot.backward(1);
|
* team_color_shortcode = "b" for blue & "r" for red
|
||||||
robot.harvest(0);
|
* start_line_index = 4 or 2 see competition manual appendix B Tile location plan
|
||||||
|
* direct_or_no = "d" to direct go to pixel deliver zone or "n" to harvest pixels before to go in deliver zone
|
||||||
|
*
|
||||||
|
* default is "b4d"
|
||||||
|
*/
|
||||||
|
switch (autonomous_mode){
|
||||||
|
default:
|
||||||
|
robot.forward(0.5);
|
||||||
|
robot.rotate(-90.0);
|
||||||
|
robot.forward(1.5);
|
||||||
|
robot.harvest(-1);
|
||||||
|
robot.backward(1);
|
||||||
|
robot.harvest(0);
|
||||||
|
break;
|
||||||
|
case ("b2d"):
|
||||||
|
robot.forward(0.5);
|
||||||
|
robot.rotate(-90.0);
|
||||||
|
robot.forward(2.5);
|
||||||
|
robot.harvest(-1);
|
||||||
|
robot.backward(1);
|
||||||
|
robot.harvest(0);
|
||||||
|
break;
|
||||||
|
case ("r4d"):
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ("r2d"):
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ("b4n"):
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ("b2n"):
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ("r4n"):
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ("r2n"):
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
1
hello
1
hello
|
@ -1 +0,0 @@
|
||||||
helloworld
|
|
Loading…
Reference in a new issue