Conversation
Codecov Report
@@ Coverage Diff @@
## master #171 +/- ##
=========================================
- Coverage 72.23% 71.63% -0.6%
=========================================
Files 79 79
Lines 1563 1576 +13
Branches 139 136 -3
=========================================
Hits 1129 1129
- Misses 434 447 +13
Continue to review full report at Codecov.
|
| val part4 = part3._2.splitAt(calibrationVelocities.size / 5) | ||
| List(part1._1.toList, part2._1.toList, part3._1.toList, part4._1.toList, part4._2.toList) | ||
| } | ||
| println("Checking Calibration") |
There was a problem hiding this comment.
Remove print which may cause preformance degredation
| acc + cur | ||
| } | ||
| val average = sumChunk * (1D / chunk.size) | ||
| println(s"Chunk Average: $average") |
| val average = sumChunk * (1D / chunk.size) | ||
| println(s"Chunk Average: $average") | ||
| if((average.x - currentDrift.x).abs > threshold.x){ | ||
| println(s"Drift is not within x threshold") |
| List(part1._1.toList, part2._1.toList, part3._1.toList, part4._1.toList, part4._2.toList) | ||
| } | ||
| println("Checking Calibration") | ||
| chunks.foreach({chunk: List[Value3D[AngularVelocity]] => |
| successful = false | ||
| } | ||
| }) | ||
| successful |
There was a problem hiding this comment.
Also check that the queue of calibration values is full
There was a problem hiding this comment.
On that note, please make the queue size 1,000 values instead if 200. This means that we'll use 5 seconds worth of data instead of 1 second (at 5ms update loops)
| } | ||
| } | ||
|
|
||
| def checkCalibration: Boolean = { |
There was a problem hiding this comment.
This is more like, checking if calibration is in valid. Please name accordingly
| * @param tickPeriod tick period of robot | ||
| */ | ||
| abstract class DigitalGyro(tickPeriod: Time) { | ||
| abstract class DigitalGyro(tickPeriod: Time, threshold: Value3D[AngularVelocity]) { |
There was a problem hiding this comment.
Please rename to describe its use in checking for invalid calibration
| */ | ||
| abstract class DigitalGyro(tickPeriod: Time) { | ||
| abstract class DigitalGyro(tickPeriod: Time, threshold: Value3D[AngularVelocity]) { | ||
| // Tick Period of the robot |
There was a problem hiding this comment.
This comment shouldn't be here?
| def checkCalibration: Boolean = { | ||
| var successful = true | ||
| val chunks: List[List[Value3D[AngularVelocity]]] = { | ||
| val part1 = calibrationVelocities.splitAt(calibrationVelocities.size / 5) |
There was a problem hiding this comment.
😀 yay for Scala collection APIs!
|
Ping @Wafflemans. |
|
Ping @Wafflemans please make these fixes |
aa05529 to
2b32efe
Compare
PhilipAxelrod
left a comment
There was a problem hiding this comment.
if (compiles) {
"lgtm"
} else {
"not lgtm"
}
| * An interface for communicating with the ADIS16448 IMU. | ||
| */ | ||
| class ADIS16448(spi: SPITrait, updatePeriod: Time) extends DigitalGyro(updatePeriod) { | ||
| class ADIS16448(spi: SPITrait, updatePeriod: Time, maxDriftDeviation: Value3D[AngularVelocity]) extends DigitalGyro(updatePeriod, maxDriftDeviation) { |
There was a problem hiding this comment.
Instead of making this a constructor parameter here and in DigitalGyro, can you make it a parameter to the check method?
| val part2 = part1._2.splitAt(calibrationVelocities.size / 5) | ||
| val part3 = part2._2.splitAt(calibrationVelocities.size / 5) | ||
| val part4 = part3._2.splitAt(calibrationVelocities.size / 5) | ||
| Seq(part1._1.toList, part2._1.toList, part3._1.toList, part4._1.toList, part4._2.toList) |
There was a problem hiding this comment.
These toLists are a performance burden since they forcibly convert the sequences into linked lists.
No description provided.