Skip to content

Commit

Permalink
Merge branch 'master' into stall-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalsheth authored Mar 6, 2018
2 parents 38a3606 + ea3e956 commit 54fc4ed
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ branches:
- master
script:
- cp project/CrossSettings.template project/CrossSettings.scala
- sbt robotJVM/assembly robotNative/compile robotJVM/scalafixTest
- sbt robotJVM/test robotJVM/assembly robotNative/compile robotJVM/scalafixTest
- ./scalafmt --test
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ lazy val robot = crossProject(JVMPlatform, NativePlatform)
libraryDependencies += "edu.wpi.first" % "ntcore" % wpiVersion,
libraryDependencies += "edu.wpi.first" % "wpiutil" % wpiVersion,
libraryDependencies += "com.ctre" % "phoenix" % "5.1.3.1",
libraryDependencies += "org.opencv" % "opencv-java" % "3.2.0"
libraryDependencies += "org.opencv" % "opencv-java" % "3.2.0",
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % Test
)
.nativeSettings(
libraryDependencies += "com.lynbrookrobotics" %%% "wpilib-scala-native" % "0.1.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.lynbrookrobotics.eighteen

import argonaut.Argonaut._
import org.scalatest.FunSuite

import scala.io.Source

class ConfigValidTest extends FunSuite {
test("Default config is valid") {
val decoded = DefaultConfig.json.decodeEither[RobotConfig](RobotConfig.reader)
decoded.left.foreach(s => throw new Exception(s))
}

test("robot-config.json is valid") {
val decoded = Source.fromFile("robot-config.json").mkString.decodeEither[RobotConfig](RobotConfig.reader)
decoded.left.foreach(s => throw new Exception(s))
}

test("practice-robot-config.json is valid") {
val decoded = Source.fromFile("practice-robot-config.json").mkString.decodeEither[RobotConfig](RobotConfig.reader)
decoded.left.foreach(s => throw new Exception(s))
}
}
6 changes: 5 additions & 1 deletion practice-robot-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
"minHeight": [
0.25,
"Inches"
],
"twistyTotalRange": [
1.5,
"Feet"
]
},
"ports": {
Expand All @@ -106,7 +110,7 @@
},
"drivetrain": {
"ports": {
"practiceSpeedControllers": true,
"practiceSpeedControllers": false,
"rightFollowerPort": 14,
"leftFollowerPort": 12,
"rightPort": 13,
Expand Down
66 changes: 41 additions & 25 deletions robot-config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"cubeLift": {
"props": {
"scaleHeight": [
30,
"lowScaleHeight": [
66,
"Inches"
],
"highScaleHeight": [
68,
"Inches"
],
"pidConfig": {
"kd": {
"den": [
5,
1,
"FeetPerSecond"
],
"num": [
Expand All @@ -28,17 +32,17 @@
},
"kp": {
"den": [
5,
0.8,
"Feet"
],
"num": [
0,
100,
"Percent"
]
}
},
"collectHeight": [
2,
0.5,
"Inches"
],
"voltageAtBottom": [
Expand All @@ -50,7 +54,11 @@
"Inches"
],
"switchHeight": [
20,
25,
"Inches"
],
"exchangeHeight": [
4,
"Inches"
],
"voltageOverHeight": {
Expand All @@ -64,7 +72,7 @@
]
},
"maxMotorOutput": [
80,
100,
"Percent"
],
"talonOverVoltage": {
Expand All @@ -78,11 +86,11 @@
]
},
"maxHeight": [
75,
73,
"Inches"
],
"minHeight": [
1,
0.25,
"Inches"
],
"maxCurrentDraw": [
Expand All @@ -92,6 +100,10 @@
"stallTimeout": [
3,
"Seconds"
],
"twistyTotalRange": [
-1.5,
"Feet"
]
},
"ports": {
Expand All @@ -114,7 +126,7 @@
},
"props": {
"maxLeftVelocity": [
18.8,
17.7,
"FeetPerSecond"
],
"turnVelocityGains": {
Expand All @@ -140,11 +152,11 @@
},
"kp": {
"den": [
1,
360,
"DegreesPerSecond"
],
"num": [
0,
50,
"Percent"
]
}
Expand All @@ -154,19 +166,19 @@
"Feet"
],
"maxAcceleration": [
0,
5,
"FeetPerSecondSquared"
],
"maxCurrent": [
25,
35,
"Amperes"
],
"parallelMotorCurrentThreshold" : [
5,
"Amperes"
],
"maxRightVelocity": [
19.25,
17.7,
"FeetPerSecond"
],
"track": [
Expand All @@ -179,7 +191,7 @@
],
"wheelOverEncoderGears": {
"num": [
17,
18,
"Turns"
],
"den": [
Expand Down Expand Up @@ -210,11 +222,11 @@
},
"kp": {
"den": [
5,
4,
"FeetPerSecond"
],
"num": [
0,
80,
"Percent"
]
}
Expand Down Expand Up @@ -242,11 +254,11 @@
},
"kp": {
"den": [
1,
360,
"Degrees"
],
"num": [
0,
50,
"Percent"
]
}
Expand Down Expand Up @@ -275,11 +287,11 @@
},
"kp": {
"den": [
5,
4,
"FeetPerSecond"
],
"num": [
0,
80,
"Percent"
]
}
Expand Down Expand Up @@ -311,7 +323,7 @@
"Feet"
],
"num": [
0,
50,
"Percent"
]
}
Expand Down Expand Up @@ -356,10 +368,14 @@
"collectSpeed": [
50,
"Percent"
],
"purgeSpeed": [
70,
"Percent"
]
}
},
"climberWinch": null,
"enableLimelight": false,
"led": null
}
}
Loading

0 comments on commit 54fc4ed

Please sign in to comment.