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

Dev/ml3 #65

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
53ee78e
254's Differential Drive Class. (#42)
BBScholar Apr 23, 2019
166fcac
lots of stuf
BBScholar Apr 23, 2019
6d64590
lots and lots of stuff
BBScholar Apr 25, 2019
39b273a
Update README.md
andycate Apr 26, 2019
0266d9b
added default trajectory generatory
BBScholar Apr 26, 2019
3076fa7
Update number and name
andycate Apr 27, 2019
94119b7
Update wpilib version and docker testing image
andycate Apr 28, 2019
95939e0
Fix docker testing image version again
andycate Apr 28, 2019
99c88a2
Add encrypted variables
andycate Apr 28, 2019
70aa5c9
basic UnitConversion structor
FelixMo42 May 3, 2019
73a7aea
added distance units
FelixMo42 May 5, 2019
e541ab2
renamed package and unit test
FelixMo42 May 5, 2019
ff13397
fixed import and added unit test
FelixMo42 May 6, 2019
bd7d841
auto commands and stuff
BBScholar May 7, 2019
8d6061d
added mote units
FelixMo42 May 10, 2019
15c7016
stuff?
BBScholar May 28, 2019
4721400
gitignore
BBScholar May 28, 2019
f0ef96a
unit conversion
BBScholar May 29, 2019
1d4cdb8
too much stuff lol, need to rewrite tests
BBScholar May 29, 2019
e1321d6
fixed file names and imports
FelixMo42 May 29, 2019
d429674
lots of stuff
BBScholar May 31, 2019
c6923ca
consumer wrappers
BBScholar May 31, 2019
4563d69
source monitor
BBScholar May 31, 2019
f9b5f9c
gyro source function
BBScholar May 31, 2019
55bcd13
improved position tracker
BBScholar May 31, 2019
1c291f0
abstracted drivetrain
BBScholar May 31, 2019
0f00a6f
lots more stuff, need to write tests
BBScholar Jun 12, 2019
36818ae
added slope native model
BBScholar Jun 12, 2019
a5bb2a3
subsystem extension
BBScholar Jun 12, 2019
21bb6a0
Money Robot file
BBScholar Jun 12, 2019
32851a7
added limelight class, rewrote drive helpers to be more helpful, Pige…
BBScholar Jun 17, 2019
1776060
more stuff
BBScholar Jun 17, 2019
a65988b
modified epsilon stuff
BBScholar Jun 18, 2019
5fc6d6b
fixed untracked files
BBScholar Jun 18, 2019
35ac694
Made some slight changes to Constraints, commented out monkey robot f…
BBScholar Jun 18, 2019
eb646ad
Added tests for lots of stuff.
BBScholar Jun 18, 2019
dacf570
added rectangle class, added more tests
BBScholar Jun 18, 2019
121fa61
added more source types
BBScholar Jun 18, 2019
05acb44
got rid of compiler warnings
BBScholar Jun 18, 2019
5632c2e
small changes, added option to visualize trajectory
BBScholar Jun 18, 2019
fe8c3c7
implemented monkey robot
BBScholar Jun 18, 2019
515d97f
started on action scheduler
BBScholar Jun 19, 2019
4ed453b
small changes
BBScholar Jun 19, 2019
e00c016
got rid of timeout calls within actions, only has timeout when .withT…
BBScholar Jun 23, 2019
4e31cc7
fixed parallel action
BBScholar Jun 23, 2019
5be9149
got rid of redundation operator
BBScholar Jun 23, 2019
bbc2504
changed print string
BBScholar Jun 23, 2019
ef6247d
changed mirror function
BBScholar Jun 26, 2019
1222993
added simulated classes
BBScholar Jun 29, 2019
9c3e70e
Merge pull request #1 from team5419/dev/UnitConversion
FelixMo42 Aug 31, 2019
fb39256
Update travis deploy
andycate Sep 5, 2019
25735e9
updated pre-commit-hook to newest versions
FelixMo42 Oct 11, 2019
c4958b8
made tox compatable with windows
FelixMo42 Oct 11, 2019
4aeaafc
PS4Controller Functions
Oct 12, 2019
cfa9813
Build Successful + Minor Change
Oct 12, 2019
6c338a4
changed naming from monkeys to berkeley
Oct 12, 2019
059204f
removed unused logger class
Oct 12, 2019
4288ffd
removed scheduler
BBScholar Oct 12, 2019
ab12c17
Changing Inheritance from XBoxController->Joystick
Oct 14, 2019
838e23a
Merge pull request #4 from team5419/dev/PS4Controller
nicholasunderwood Oct 14, 2019
c24ecbd
made some of the math optional + aded max output
FelixMo42 Oct 14, 2019
2cec715
changed totalMax default
FelixMo42 Oct 14, 2019
9b00881
Merge pull request #5 from team5419/dev/PIDF
FelixMo42 Oct 14, 2019
bcfbc80
Neatness / Naming Functions + Updates
Oct 16, 2019
873e0a4
Port Fixes + Fault 2.11.1
Oct 17, 2019
15c0a81
Minor Fix On getPOVUp()
Oct 18, 2019
9ee238f
Merge pull request #6 from team5419/dev/PS4Controller
violeteloiv Oct 18, 2019
57233cf
inital commit
nicholasunderwood Oct 22, 2019
0511089
Merge branch 'master' into dev/monkeylib3
BBScholar Oct 30, 2019
3001032
initial
BBScholar Oct 30, 2019
152dacd
merge
BBScholar Oct 30, 2019
538b95c
added docs
FelixMo42 Oct 31, 2019
a577a51
Merge pull request #7 from team5419/dev/PIDF
FelixMo42 Oct 31, 2019
ee257bb
sorry
BBScholar Nov 1, 2019
ce8c78e
units
BBScholar Nov 6, 2019
ecdc203
added operations
BBScholar Nov 8, 2019
6dc36d4
big ole yeet
BBScholar Nov 12, 2019
17de6c5
fixes
BBScholar Nov 12, 2019
f87dde4
fixed issues
BBScholar Nov 12, 2019
cce3703
fixed gradle.build file
nicholasunderwood Nov 15, 2019
64c12a7
formatting
nicholasunderwood Nov 26, 2019
9d3a678
almost!
nicholasunderwood Dec 6, 2019
ffb934a
Merge branch 'dev/ml3' of https://github.com/team5419/fault into dev/ml3
nicholasunderwood Dec 6, 2019
87bda9b
i hate my life and want to die
BBScholar Dec 11, 2019
bee5943
i hate my life and want to die
BBScholar Dec 11, 2019
5313676
Merge branch 'dev/ml3' of https://github.com/team5419/fault into dev/ml3
BBScholar Dec 11, 2019
c282cea
i still want to die, but the bugs are fixed
BBScholar Dec 11, 2019
aa6bdc1
MovingAverageFilter
nicholasunderwood Dec 21, 2019
a46f297
done?
nicholasunderwood Dec 26, 2019
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
*.iml
*.ipr
*.iws
.classpath
.gradle/
.idea/
.project
.settings/
.vscode/
bin/
build/
out/
virtualenv_run/
19 changes: 19 additions & 0 deletions .idea/gradle.xml

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

