mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
34 lines
708 B
Java
34 lines
708 B
Java
package swervelib.parser.json.modules;
|
|
|
|
import swervelib.math.SwerveMath;
|
|
|
|
/**
|
|
* Angle motor conversion factors composite JSON parse class.
|
|
*/
|
|
public class AngleConversionFactorsJson
|
|
{
|
|
|
|
/**
|
|
* Gear ratio for the angle/steering/azimuth motor on the Swerve Module. Motor rotations to 1 wheel rotation.
|
|
*/
|
|
public double gearRatio;
|
|
/**
|
|
* Calculated or given conversion factor.
|
|
*/
|
|
public double factor = 0;
|
|
|
|
/**
|
|
* Calculate the drive conversion factor.
|
|
*
|
|
* @return Drive conversion factor, if factor isn't set.
|
|
*/
|
|
public double calculate()
|
|
{
|
|
if (factor == 0)
|
|
{
|
|
factor = SwerveMath.calculateDegreesPerSteeringRotation(gearRatio);
|
|
}
|
|
return factor;
|
|
}
|
|
}
|