File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/java/org/lasarobotics/drive Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,13 @@ public Measure<Velocity<Distance>> calculate(Measure<Velocity<Distance>> velocit
129
129
inertialVelocity = Units .MetersPerSecond .of (Math .abs (inertialVelocity .in (Units .MetersPerSecond )));
130
130
131
131
// See if user has been trying to accelerate for a while...
132
- boolean slowWheel = wheelSpeed . minus ( Units .MetersPerSecond .of (Math .abs (velocityRequest .in (Units .MetersPerSecond ))))
132
+ boolean slowWheel = Units .MetersPerSecond .of (Math .abs (velocityRequest .in (Units .MetersPerSecond ))). minus ( wheelSpeed )
133
133
.gt (VELOCITY_DIFFERENCE_THRESHOLD );
134
- if (slowWheel ) {
134
+ if (slowWheel ) m_forceAccelerateTimer .start ();
135
+ else {
135
136
m_forceAccelerateTimer .reset ();
136
- m_forceAccelerateTimer .start ();
137
- } else m_forceAccelerateTimer . stop ();
137
+ m_forceAccelerateTimer .stop ();
138
+ }
138
139
boolean forceAcceleration = m_staticForceAccelerationDebouncer .calculate (
139
140
velocityRequest .gte (VELOCITY_REQUEST_THRESHOLD ) && wheelSpeed .lte (WHEEL_SPEED_THRESHOLD )
140
141
) || m_dynamicForceAccelerationDebouncer .calculate (
You can’t perform that action at this time.
0 commit comments