Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

pulling from ftc_app #727

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5aa3b7d
Hope
tazule Oct 15, 2017
4694eaf
bloop
tazule Nov 4, 2017
71dcaea
thought I commit this
tazule Nov 4, 2017
d14aa95
Merge remote-tracking branch 'refs/remotes/ftctechnh/master'
tazule Nov 4, 2017
5a256ad
I think this is what was done at comp
tazule Nov 18, 2017
e040013
edits to teleop
tazule Dec 2, 2017
6512aaa
beep boop
tazule Dec 3, 2017
03ec5b3
changed offset values
tazule Dec 15, 2017
0159e16
tower limits kind of working
tazule Dec 15, 2017
5d16072
bug fix
tazule Dec 15, 2017
cef437a
IT LIVES
tazule Dec 16, 2017
c247bc7
bug fixes
tazule Dec 16, 2017
51dd408
bug fixes
tazule Dec 16, 2017
074e13f
bug fixes
tazule Dec 16, 2017
815bd50
the tribot code
tazule Feb 16, 2018
1d8c8c7
Merge remote-tracking branch 'refs/remotes/ftctechnh/master'
tazule Feb 16, 2018
1afb25d
atan => atan2
tazule Mar 4, 2018
01d1c3a
Computer vision, and tribot bugfixes
tazule Jul 20, 2018
ccbc714
Fixed file path issue
emilyhinds Jul 20, 2018
c4cda77
Relic Computer Vision
emilyhinds Jul 21, 2018
db3cce6
Separated computer vision programs
emilyhinds Jul 22, 2018
9470091
Merge remote-tracking branch 'refs/remotes/ftctechnh/master'
tazule Jul 22, 2018
9be296e
Fixed camel case
emilyhinds Jul 22, 2018
bee953e
set up driving on the vision test
tazule Jul 22, 2018
793e40c
Created Tank Drive file for this year
emilyhinds Sep 9, 2018
24f63e2
vision test
tazule Sep 8, 2018
4045f06
Working on tank drive
emilyhinds Oct 12, 2018
0544c1b
Merge remote-tracking branch 'refs/remotes/ftctechnh/master'
tazule Oct 12, 2018
30db1f4
Update TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Computer…
emilyhinds Oct 12, 2018
e5a122c
added the 2018 climber bot code and started a robotics utilities thin…
tazule Oct 31, 2018
624351b
Merge remote-tracking branch 'refs/remotes/ftctechnh/master'
tazule Oct 31, 2018
a051756
added almost all of Climberbot2018
tazule Nov 2, 2018
7acaaeb
Merge remote-tracking branch 'refs/remotes/ftctechnh/master'
tazule Nov 2, 2018
ccf2609
initial commit
tazule Nov 3, 2018
be48459
Work from Competition
tazule Nov 4, 2018
32361f2
basic tank drive for oragami bot
tazule Nov 12, 2018
c58f809
Update Tank Drive- 11/12
emilyhinds Nov 13, 2018
9034b95
Code Changes for Winch- taking off lift
tazule Dec 1, 2018
449bf52
minor fixes
tazule Dec 9, 2018
8db21cb
Creating AutoStillPhont
emilyhinds Dec 9, 2018
235c128
Autonomous!!!
emilyhinds Dec 12, 2018
df021d4
Added in PID for the elbow and shoulder
tazule Dec 14, 2018
848867f
Merge remote-tracking branch 'origin/master'
tazule Dec 15, 2018
81e530e
last min grind
tazule Dec 15, 2018
3b335b1
Fixing controls
emilyhinds Dec 15, 2018
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
6 changes: 3 additions & 3 deletions TeamCode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// the build definitions, you can place those customizations in this file, but
// please think carefully as to whether such customizations are really necessary
// before doing so.


// Custom definitions may go here

