Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeleOp for meet one #1

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions FtcRobotController/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.qualcomm.ftcrobotcontroller"
android:versionCode="12"
android:versionName="2.2">
android:versionCode="14"
android:versionName="2.35">

<application
android:allowBackup="true"
android:largeHeap="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class ConceptCompassCalibration extends LinearOpMode {
static final double CAL_TIME_SEC = 20;

@Override
public void runOpMode() throws InterruptedException {
public void runOpMode() {

/* Initialize the drive system variables.
* The init() method of the hardware class does all the work here
Expand Down Expand Up @@ -104,8 +104,7 @@ public void runOpMode() throws InterruptedException {
// run until time expires OR the driver presses STOP;
runtime.reset();
while (opModeIsActive() && (runtime.time() < CAL_TIME_SEC)) {

idle(); // Always call idle() at the bottom of your while(opModeIsActive()) loop
idle();
}

// Stop all motors and turn off claibration
Expand All @@ -123,6 +122,5 @@ public void runOpMode() throws InterruptedException {
else
telemetry.addData("Compass", "Calibrate Passed.");
telemetry.update();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ConceptDIMAsIndicator extends LinearOpMode {
DeviceInterfaceModule dim;

@Override
public void runOpMode() throws InterruptedException {
public void runOpMode() {

// Connect to motor (Assume standard left wheel)
// Change the text in quotes to match any motor name on your robot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class ConceptI2cAddressChange extends LinearOpMode {
DeviceInterfaceModule dim;

@Override
public void runOpMode() throws InterruptedException {
public void runOpMode() {

// set up the hardware devices we are going to use
dim = hardwareMap.deviceInterfaceModule.get("dim");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* This OpMode ramps a single motor speed up and down repeatedly until Stop is pressed.
* The code is structured as a LinearOpMode
*
* This code assumes a DC motor configured with the name "left motor" as is found on a pushbot.
* This code assumes a DC motor configured with the name "left_drive" as is found on a pushbot.
*
* INCREMENT sets how much to increase/decrease the power each cycle
* CYCLE_MS sets the update period.
Expand All @@ -33,11 +33,11 @@ public class ConceptRampMotorSpeed extends LinearOpMode {


@Override
public void runOpMode() throws InterruptedException {
public void runOpMode() {

// Connect to motor (Assume standard left wheel)
// Change the text in quotes to match any motor name on your robot.
motor = hardwareMap.dcMotor.get("left motor");
motor = hardwareMap.dcMotor.get("left_drive");

// Wait for the start button
telemetry.addData(">", "Press Start to run Motors." );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ public static void registerMyOpModes(OpModeManager manager) {
// manager.register("K9 Telop", K9botTeleopTank_Linear.class);

// Sensor Samples
// manager.register("AdaFruit IMU", SensorAdafruitIMU.class);
// manager.register("AdaFruit IMU Cal", SensorAdafruitIMUCalibration.class);
// manager.register("AdaFruit Color", SensorAdafruitRGB.class);
// manager.register("DIM DIO", SensorDIO.class);
// manager.register("HT Color", SensorHTColor.class);
// manager.register("LEGO Light", SensorLEGOLight.class);
// manager.register("LEGO Touch", SensorLEGOTouch.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public class ConceptScanServo extends LinearOpMode {


@Override
public void runOpMode() throws InterruptedException {
public void runOpMode() {

// Connect to servo (Assume PushBot Left Claw)
// Connect to servo (Assume PushBot Left Hand)
// Change the text in quotes to match any servo name on your robot.
servo = hardwareMap.servo.get("left claw");
servo = hardwareMap.servo.get("left_hand");

// Wait for the start button
telemetry.addData(">", "Press Start to scan Servo." );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ are permitted (subject to the limitations in the disclaimer below) provided that
*/
@Autonomous(name = "Concept: Telemetry", group = "Concept")
@Disabled
public class ConceptTelemetry extends LinearOpMode
{
public class ConceptTelemetry extends LinearOpMode {
/** keeps track of the line of the poem which is to be emitted next */
int poemLine = 0;

Expand Down Expand Up @@ -83,9 +82,9 @@ public class ConceptTelemetry extends LinearOpMode
"The teacher did reply.",
"",
""
};
};

@Override public void runOpMode() throws InterruptedException {
@Override public void runOpMode() {

/* we keep track of how long it's been since the OpMode was started, just
* to have some interesting data to show */
Expand All @@ -107,7 +106,7 @@ public class ConceptTelemetry extends LinearOpMode
telemetry.addData("time", "%.1f seconds", opmodeRunTime.seconds());
telemetry.update();
idle();
}
}

// Ok, we've been given the ok to go

Expand All @@ -123,7 +122,7 @@ public class ConceptTelemetry extends LinearOpMode
telemetry.addData("voltage", "%.1f volts", new Func<Double>() {
@Override public Double value() {
return getBatteryVoltage();
}
}
});

// Reset to keep some timing stats for the post-'start' part of the opmode
Expand All @@ -136,7 +135,7 @@ public class ConceptTelemetry extends LinearOpMode
// Emit poetry if it's been a while
if (poemElapsed.seconds() > sPoemInterval) {
emitPoemLine();
}
}

// As an illustration, show some loop timing information
telemetry.addData("loop count", loopCount);
Expand All @@ -158,16 +157,15 @@ public class ConceptTelemetry extends LinearOpMode

