Closed El1zabethS closed 1 year ago
Simulate Robot Code on Desktop
DifferentialDrivetrainSim requires LinearSystem<N2, N2, N2> which requires drivetrainPlant, driveMotor, double gearing, double trackWidthMeters, double wheelRadiusMeters, measurementStdDevs. These values are found with the robot characterization tool.
Value guide: driveMotor - A DCMotor representing the drivetrain. gearing - The gearingRatio ratio of the robot, as output over input. This must be the same ratio as the ratio used to identify or create the drivetrainPlant. trackWidthMeters - The distance between the two sides of the drivetrian. Can be found with SysId. wheelRadiusMeters - The radius of the wheels on the drivetrain, in meters. measurementStdDevs - Standard deviations for measurements, in the form [x, y, heading, left velocity, right velocity, left distance, right distance]ᵀ. Can be null if no noise is desired. Gyro standard deviations of 0.0001 radians, velocity standard deviations of 0.05 m/s, and position measurement standard deviations of 0.005 meters are a reasonable starting point.
Research and document everything needed for simulation setup.