5 changes: 5 additions & 0 deletions .idea/misc.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

73 changes: 73 additions & 0 deletions .idea/workspace.xml

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

10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# MonkeyLib

[![Build Status](https://travis-ci.org/team5499/MonkeyLib.svg?branch=master)](https://travis-ci.org/team5499/MonkeyLib)
[![Code Coverage](https://codecov.io/gh/team5499/MonkeyLib/branch/master/graph/badge.svg)](https://codecov.io/gh/team5499/MonkeyLib)

MonkeyLib is team 5499's base kotlin code used in all of our robots. Mostly contains math and utilities
# Fault

My own branch of Fault

15 changes: 9 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
id 'jacoco'
id 'maven'
id 'org.jetbrains.dokka' version '0.9.17'
id 'idea'
}

repositories {
Expand All @@ -32,10 +33,12 @@ dependencies {
testCompile 'org.powermock:powermock-module-junit4:1.6.6'
testCompile 'org.powermock:powermock-api-mockito2:1.6.6'

testCompile group: 'org.knowm.xchart', name: 'xchart', version: '3.5.4'

}

group = 'org.team5499'
version = '2.11.0'
group = 'org.team5419'
version = '3.0.0-SNAPSHOT'


task sourcesJar(type: Jar) {
Expand Down Expand Up @@ -106,14 +109,14 @@ task install_hooks(dependsOn: 'tox')
publishing {
publications {
library(MavenPublication) {
artifactId = 'monkey-lib'
artifactId = 'fault'
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'MonkeyLib'
description = 'Commonly used utilities in FRC Team 5499\'s codebase'
url = 'https://github.com/team5499/MonkeyLib'
name = 'Fault'
description = 'Commonly used utilities in FRC Team 5419\'s codebase'
url = 'https://github.com/team5419/fault'
}
}
}
Expand Down
90 changes: 90 additions & 0 deletions src/main/kotlin/org/team5419/fault/BerkeliumRobot.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package org.team5419.fault

import edu.wpi.first.hal.FRCNetComm
import edu.wpi.first.hal.HAL
import edu.wpi.first.wpilibj.RobotBase
import edu.wpi.first.wpilibj.TimedRobot
import org.team5419.fault.math.units.SIUnit
import org.team5419.fault.math.units.Second
import org.team5419.fault.subsystems.Subsystem
import org.team5419.fault.subsystems.SubsystemManager

@Suppress("TooManyFunctions")
abstract class BerkeliumRobot(period: SIUnit<Second>) {

protected val wrappedValue = WpiTimedRobot(period.value)

protected inner class WpiTimedRobot(period: Double = 0.05) : TimedRobot(period) {

private val kLanguageKotlin = 6

init {
HAL.report(FRCNetComm.tResourceType.kResourceType_Language, kLanguageKotlin)
}

override fun robotInit() {
[email protected]()
SubsystemManager.init()
}

override fun autonomousInit() {
[email protected]()
SubsystemManager.autoReset()
}

override fun teleopInit() {
[email protected]()
SubsystemManager.teleopReset()
}

override fun disabledInit() {
[email protected]()
SubsystemManager.zeroOutputs()
}

override fun testInit() {
[email protected]()
}

override fun robotPeriodic() {
[email protected]()
if (!isDisabled) SubsystemManager.periodic()
}

override fun autonomousPeriodic() {
[email protected]()
}

override fun teleopPeriodic() {
[email protected]()
}

override fun disabledPeriodic() {
[email protected]()
}

override fun testPeriodic() {
[email protected]()
}
}

protected open fun robotInit() {}
protected open fun autonomousInit() {}
protected open fun teleopInit() {}
protected open fun disabledInit() {}
protected open fun testInit() {}

protected open fun robotPeriodic() {}
protected open fun autonomousPeriodic() {}
protected open fun teleopPeriodic() {}
protected open fun disabledPeriodic() {}
protected open fun testPeriodic() {}

open operator fun Subsystem.unaryPlus() {
SubsystemManager.addSubsystem(this)
}

fun start() {
RobotBase.startRobot { wrappedValue }
}
}
10 changes: 10 additions & 0 deletions src/main/kotlin/org/team5419/fault/Controller.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.team5419.fault

interface Controller {

fun start()

fun update()

fun reset()
}
91 changes: 91 additions & 0 deletions src/main/kotlin/org/team5419/fault/auto/Action.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package org.team5419.fault.auto

import org.team5419.fault.math.units.SIUnit
import org.team5419.fault.math.units.SIUnitBuilder
import org.team5419.fault.math.units.Second
import org.team5419.fault.util.BooleanSource
import org.team5419.fault.util.Source
import org.team5419.fault.util.or
import org.team5419.fault.util.time.ITimer
import org.team5419.fault.util.time.WPITimer

typealias NothingAction = Action

open class Action(
private val timer: ITimer = WPITimer()
) {

protected var mTimeout = SIUnitBuilder(0.0).seconds

protected var finishCondition = FinishCondition(Source(false))

open fun start() {
timer.stop()
timer.reset()
timer.start()
}

open fun update() {}

protected fun timedOut() = (timer.get() >= mTimeout)

open fun next(): Boolean {
return finishCondition()
}

open fun finish() {}

protected class FinishCondition(
private var source: BooleanSource
) : BooleanSource {
override fun invoke() = source()

operator fun plusAssign(other: BooleanSource) {
source = source or other
}

fun set(other: BooleanSource) {
source = other
}
}

fun withExit(condition: BooleanSource) = also { finishCondition += condition }

fun overrideExit(condition: BooleanSource) = also { finishCondition.set(condition) }

fun withTimeout(time: SIUnit<Second>) = also {
this.mTimeout = time
finishCondition += { timedOut() }
}
}

open class ConditionalAction(
private val condition: BooleanSource,
private val ifTrue: Action? = null,
private val ifFalse: Action? = null
) : Action() {

private var selectedAction: Action? = null
private val selectedActionDone = { if (selectedAction != null) selectedAction!!.next() else true }

init {
finishCondition += { timedOut() }
finishCondition += selectedActionDone
}

override fun start() {
super.start()
selectedAction = if (condition()) ifTrue else ifFalse
if (selectedAction != null) selectedAction!!.start()
}

override fun update() {
super.update()
if (selectedAction != null) selectedAction!!.update()
}

override fun finish() {
if (selectedAction != null) selectedAction!!.finish()
selectedAction = null
}
}
Loading