/** Update loop info and play nice with the rest of the {@link Thread}s in the system */
loopCount++;
idle();
}
}
}

// emits a line of poetry to the telemetry log
void emitPoemLine() {
telemetry.log().add(poem[poemLine]);
poemLine = (poemLine+1) % poem.length;
poemElapsed.reset();
}
}

// Computes the current battery voltage
double getBatteryVoltage() {
Expand All @@ -176,8 +174,8 @@ void emitPoemLine() {
double voltage = sensor.getVoltage();
if (voltage > 0) {
result = Math.min(result, voltage);
}
}
return result;
}
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class ConceptVuforiaNavigation extends LinearOpMode {
*/
VuforiaLocalizer vuforia;

@Override public void runOpMode() throws InterruptedException {
@Override public void runOpMode() {
/**
* Start up Vuforia, telling it the id of the view that we wish to use as the parent for
* the camera monitor feedback; if no camera monitor feedback is desired, use the parameterless
Expand Down Expand Up @@ -319,7 +319,6 @@ public class ConceptVuforiaNavigation extends LinearOpMode {
telemetry.addData("Pos", "Unknown");
}
telemetry.update();
idle();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* This hardware class assumes the following device names have been configured on the robot:
* Note: All names are lower case and some have single spaces between words.
*
* Motor channel: Left drive motor: "left motor"
* Motor channel: Right drive motor: "right motor"
* Motor channel: Left drive motor: "left_drive"
* Motor channel: Right drive motor: "right_drive"
* Servo channel: Servo to raise/lower arm: "arm"
* Servo channel: Servo to open/close claw: "claw"
*
Expand Down Expand Up @@ -52,8 +52,8 @@ public void init(HardwareMap ahwMap) {
hwMap = ahwMap;

// Define and Initialize Motors
leftMotor = hwMap.dcMotor.get("left motor");
rightMotor = hwMap.dcMotor.get("right motor");
leftMotor = hwMap.dcMotor.get("left_drive");
rightMotor = hwMap.dcMotor.get("right_drive");
leftMotor.setDirection(DcMotor.Direction.REVERSE);

// Set all motors to zero power
Expand All @@ -79,15 +79,19 @@ public void init(HardwareMap ahwMap) {
* The function looks at the elapsed cycle time, and sleeps for the remaining time interval.
*
* @param periodMs Length of wait cycle in mSec.
* @throws InterruptedException
*/
public void waitForTick(long periodMs) throws InterruptedException {
public void waitForTick(long periodMs) {

long remaining = periodMs - (long)period.milliseconds();

// sleep for the remaining portion of the regular cycle period.
if (remaining > 0)
Thread.sleep(remaining);
if (remaining > 0) {
try {
Thread.sleep(remaining);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}

// Reset the cycle clock for the next pass.
period.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,19 @@ public void init(HardwareMap ahwMap) {
* The function looks at the elapsed cycle time, and sleeps for the remaining time interval.
*
* @param periodMs Length of wait cycle in mSec.
* @throws InterruptedException
*/
public void waitForTick(long periodMs) throws InterruptedException {
public void waitForTick(long periodMs) {

long remaining = periodMs - (long)period.milliseconds();

// sleep for the remaining portion of the regular cycle period.
if (remaining > 0)
Thread.sleep(remaining);
if (remaining > 0) {
try {
Thread.sleep(remaining);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}

// Reset the cycle clock for the next pass.
period.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
*
* Matrix Controller has been assigned the name: "matrix controller"
*
* Motor channel: Left drive motor: "left motor"
* Motor channel: Right drive motor: "right motor"
* Motor channel: Manipulator drive motor: "arm motor"
* Servo channel: Servo to open left claw: "left claw"
* Servo channel: Servo to open right claw: "right claw"
* Motor channel: Left drive motor: "left_drive"
* Motor channel: Right drive motor: "right_drive"
* Motor channel: Manipulator drive motor: "left_arm"
* Servo channel: Servo to open left claw: "left_hand"
* Servo channel: Servo to open right claw: "right_hand"
*
* In addition, the Matrix Controller has been assigned the name: "matrix controller"
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class K9botTeleopTank_Linear extends LinearOpMode {
final double ARM_SPEED = 0.01 ; // sets rate to move servo

@Override
public void runOpMode() throws InterruptedException {
public void runOpMode() {
double left;
double right;

Expand Down Expand Up @@ -118,7 +118,6 @@ else if (gamepad1.b)

// Pause for metronome tick. 40 mS each cycle = update 25 times a second.
robot.waitForTick(40);
idle(); // Always call idle() at the bottom of your while(opModeIsActive()) loop
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class PushbotAutoDriveByEncoder_Linear extends LinearOpMode {
static final double TURN_SPEED = 0.5;

@Override
public void runOpMode() throws InterruptedException {
public void runOpMode() {

/*
* Initialize the drive system variables.
Expand Down Expand Up @@ -134,7 +134,7 @@ public void runOpMode() throws InterruptedException {
*/
public void encoderDrive(double speed,
double leftInches, double rightInches,
double timeoutS) throws InterruptedException {
double timeoutS) {
int newLeftTarget;
int newRightTarget;

Expand Down Expand Up @@ -167,9 +167,6 @@ public void encoderDrive(double speed,
robot.leftMotor.getCurrentPosition(),
robot.rightMotor.getCurrentPosition());
telemetry.update();

// Allow time for other processes to run.
idle();
}

// Stop all motion;
Expand Down
Loading