mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Open scope for gyro methods. Fixes FirstForge artf1699.
Allows user to cause gyro calibration on demand. It also exposes the AnalogInput object as protected to allow the user to extend the gyro class and implement their own calibration. Change-Id: Ib4206a9b16ce6d5e8e5ca9c28a14471974705a7f
This commit is contained in:
@@ -29,7 +29,7 @@ public class Gyro extends SensorBase implements PIDSource, LiveWindowSendable {
|
||||
static final double kSamplesPerSecond = 50.0;
|
||||
static final double kCalibrationSampleTime = 5.0;
|
||||
static final double kDefaultVoltsPerDegreePerSecond = 0.007;
|
||||
private AnalogInput m_analog;
|
||||
protected AnalogInput m_analog;
|
||||
double m_voltsPerDegreePerSecond;
|
||||
double m_offset;
|
||||
int m_center;
|
||||
@@ -45,7 +45,7 @@ public class Gyro extends SensorBase implements PIDSource, LiveWindowSendable {
|
||||
* calculations are in progress, this is typically done when the robot is
|
||||
* first turned on while it's sitting at rest before the competition starts.
|
||||
*/
|
||||
private void initGyro() {
|
||||
public void initGyro() {
|
||||
result = new AccumulatorResult();
|
||||
if (m_analog == null) {
|
||||
System.out.println("Null m_analog");
|
||||
|
||||
Reference in New Issue
Block a user