Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
1198159 committed Oct 3, 2020
1 parent dd1a579 commit d6887ed
Show file tree
Hide file tree
Showing 54 changed files with 270 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.technototes.library";
public static final String LIBRARY_PACKAGE_NAME = "com.technototes.library";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = -1;
public static final String VERSION_NAME = "";
}
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":-1,"enabled":true,"outputFile":"RobotLibrary-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.technototes.library","split":""}}]
{
"version": 1,
"applicationId": "com.technototes.library",
"variantType": "LIBRARY",
"elements": [
{
"outputType": {
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS"
},
"apkData": {
"type": "MAIN",
"splits": [],
"versionCode": -1,
"outputFile": "RobotLibrary-debug.aar",
"fullName": "debug",
"baseName": "debug",
"dirName": ""
},
"path": "AndroidManifest.xml",
"properties": {
"packageId": "com.technototes.library",
"split": ""
}
}
]
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#Sun Sep 27 16:10:54 PDT 2020
#Sat Oct 03 11:46:02 PDT 2020
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
10
11 <uses-sdk
12 android:minSdkVersion="24"
12-->C:\Users\Alex Stedman\StudioProjects\FtcSamples-master\RobotLibrary\src\main\AndroidManifest.xml
13 android:targetSdkVersion="26" />
13-->C:\Users\Alex Stedman\StudioProjects\FtcSamples-master\RobotLibrary\src\main\AndroidManifest.xml
12-->C:\Users\Alex Stedman\StudioProjects\TechnoLib\RobotLibrary\src\main\AndroidManifest.xml
13 android:targetSdkVersion="28" />
13-->C:\Users\Alex Stedman\StudioProjects\TechnoLib\RobotLibrary\src\main\AndroidManifest.xml
14
15 <application />
15-->C:\Users\Alex Stedman\StudioProjects\FtcSamples-master\RobotLibrary\src\main\AndroidManifest.xml:10:5-20
15-->C:\Users\Alex Stedman\StudioProjects\TechnoLib\RobotLibrary\src\main\AndroidManifest.xml:10:5-20
16
17</manifest>
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":-1,"enabled":true,"outputFile":"RobotLibrary-debug.aar","fullName":"debug","baseName":"debug"},"path":"..\\..\\library_manifest\\debug\\AndroidManifest.xml","properties":{"packageId":"com.technototes.library","split":""}}]
{
"version": 1,
"applicationId": "com.technototes.library",
"variantType": "LIBRARY",
"elements": [
{
"outputType": {
"type": "MERGED_MANIFESTS"
},
"apkData": {
"type": "MAIN",
"splits": [],
"versionCode": -1,
"outputFile": "RobotLibrary-debug.aar",
"fullName": "debug",
"baseName": "debug",
"dirName": ""
},
"path": "../../library_manifest/debug/AndroidManifest.xml",
"properties": {
"packageId": "com.technototes.library",
"split": ""
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void run() {
commandState.state = currentChoice.isFinished() ? State.EXECUTED : State.INITIALIZED;
return;
case EXECUTED:
currentChoice.end();
currentChoice.end(false);
commandState.state = State.RESET;
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.technototes.library.measurement.unit;

public class DistanceUnit extends Unit<DistanceUnit.DistanceUnitType> {

public enum DistanceUnitType {
CENTIMETERS(100), METERS(1), INCHES(39.37008), FEET(3.28084);
public double relation;

DistanceUnitType(double d) {
relation = d;
}
}
public DistanceUnit(double v, DistanceUnitType t){
super(v, t);
}

@Override
public double to(DistanceUnitType type) {
return get()*type.relation;
}

@Override
public double get() {
return (value/((DistanceUnitType)unitType).relation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.technototes.library.measurement.unit;

public class RotationUnit extends Unit<RotationUnit.RotationUnitType> {

public enum RotationUnitType {
RADIANS(2 * Math.PI), DEGREES(360), ROTATIONS(1);
public double relation;

RotationUnitType(double d) {
relation = d;
}
}
public RotationUnit(double v, RotationUnitType t){
super(v, t);
}

@Override
public double to(RotationUnitType type) {
return get()*type.relation;
}

@Override
public double get() {
return (value/((RotationUnitType)unitType).relation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.technototes.library.measurement.unit;

public class TimeUnit extends Unit<TimeUnit.TimeUnitType> {

public enum TimeUnitType {
SECONDS(1), MILLISECONDS(1000), MINUTES(60), HOUR(3600);
public double relation;

TimeUnitType(double d) {
relation = d;
}
}
public TimeUnit(double v, TimeUnitType t){
super(v, t);
}

@Override
public double to(TimeUnitType type) {
return get()*type.relation;
}

@Override
public double get() {
return (value/((TimeUnitType)unitType).relation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.technototes.library.measurement.unit;

public abstract class Unit<D extends Enum<D>> {
public Enum<D> unitType;
public double value;
public Unit(double v, Enum<D> e){
unitType = e;
value = v;
}
public abstract double to(D d);
public abstract double get();

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@ public OIBase(CommandGamepad g1, CommandGamepad g2) {
driverGamepad = g1;
codriverGamepad = g2;
}

public abstract void setDriverControls();

public abstract void setCodriverControls();
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public OI(CommandGamepad g1, CommandGamepad g2, Robot r) {
setCodriverControls();
}

@Override
public void setDriverControls() {
driverGamepad.dpad.down.toggleWhenActivated(new InstantCommand(() -> robot.drivebaseSubsystem.setDriveSpeed((DrivebaseSubsystem.Speed.TURBO))))
.toggleWhenDeactivated(new InstantCommand(() -> robot.drivebaseSubsystem.setDriveSpeed(DrivebaseSubsystem.Speed.NORMAL)));
Expand All @@ -36,7 +35,6 @@ public void setDriverControls() {
.whenDeactivated(new InstantCommand(() -> robot.capstonePusherSubsystem.setSpeed(0)));
}

@Override
public void setCodriverControls() {
driverGamepad.rtrigger.whenActivated(new InstantCommand(() -> robot.clawSubsystem.setPosition(1)));
driverGamepad.ltrigger.whenActivated(new InstantCommand(() -> robot.clawSubsystem.setPosition(0)));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.firstinspires.ftc.teamcode.newcode.opmodes;

import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.technototes.library.logging.Log;
import com.technototes.library.logging.Loggable;
Expand All @@ -8,7 +9,7 @@
import org.firstinspires.ftc.robotcore.external.Telemetry;
import org.firstinspires.ftc.teamcode.newcode.OI;
import org.firstinspires.ftc.teamcode.newcode.Robot;

@Disabled
@TeleOp(name = "test yay poggers")
public class TestOpMode extends TeleOpCommandOpMode implements Loggable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.firstinspires.ftc.teamcode.simple;

import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.technototes.library.command.CommandScheduler;
Expand All @@ -8,7 +9,7 @@
import com.technototes.library.structure.TeleOpCommandOpMode;
import com.technototes.library.subsystem.simple.SimpleServoSubsystem;
import com.technototes.library.subsystem.simple.SimpleTankDrivebaseSubsystem;

@Disabled
@TeleOp(name = "Simple Teleop")
public class SimpleOpMode extends TeleOpCommandOpMode{
public SimpleTankDrivebaseSubsystem drivebaseSubsystem;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.firstinspires.ftc.teamcode.strafer;

import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.HardwareMap;
import com.technototes.library.hardware.motor.Motor;
import com.technototes.library.hardware.sensor.IMU;
import com.technototes.library.logging.Loggable;
import com.technototes.library.structure.HardwareBase;

public class Hardware extends HardwareBase implements Loggable {
//drive motors
public Motor<DcMotor> flMotor;
public Motor<DcMotor> frMotor;
public Motor<DcMotor> rlMotor;
public Motor<DcMotor> rrMotor;

public IMU imu;

public Hardware(HardwareMap hmap){
flMotor = new Motor<DcMotor>("fl");
frMotor = new Motor<DcMotor>("fr");
rlMotor = new Motor<DcMotor>("rl");
rrMotor = new Motor<DcMotor>("rr");

imu = new IMU("imu1");

}

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

import com.technototes.library.command.CommandScheduler;
import com.technototes.library.command.simple.MecanumDriveCommand;
import com.technototes.library.control.gamepad.CommandGamepad;
import com.technototes.library.structure.OIBase;
import com.technototes.library.subsystem.drivebase.DrivebaseSubsystem;

public class OI extends OIBase {

public Robot robot;

public OI(CommandGamepad g1, CommandGamepad g2, Robot r) {
super(g1, g2);
robot = r;
setDriverControls();
}

public void setDriverControls() {
CommandScheduler.getRunInstance().schedule(new MecanumDriveCommand(
robot.drivebaseSubsystem, driverGamepad.leftStick, driverGamepad.rightStick).setFieldCentric(robot.hardware.imu).addRequirements(robot.drivebaseSubsystem));
driverGamepad.y.toggleWhenActivated(() -> robot.drivebaseSubsystem.setDriveSpeed(DrivebaseSubsystem.Speed.TURBO))
.toggleWhenDeactivated(() -> robot.drivebaseSubsystem.setDriveSpeed(DrivebaseSubsystem.Speed.TURBO));
}

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

import com.qualcomm.robotcore.hardware.HardwareMap;
import com.technototes.library.logging.Loggable;
import com.technototes.library.structure.RobotBase;

import org.firstinspires.ftc.robotcore.external.Telemetry;
import org.firstinspires.ftc.teamcode.newcode.Hardware;
import org.firstinspires.ftc.teamcode.strafer.subsystems.DrivebaseSubsystem;

public class Robot extends RobotBase implements Loggable {

public Hardware hardware;

public DrivebaseSubsystem drivebaseSubsystem;


public Robot(HardwareMap h, Telemetry t){
hardware = new Hardware(h);
drivebaseSubsystem = new DrivebaseSubsystem(hardware.flMotor, hardware.frMotor, hardware.rlMotor, hardware.rrMotor);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.firstinspires.ftc.teamcode.strafer.opmodes;

import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.technototes.library.command.simple.MecanumDriveCommand;
import com.technototes.library.logging.Loggable;
import com.technototes.library.structure.TeleOpCommandOpMode;

import org.firstinspires.ftc.teamcode.strafer.OI;
import org.firstinspires.ftc.teamcode.strafer.Robot;


@TeleOp(name = "Strafer TeleOp")
public class StraferTeleOp extends TeleOpCommandOpMode implements Loggable {
public OI oi;

public Robot robot;

@Override
public void beginInit() {
robot = new Robot(hardwareMap, telemetry);
oi = new OI(driverGamepad, codriverGamepad, robot);
}


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

import com.qualcomm.robotcore.hardware.DcMotor;
import com.technototes.library.hardware.motor.Motor;
import com.technototes.library.subsystem.drivebase.MecanumDrivebaseSubsystem;

public class DrivebaseSubsystem extends MecanumDrivebaseSubsystem {
public DrivebaseSubsystem(Motor flMotor, Motor frMotor, Motor rlMotor, Motor rrMotor) {
super(flMotor, frMotor, rlMotor, rrMotor);
}
}

0 comments on commit d6887ed

Please sign in to comment.