// Include common definitions from above.
apply from: '../build.common.gradle'
dependencies {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* Copyright (c) 2017 FIRST. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted (subject to the limitations in the disclaimer below) provided that
* the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of FIRST nor the names of its contributors may be used to endorse or
* promote products derived from this software without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS
* LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.util.ElapsedTime;

@Autonomous(name="AutoStillPhone", group="AutoStillPhone")

public class AutoStillPhone extends LinearOpMode {

/* Declare OpMode members. */
private DcMotor Left;
private DcMotor Right;
private ElapsedTime runtime = new ElapsedTime();


static final double FORWARD_SPEED = 0.6;
static final double TURN_SPEED = 0.5;

public void runOpMode() {
Left = hardwareMap.get(DcMotor.class, "left");
Right = hardwareMap.get(DcMotor.class, "right");

//@Override
//public void runOpMode() {

/*
* Initialize the drive system variables.
* The init() method of the hardware class does all the work here
*/
// Send telemetry message to signify robot waiting;
telemetry.addData("Status", "Ready to run"); //
telemetry.update();

// Wait for the game to start (driver presses PLAY)
waitForStart();

// Step through each leg of the path, ensuring that the Auto mode has not been stopped along the way

// Step 1: Drive forward for 7 seconds
Right.setPower(-FORWARD_SPEED);
Left.setPower(FORWARD_SPEED);
runtime.reset();
while (opModeIsActive() && (runtime.seconds() < 2)) {
telemetry.addData("Path", "Leg 1: %2.5f S Elapsed", runtime.seconds());
telemetry.update();
}



}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/* Copyright (c) 2017 FIRST. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted (subject to the limitations in the disclaimer below) provided that
* the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of FIRST nor the names of its contributors may be used to endorse or
* promote products derived from this software without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS
* LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.util.ElapsedTime;

@Autonomous(name="AutoTurn", group="AutoTurn")

public class AutoTurn extends LinearOpMode {

/* Declare OpMode members. */
private DcMotor Left;
private DcMotor Right;
private ElapsedTime runtime = new ElapsedTime();


static final double FORWARD_SPEED = 0.6;
static final double TURN_SPEED = 0.5;

public void runOpMode() {
Left = hardwareMap.get(DcMotor.class, "left");
Right = hardwareMap.get(DcMotor.class, "right");

//@Override
//public void runOpMode() {

/*
* Initialize the drive system variables.
* The init() method of the hardware class does all the work here
*/
// Send telemetry message to signify robot waiting;
telemetry.addData("Status", "Ready to run"); //
telemetry.update();

// Wait for the game to start (driver presses PLAY)
waitForStart();

// Step through each leg of the path, ensuring that the Auto mode has not been stopped along the way

// Step 1: Drive forward for .5 seconds
Right.setPower(-FORWARD_SPEED);
Left.setPower(FORWARD_SPEED);
runtime.reset();
while (opModeIsActive() && (runtime.seconds() < 0.8)) {
telemetry.addData("Path", "Leg 1: %2.5f S Elapsed", runtime.seconds());
telemetry.update();
}

// Step 2: Spin right for 1 seconds
Right.setPower(-TURN_SPEED);
Left.setPower(-TURN_SPEED);
runtime.reset();
while (opModeIsActive() && (runtime.seconds() < 0.6)) {
telemetry.addData("Path", "Leg 2: %2.5f S Elapsed", runtime.seconds());
telemetry.update();
}

// Step 3: Drive Forward for 1 Second
Right.setPower(-FORWARD_SPEED);
Left.setPower(FORWARD_SPEED);
runtime.reset();
while (opModeIsActive() && (runtime.seconds() < 3.5)) {
telemetry.addData("Path", "Leg 3: %2.5f S Elapsed", runtime.seconds());
telemetry.update();
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.Servo;

/**
* Created by jxfio on 12/15/2017.
*/
@Autonomous(name = "Blue Left/Red Right", group = "robot2")
public class BlueLeft extends LinearOpMode{
private DcMotor Left;
private DcMotor Right;
private Servo RF;
private Servo LF;
@Override
public void runOpMode() {
RF = hardwareMap.get(Servo.class, "right finger");
LF = hardwareMap.get(Servo.class, "left finger");
Left = hardwareMap.get(DcMotor.class, "left");
Right = hardwareMap.get(DcMotor.class, "right");

waitForStart();
Driver driver = new DriverWithEncoder(Left,Right,2.5, 15.375);
Left.setDirection(DcMotor.Direction.REVERSE);
// run until the end of the match (driver presses STOP)
RF.setPosition(.5);
LF.setPosition(.5);
driver.forward(34,.5);
RF.setPosition(.3);
LF.setPosition(.7);
while (opModeIsActive()) {
driver.forward(-1,.5);
driver.turn(40,.4);
driver.forward(3,.5);
driver.turn(-40,.4);
driver.forward(3,.5);
driver.turn(40,.4);
driver.forward(-1,.5);
driver.turn(-40,.4);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;
import com.qualcomm.robotcore.hardware.Servo;

/**
* Created by jxfio on 12/2/2017.
*/

@Autonomous(name="Blue Right", group="robot2")
public class BlueRight extends LinearOpMode {

// Declare OpMode members.
private DcMotor Left;
private DcMotor Right;
private Servo RF;
private Servo LF;
@Override
public void runOpMode() {
RF = hardwareMap.get(Servo.class, "right finger");
LF = hardwareMap.get(Servo.class, "left finger");
Left = hardwareMap.get(DcMotor.class, "left");
Right = hardwareMap.get(DcMotor.class, "right");

waitForStart();
Driver driver = new DriverWithEncoder(Left,Right,2.5, 15.375);
// run until the end of the match (driver presses STOP)
Left.setDirection(DcMotor.Direction.REVERSE);
//if you need to do keep it the right size comment 33/34 uncomment 35/36/38/39
RF.setPosition(.5);
LF.setPosition(.5);
//RF.setPosition(.3);
//LF.setPosition(.7);
driver.forward(31,.5);
//RF.setPosition(.5);
//LF.setPosition(.5);
driver.turn(90,.2);
RF.setPosition(.3);
LF.setPosition(.7);
driver.forward(15,.5);
while (opModeIsActive()) {
driver.forward(-1,.5);
driver.turn(40,.4);
driver.forward(3,.5);
driver.turn(-40,.4);
driver.forward(3,.5);
driver.turn(40,.4);
driver.forward(-1,.5);
driver.turn(-40,.4);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.Servo;
import com.qualcomm.robotcore.util.Range;

import org.firstinspires.ftc.teamcode.RoboticsUtils.PID;
//import org.firstinspires.ftc.robotcontroller.external.samples.HardwareK9bot;
/**
* Created by emilyhinds on 12/14/18.
*/
@TeleOp(name="CleanTank", group="CleanTank")
public class CleanTank extends LinearOpMode {

// Declare OpMode members.
private DcMotor Left;
private DcMotor Right;
private DcMotor Shoulder;
private DcMotor Elbow;

@Override
public void runOpMode() {
Left = hardwareMap.get(DcMotor.class, "left");
Right = hardwareMap.get(DcMotor.class, "right");
Shoulder = hardwareMap.get(DcMotor.class, "shoulder");
Elbow = hardwareMap.get(DcMotor.class, "elbow");
waitForStart();

while (opModeIsActive()) {
Left.setPower(Range.clip(gamepad1.left_stick_y, -1, 1));
Right.setPower(Range.clip(-gamepad1.right_stick_y, -1, 1));
Shoulder.setPower(.5 * Range.clip(gamepad2.left_stick_y, -1, 1));
Elbow.setPower(.5 * Range.clip(-gamepad2.right_stick_y, -1, 1));

}
}


}

Loading