2023-02-13 17:21:24 -06:00
|
|
|
package swervelib.parser.json;
|
2023-02-13 14:37:05 -06:00
|
|
|
|
2023-02-13 17:21:24 -06:00
|
|
|
import swervelib.parser.PIDFConfig;
|
|
|
|
|
import swervelib.parser.SwerveControllerConfiguration;
|
|
|
|
|
import swervelib.parser.SwerveDriveConfiguration;
|
2023-02-13 14:37:05 -06:00
|
|
|
|
|
|
|
|
/**
|
2023-02-13 17:21:24 -06:00
|
|
|
* {@link swervelib.SwerveController} parsed class. Used to access the JSON data.
|
2023-02-13 14:37:05 -06:00
|
|
|
*/
|
|
|
|
|
public class ControllerPropertiesJson
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The minimum radius of the angle control joystick to allow for heading adjustment of the robot.
|
|
|
|
|
*/
|
|
|
|
|
public double angleJoystickRadiusDeadband;
|
|
|
|
|
/**
|
|
|
|
|
* The PID used to control the robot heading.
|
|
|
|
|
*/
|
|
|
|
|
public PIDFConfig heading;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create the {@link SwerveControllerConfiguration} based on parsed and given data.
|
|
|
|
|
*
|
|
|
|
|
* @param driveConfiguration {@link SwerveDriveConfiguration} parsed configuration.
|
2023-11-09 17:32:48 -06:00
|
|
|
* @param maxSpeedMPS Maximum speed in meters per second for the angular acceleration of the robot.
|
2023-02-13 14:37:05 -06:00
|
|
|
* @return {@link SwerveControllerConfiguration} object based on parsed data.
|
|
|
|
|
*/
|
2023-02-20 20:59:31 -06:00
|
|
|
public SwerveControllerConfiguration createControllerConfiguration(
|
2023-11-09 17:32:48 -06:00
|
|
|
SwerveDriveConfiguration driveConfiguration, double maxSpeedMPS)
|
2023-02-13 14:37:05 -06:00
|
|
|
{
|
2023-02-20 20:59:31 -06:00
|
|
|
return new SwerveControllerConfiguration(
|
2023-11-09 17:32:48 -06:00
|
|
|
driveConfiguration, heading, angleJoystickRadiusDeadband, maxSpeedMPS);
|
2023-02-13 14:37:05 -06:00
|
|
|
}
|
|
|
|
|
}
|