-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
554 additions
and
351 deletions.
There are no files selected for viewing
47 changes: 2 additions & 45 deletions
47
.../src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,2 @@ | ||
|
||
## Caution | ||
No Team-specific code should be placed or modified in this ``.../samples`` folder. | ||
|
||
Samples should be Copied from here, and then Pasted into the team's | ||
[/TeamCode/src/main/java/org/firstinspires/ftc/teamcode](../../../../../../../../../../TeamCode/src/main/java/org/firstinspires/ftc/teamcode) | ||
folder, using the Android Studio cut and paste commands. This automatically changes all file and | ||
class names to be consistent. From there, the sample can be modified to suit the team's needs. | ||
|
||
For more detailed instructions see the /teamcode readme. | ||
|
||
### Naming of Samples | ||
|
||
To gain a better understanding of how the samples are organized, and how to interpret the | ||
naming system, it will help to understand the conventions that were used during their creation. | ||
|
||
These conventions are described (in detail) in the sample_conventions.md file in this folder. | ||
|
||
To summarize: A range of different samples classes will reside in the java/external/samples. | ||
The class names will follow a naming convention which indicates the purpose of each class. | ||
The prefix of the name will be one of the following: | ||
|
||
Basic: This is a minimally functional OpMode used to illustrate the skeleton/structure | ||
of a particular style of OpMode. These are bare bones examples. | ||
|
||
Sensor: This is a Sample OpMode that shows how to use a specific sensor. | ||
It is not intended to drive a functioning robot, it is simply showing the minimal code | ||
required to read and display the sensor values. | ||
|
||
Robot: This is a Sample OpMode that assumes a simple two-motor (differential) drive base. | ||
It may be used to provide a common baseline driving OpMode, or | ||
to demonstrate how a particular sensor or concept can be used to navigate. | ||
|
||
Concept: This is a sample OpMode that illustrates performing a specific function or concept. | ||
These may be complex, but their operation should be explained clearly in the comments, | ||
or the comments should reference an external doc, guide or tutorial. | ||
Each OpMode should try to only demonstrate a single concept so they are easy to | ||
locate based on their name. These OpModes may not produce a drivable robot. | ||
|
||
After the prefix, other conventions will apply: | ||
|
||
* Sensor class names are constructed as: Sensor - Company - Type | ||
* Robot class names are constructed as: Robot - Mode - Action - OpModetype | ||
* Concept class names are constructed as: Concept - Topic - OpModetype | ||
|
||
# external.samples | ||
> this is where the sdk's default sample projects are held. |
108 changes: 0 additions & 108 deletions
108
...va/org/firstinspires/ftc/robotcontroller/external/samples/sample_conventions.md
This file was deleted.
Oops, something went wrong.
Binary file modified
BIN
+175 KB
(3900%)
FtcRobotController/src/main/res/drawable-xhdpi/icon_robotcontroller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 0 additions & 45 deletions
45
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RedBoardSide.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...rstinspires/ftc/teamcode/BlueFarSide.java → .../ftc/teamcode/autonomous/BlueFarSide.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/RedBoardSide.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package org.firstinspires.ftc.teamcode.autonomous; | ||
|
||
import static org.firstinspires.ftc.teamcode.operations.inputs.AprilTag.initAprilTag; | ||
import static org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.ConfigureMotors.bl; | ||
import static org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.ConfigureMotors.br; | ||
import static org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.ConfigureMotors.fl; | ||
import static org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.ConfigureMotors.forwardMotors; | ||
import static org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.ConfigureMotors.fr; | ||
import static org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.ConfigureMotors.mapMotors; | ||
import static org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.hardcoredMovements.EachMotorSet.drive; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; | ||
|
||
import org.firstinspires.ftc.teamcode.operations.TargetOperations; | ||
import org.firstinspires.ftc.teamcode.operations.Wheels; | ||
import org.firstinspires.ftc.teamcode.operations.outputs.motors.drive.Encoders; | ||
|
||
@Autonomous(name="Red, Board Side", group="auto") | ||
public class RedBoardSide extends TargetOperations { | ||
@Override | ||
public void runOpMode() { | ||
|
||
runInit(); | ||
while(opModeInInit()){runInitLoop();} | ||
waitForStart(); | ||
runStart(); | ||
if (isStopRequested()){runStop();} | ||
while (opModeIsActive()) {runLoop();} | ||
} | ||
|
||
@Override | ||
public void runInit() { | ||
//arm = hardwareMap.dcMotor.get("arm"); | ||
mapMotors(hardwareMap, Wheels.FRONT_LEFT.abbreviation(),Wheels.FRONT_RIGHT.abbreviation(),Wheels.BACK_LEFT.abbreviation(),Wheels.BACK_RIGHT.abbreviation()); | ||
forwardMotors(true,false,true,false); | ||
// ^ set motor directions | ||
initAprilTag(hardwareMap, "Webcam 1"); | ||
Encoders.clear(); | ||
|
||
} | ||
|
||
@Override | ||
public void runInitLoop() { | ||
|
||
} | ||
|
||
@Override | ||
public void runStart() { | ||
// must set up methods for this later | ||
Encoders.clear(); | ||
Encoders.target(-1000,-1000,-1000,-1000); // - must be to go forward | ||
Encoders.go(); | ||
drive(500,500,500,500); | ||
sleep(500); // wait this makes sure that the robot does not strafe when it should not | ||
|
||
Encoders.clear(); | ||
Encoders.target(-1800,1800,1800,-1800); // - must be to go forward | ||
Encoders.go(); | ||
drive(-500,500,500,-500); | ||
} | ||
|
||
@Override | ||
public void runLoop() { | ||
telemetry.addData("position FL ", fl.getCurrentPosition()); | ||
telemetry.addData("position FR ", fr.getCurrentPosition()); | ||
telemetry.addData("position BL ", bl.getCurrentPosition()); | ||
telemetry.addData("position BR ", br.getCurrentPosition()); | ||
telemetry.update(); | ||
} | ||
|
||
@Override | ||
public void runStop() { | ||
|
||
} | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
...irstinspires/ftc/teamcode/RedFarSide.java → ...s/ftc/teamcode/autonomous/RedFarSide.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.