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

Pull to kotlin #1

Open
wants to merge 171 commits into
base: Kotlin
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
d39ebad
lol didn't work... added isRunning toggle
mecaneer23 Dec 7, 2022
f5a0671
update gradle version and fix errors
mecaneer23 Dec 7, 2022
df6186e
update gradle version, move files into subdirectory, change grabber p…
mecaneer23 Dec 8, 2022
57b70e3
Merge branch 'Kotlin' into main
mecaneer23 Dec 8, 2022
3f544cf
fix stuff theoretically
mecaneer23 Dec 8, 2022
9c8b80f
Merge branch 'main' of https://github.com/Vertigo18523/Post-Bot2022
mecaneer23 Dec 8, 2022
f3cb724
Revert "update gradle version, move files into subdirectory, change g…
mecaneer23 Dec 8, 2022
99bd6da
fix revert
mecaneer23 Dec 8, 2022
a43f98f
I really hope everything is fixed now
mecaneer23 Dec 8, 2022
1ba4c09
Gabi changes
EliFinkel Dec 8, 2022
cb425d0
remove TestAuto
mecaneer23 Dec 8, 2022
a608f57
make grabber open on init, add subroutines to gamepad 1
mecaneer23 Dec 8, 2022
f00f541
flip grabber direction
mecaneer23 Dec 8, 2022
6532bc8
fix camera orientation
mecaneer23 Dec 8, 2022
f2f6852
TELEOP IS BASICALLY DONE!!!!!!!!!!
mecaneer23 Dec 9, 2022
7080536
add pickup height
mecaneer23 Dec 9, 2022
4b10cb5
tune camera (wip)
mecaneer23 Dec 9, 2022
5560e40
add buttons to GamepadListener
mecaneer23 Dec 9, 2022
fadd4cb
add toggle
mecaneer23 Dec 9, 2022
2bdaf6b
add slowmodes and subroutines
mecaneer23 Dec 9, 2022
147b567
edit colors to real world data
mecaneer23 Dec 9, 2022
adb4395
new hardware
mecaneer23 Dec 9, 2022
c4e59be
less strafe
mecaneer23 Dec 9, 2022
5e691b2
flip open and closed
mecaneer23 Dec 9, 2022
330d0da
make grabber work again? Still needs some tuning
mecaneer23 Dec 10, 2022
59b6ec6
competition ready sorta
mecaneer23 Dec 10, 2022
234438d
disable unused buttons
mecaneer23 Dec 10, 2022
fd5c4f7
teleop is actually competition ready
mecaneer23 Dec 10, 2022
3c84c6e
AUTO WORKKSKSKKSSKKS
mecaneer23 Dec 10, 2022
795028f
remove unnecessary comments
mecaneer23 Dec 10, 2022
f154592
switch motor direction
mecaneer23 Dec 10, 2022
b803454
use old mecanum drive
mecaneer23 Dec 10, 2022
9eacaf3
should use new mecanum drive
mecaneer23 Dec 10, 2022
9b76bb5
in comp - doesn't work but also doesn't really matter
mecaneer23 Dec 10, 2022
6290dda
update motor rpm
mecaneer23 Jan 10, 2023
0596c35
ticks should be relative to motor ppr
mecaneer23 Jan 10, 2023
1a55c40
add raw data telemetry, adjust arm speeds
mecaneer23 Jan 12, 2023
33d421e
copy in files from m-cubed
mecaneer23 Jan 13, 2023
9ac8843
try a whole bunch of stuff... nothing works but last year's code has …
mecaneer23 Jan 13, 2023
301f7ca
add side stack preset location
mecaneer23 Jan 13, 2023
2c4c19f
fix sideStack height
mecaneer23 Jan 13, 2023
cd813ff
add dashboard
mecaneer23 Jan 13, 2023
f8c33d6
add dashboard
mecaneer23 Jan 13, 2023
b34a6b7
add calibration files and dependencies
mecaneer23 Jan 14, 2023
60b77b1
remove redundant file
mecaneer23 Jan 14, 2023
43f9ed3
fix directions
mecaneer23 Jan 14, 2023
d410471
theoretical plan for recording teleop into auto using tick counters
mecaneer23 Jan 14, 2023
725dbb5
add other files from FTCLib
mecaneer23 Jan 14, 2023
dc5e71f
create yet another wheelbase file
mecaneer23 Jan 14, 2023
90a907d
add odoMecanum to bot
mecaneer23 Jan 14, 2023
61dcd95
I keep trying stuff and nothing is working... how hard is it to go fo…
mecaneer23 Jan 14, 2023
a02d70e
add calibration and dependencies
mecaneer23 Jan 14, 2023
041bd55
incomplete attempt to implement odometry and pure pursuit
mecaneer23 Jan 14, 2023
dd54c01
remove unnecessary variable assignment
mecaneer23 Jan 14, 2023
f3aeebe
switch back to PIDMecanum
mecaneer23 Jan 14, 2023
7832062
add RoadRunner
mecaneer23 Jan 14, 2023
c80fa07
rename roadrunner files
mecaneer23 Jan 14, 2023
121b0f8
fix imports
mecaneer23 Jan 14, 2023
3c7c21c
update roadrunner drive constants
mecaneer23 Jan 14, 2023
4ed56b9
update roadrunner drive constants
mecaneer23 Jan 14, 2023
a9a6ca5
start tuning roadrunner
mecaneer23 Jan 14, 2023
c0be407
make arm descent smoother
mecaneer23 Jan 15, 2023
418bd67
tune feedforward
mecaneer23 Jan 15, 2023
cf1ecc9
tuning should be done (at least on the practice field)
mecaneer23 Jan 15, 2023
70b6913
rename and disable old autos
mecaneer23 Jan 15, 2023
38429e7
rename
mecaneer23 Jan 15, 2023
fc72b4d
WOOOOOOO odo park auto is done
mecaneer23 Jan 15, 2023
90363aa
add FieldCentric teleop
mecaneer23 Jan 15, 2023
eecf838
add autos... they don't work yet
mecaneer23 Jan 15, 2023
90e206f
bulk out... make blocking (hasn't been tested yet)
mecaneer23 Jan 15, 2023
097ed86
camera: swap left and right colors **MAKE SURE SIGNAL SLEEVE HAS BEEN…
mecaneer23 Jan 15, 2023
9c63c22
Arm can’t be lowered to zero position if grabber is closed
mecaneer23 Jan 16, 2023
cc29e72
delete old autos and clarify names of current ones
mecaneer23 Jan 18, 2023
cd39cf7
Merge remote-tracking branch 'origin/main'
mecaneer23 Jan 18, 2023
fcdf07e
add link
mecaneer23 Jan 18, 2023
fd11de3
add rectangular drive - works better for joystick control but weird w…
mecaneer23 Jan 21, 2023
21c2e55
camera.requestStart returns the camera object
mecaneer23 Jan 21, 2023
6fc50aa
add LineUp opMode - allows for using dashboard to line up before auto
mecaneer23 Jan 21, 2023
43858af
update to 8.1.1
mecaneer23 Jan 21, 2023
e30b7eb
add driver control
mecaneer23 Jan 21, 2023
13bbde1
add trajectoryBuilder with custom speed and acceleration
mecaneer23 Jan 21, 2023
5f9a2ab
Working on right delivery auto, reduced speed and made minor changes …
SofiaAugusta Jan 21, 2023
27ab743
changes to right auto: adjusting movement to the high junction
SofiaAugusta Jan 22, 2023
75b3e00
add meep meep, this path doesn't work
mecaneer23 Jan 22, 2023
232ef7f
finished right side auto.
SofiaAugusta Jan 22, 2023
237ae99
Created an alternate controller config option for arm controls. (call…
SofiaAugusta Jan 23, 2023
eb141dc
Theoretically, left side auto should work. I just used opposite the y…
SofiaAugusta Jan 23, 2023
f36b565
i may or may not have forgotten a bracket...
SofiaAugusta Jan 23, 2023
d3c76be
finished right and left side autos :)
SofiaAugusta Jan 24, 2023
8e7a447
Merge remote-tracking branch 'origin/main'
mecaneer23 Jan 25, 2023
a1b3f92
Swap left and right park
mecaneer23 Jan 26, 2023
86943fd
revert meep meep changes
mecaneer23 Jan 26, 2023
0cd73eb
implement PID unsuccessfully
mecaneer23 Jan 27, 2023
da30da8
manual fix for arm getting stuck
mecaneer23 Jan 29, 2023
429c7ec
added some new auto classes and changed camera sensing location
SofiaAugusta Jan 31, 2023
9b0862e
Merge remote-tracking branch 'origin/main'
SofiaAugusta Jan 31, 2023
d0d5702
99.9% sure this code will have some errors and/or is not the most eff…
SofiaAugusta Feb 4, 2023
938c514
Made a minor change to the loop in right auto-- this code likely stil…
SofiaAugusta Feb 4, 2023
7bb1947
add ServoTester (from a while ago - I forgot to commit)
mecaneer23 Feb 5, 2023
2e2ce4e
Merge remote-tracking branch 'origin/main'
mecaneer23 Feb 5, 2023
d0b8877
modify for loop and if statement to reduce redundancy
mecaneer23 Feb 6, 2023
dd3c925
multiply by pulses per rev to add units to otherwise arbitrary value
mecaneer23 Feb 8, 2023
781bdfc
doesn't quite work yet but general idea is there
mecaneer23 Feb 8, 2023
45c6dc4
still not quite there... weird amounts of error... maybe due to setup…
mecaneer23 Feb 8, 2023
9799d3e
auto changes
SofiaAugusta Feb 8, 2023
9d11a0b
calibrate slide pid
mecaneer23 Feb 8, 2023
57c4014
never used - should be written in a way that extends MainOp
mecaneer23 Feb 9, 2023
c219bc9
make arm go brrrrrrrrrrr
mecaneer23 Feb 9, 2023
5c8aba0
delete old files and clean up
mecaneer23 Feb 9, 2023
6f4ee60
Merge remote-tracking branch 'origin/main'
mecaneer23 Feb 9, 2023
f3b7c0d
make it go more slowly on the way down
mecaneer23 Feb 9, 2023
b1a4959
add color sensor stuff - might need a second one or not at all in auto
mecaneer23 Feb 9, 2023
d888f73
change poses to vectors
mecaneer23 Feb 9, 2023
9600e12
move arm and grabber calls to displacement markers
mecaneer23 Feb 9, 2023
85dcef2
build slidescalibration into arm file - still needs to be tuned
mecaneer23 Feb 15, 2023
f8b8841
telemetry outputs power
mecaneer23 Feb 15, 2023
cb219aa
add rotation calibrator
mecaneer23 Feb 15, 2023
d951c0f
updated code for the rotation portion of the arm. :)
SofiaAugusta Feb 16, 2023
1a9ee27
move location of config variables
mecaneer23 Feb 16, 2023
740e137
Merge remote-tracking branch 'origin/main'
mecaneer23 Feb 16, 2023
564e61f
add rotation variables
mecaneer23 Feb 16, 2023
70b7f1f
move grabber variable location
mecaneer23 Feb 16, 2023
e46930d
change hardware
mecaneer23 Feb 16, 2023
f79ac51
increase motor power
mecaneer23 Feb 18, 2023
f28be32
add rotation init location
mecaneer23 Feb 18, 2023
4330687
move PID location
mecaneer23 Feb 18, 2023
e8b10ba
Theoretical code for right auto 5 stack...untested
SofiaAugusta Feb 20, 2023
77d5002
remove unnecessary telemetry
mecaneer23 Feb 20, 2023
ee7fa8d
add power variable
mecaneer23 Feb 20, 2023
eba1d36
calibrate virtual four bar positions
mecaneer23 Feb 20, 2023
fda3eb1
clean up
mecaneer23 Feb 20, 2023
3cd4a1f
add ArmRotation class separate to slides
mecaneer23 Feb 20, 2023
9bc70a4
fix telemetry
mecaneer23 Feb 20, 2023
da24e4a
add dashboard telemetry to mainop
mecaneer23 Feb 20, 2023
8a0eded
tune PID, remove gravity constant
mecaneer23 Feb 20, 2023
1dcc573
fix rotation constants
mecaneer23 Feb 20, 2023
a348b1c
add gamepad command to toggle v4b position
mecaneer23 Feb 20, 2023
1037022
toHeight functions also move ArmRotation
mecaneer23 Feb 20, 2023
2413f14
adjust heights for v4b length
mecaneer23 Feb 20, 2023
eff34af
Changed x and y locations for splines. Rotation arm still needs to ge…
SofiaAugusta Feb 20, 2023
c5e7181
Right Deliver1_5 movement works as it should. At the moment, slides a…
SofiaAugusta Feb 21, 2023
591cdb7
fix telemetry
mecaneer23 Feb 21, 2023
bf1e0b8
make v4b go under, not over
mecaneer23 Feb 21, 2023
56e46a6
asynnnccccccc
mecaneer23 Feb 22, 2023
9b89064
fix arm constants (theoretically)
mecaneer23 Feb 22, 2023
8380459
add gravity to v4b pid
mecaneer23 Feb 22, 2023
6b18e9d
add minimum v4b position
mecaneer23 Feb 22, 2023
41f8ae4
current status of auto
SofiaAugusta Feb 23, 2023
927abc1
Fix gravity thing theoretically
mecaneer23 Feb 23, 2023
ddb9b3d
fix spacing
mecaneer23 Feb 23, 2023
807ee05
move addSlides out of constructor
mecaneer23 Feb 23, 2023
46dd05b
This is kind of frustrating to look but its an alternate version of t…
SofiaAugusta Feb 23, 2023
507f670
Merge remote-tracking branch 'origin/main'
mecaneer23 Feb 23, 2023
7f83c11
add new and old constants for slide positions
mecaneer23 Feb 24, 2023
a64af2a
make it non-blocking in auto
mecaneer23 Feb 24, 2023
bf41277
add force backward for init
mecaneer23 Feb 24, 2023
51ba071
fix slides constants
mecaneer23 Feb 24, 2023
680ca09
make async
mecaneer23 Feb 24, 2023
b3245cd
make it non-blocking in auto
mecaneer23 Feb 24, 2023
f4ce95c
do slides height check in update() rather than once in move()
mecaneer23 Feb 24, 2023
0f029da
fix backwardForce
mecaneer23 Feb 24, 2023
7f82ed6
change init position to horizontal
mecaneer23 Feb 24, 2023
fa493fe
remove toBackwardForce
mecaneer23 Feb 24, 2023
318d704
fix forward position
mecaneer23 Feb 25, 2023
c7cfc0a
add left stick manual init
mecaneer23 Feb 25, 2023
2ed71df
new hardware - make it work
mecaneer23 Feb 25, 2023
cbd63c1
make grabber a config file
mecaneer23 Feb 25, 2023
21fd262
make arm disable-able and reduce zeroing speed
mecaneer23 Feb 25, 2023
5a4278d
change constants
mecaneer23 Feb 25, 2023
03b9e2b
allow disabling
mecaneer23 Feb 25, 2023
b9f43ae
disable extra config classes
mecaneer23 Feb 25, 2023
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
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions FtcRobotController/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:+'
}

