Files
YAGSL/swervelib/parser/json/modules/AngleConversionFactorsJson.java

34 lines
708 B
Java
Raw Permalink Normal View History

2024-07-29 15:14:25 -05:00
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.
*/
2024-12-09 23:26:04 +00:00
public double gearRatio;
2024-07-29 15:14:25 -05:00
/**
* Calculated or given conversion factor.
*/
2024-12-09 23:26:04 +00:00
public double factor = 0;
2024-07-29 15:14:25 -05:00
/**
* 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;
}
}