apply from: '../build.dependencies.gradle'
apply plugin: 'org.jetbrains.kotlin.android'
4 changes: 2 additions & 2 deletions FtcRobotController/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="48"
android:versionName="8.1">
android:versionCode="49"
android:versionName="8.1.1">

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

Expand Down
1 change: 1 addition & 0 deletions MeepMeep/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
17 changes: 17 additions & 0 deletions MeepMeep/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
plugins {
id 'java-library'
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

repositories {
maven { url = 'https://jitpack.io' }
maven { url = 'https://maven.brott.dev/' }
}

dependencies {
implementation 'com.github.NoahBres:MeepMeep:2.0.2'
}
34 changes: 34 additions & 0 deletions MeepMeep/src/main/java/com/example/meepmeep/MeepMeepTesting.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.example.meepmeep;

import com.acmerobotics.roadrunner.geometry.Pose2d;
import com.acmerobotics.roadrunner.geometry.Vector2d;
import com.noahbres.meepmeep.MeepMeep;
import com.noahbres.meepmeep.roadrunner.DefaultBotBuilder;
import com.noahbres.meepmeep.roadrunner.entity.RoadRunnerBotEntity;

public class MeepMeepTesting {
public static void main(String[] args) {
MeepMeep meepMeep = new MeepMeep(800);

RoadRunnerBotEntity myBot = new DefaultBotBuilder(meepMeep)
// Set bot constraints: maxVel, maxAccel, maxAngVel, maxAngAccel, track width
.setConstraints(60, 60, Math.toRadians(180), Math.toRadians(180), 15)
.setDimensions(14, 14)
.followTrajectorySequence(drive ->
drive.trajectorySequenceBuilder(new Pose2d(-66, -36, 0))
.splineTo(new Vector2d(-54, -13), 0)
.splineToConstantHeading(new Vector2d(-38, -12), 0)
.addDisplacementMarker(() -> {
})
.splineToConstantHeading(new Vector2d(-34, 0), 0)
.forward(3)
.build()
);

meepMeep.setBackground(MeepMeep.Background.FIELD_POWERPLAY_OFFICIAL)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start();
}
}
6 changes: 3 additions & 3 deletions TeamCode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
// Include common definitions from above.
apply from: '../build.common.gradle'
apply from: '../build.dependencies.gradle'
apply plugin: 'org.jetbrains.kotlin.android'

android {
namespace = 'org.firstinspires.ftc.teamcode'
}

dependencies {
implementation project(':FtcRobotController')
implementation 'androidx.core:core-ktx:+'
annotationProcessor files('lib/OpModeAnnotationProcessor.jar')
implementation 'org.openftc:easyopencv:1.5.2'
implementation 'org.openftc:rev-extensions-2:1.2'
implementation 'org.ftclib.ftclib:core:2.0.1'
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.acmerobotics.roadrunner:core:0.5.6'
}

This file was deleted.

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

import com.acmerobotics.roadrunner.geometry.Pose2d;
import com.acmerobotics.roadrunner.geometry.Vector2d;
import com.acmerobotics.roadrunner.trajectory.Trajectory;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;

import org.firstinspires.ftc.teamcode.Base.BaseOpMode;
import org.firstinspires.ftc.teamcode.Base.Robot;
import org.firstinspires.ftc.teamcode.Bots.PostBot;
import org.firstinspires.ftc.teamcode.RoadRunner.drive.RRMecanum;

@Autonomous
public class GoForward extends BaseOpMode {
public PostBot robot;
public RRMecanum drive;
public Trajectory forward;

@Override
protected Robot setRobot() {
this.robot = new PostBot();
return this.robot;
}

@Override
protected boolean setTeleOp() {
return false;
}

@Override
public void onInit() throws InterruptedException {
drive = new RRMecanum(hardwareMap);
Pose2d startPose = new Pose2d();
drive.setPoseEstimate(startPose);
forward = drive.trajectoryBuilder(startPose)
.forward(10)
.build();
}

@Override
public void onStart() throws InterruptedException {
drive.followTrajectory(forward);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package org.firstinspires.ftc.teamcode.Autonomous;

import com.acmerobotics.roadrunner.geometry.Pose2d;
import com.acmerobotics.roadrunner.geometry.Vector2d;
import com.acmerobotics.roadrunner.trajectory.Trajectory;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;

import org.firstinspires.ftc.teamcode.Base.BaseOpMode;
import org.firstinspires.ftc.teamcode.Base.Robot;
import org.firstinspires.ftc.teamcode.Bots.PostBot;
import org.firstinspires.ftc.teamcode.Components.Camera;
import org.firstinspires.ftc.teamcode.RoadRunner.drive.RRMecanum;


@Autonomous
public class Left_Deliver1Close_SensePark extends BaseOpMode {
public PostBot robot;
public RRMecanum drive;
public Trajectory toPole, forward, backward, left, right, center;

Camera.ParkingPosition parkingPosition;

public int state = 100;

@Override
protected Robot setRobot() {
this.robot = new PostBot();
return this.robot;
}

@Override
protected boolean setTeleOp() {
return false;
}

@Override
public void onInit() throws InterruptedException {
drive = new RRMecanum(hardwareMap);
Pose2d startPose = new Pose2d();
drive.setPoseEstimate(startPose);
toPole = drive.trajectoryBuilder(startPose, 20, 3)
.splineTo(new Vector2d(12, -20), 0)
.splineTo(new Vector2d(29, -24), 0)
.splineToConstantHeading(new Vector2d(29, -32), 0)
.splineToConstantHeading(new Vector2d(31, -36.5), 0)
.build();
forward = drive.trajectoryBuilder(toPole.end(), 20, 3)
.splineTo(new Vector2d(33.5, -36.5), 0)
.build();
backward = drive.trajectoryBuilder(forward.end())
.back(7.5)
.build();
left = drive.trajectoryBuilder(backward.end().plus(new Pose2d(0, 0, Math.toRadians(0))), 30, 3)
.strafeLeft(60.5)
.build();
right = drive.trajectoryBuilder(backward.end().plus(new Pose2d(0, 0, Math.toRadians(0))), 30, 3)
.strafeLeft(9.5)
.build();
center = drive.trajectoryBuilder(backward.end().plus(new Pose2d(0, 0, Math.toRadians(0))), 30, 3)
.strafeLeft(36.5)
.build();
robot.camera.requestStart();
robot.grabber.close();
}

@Override
public void onStart() throws InterruptedException {
parkingPosition = robot.camera.getParkingPosition();
state = 0;
robot.arm.toGround();
robot.grabber.close();
drive.followTrajectory(toPole);
robot.arm.toHigh();
drive.followTrajectory(forward);
robot.arm.toHigh();
robot.grabber.open();
sleep(2000);
drive.followTrajectory(backward);
robot.arm.toZero();
if (parkingPosition == Camera.ParkingPosition.LEFT) {
drive.followTrajectory(left);
} else if (parkingPosition == Camera.ParkingPosition.RIGHT) {
drive.followTrajectory(right);
} else {
drive.followTrajectory(center);
}

}
}
Loading