[wpilib] Use RKDP in DifferentialDrivetrainSim (#5931)

This commit is contained in:
Tyler Veness
2023-11-17 08:41:18 -08:00
committed by GitHub
parent ead9ae5a69
commit b1fad062f7
4 changed files with 6 additions and 7 deletions

View File

@@ -148,8 +148,7 @@ public class DifferentialDrivetrainSim {
* @param dtSeconds the time difference
*/
public void update(double dtSeconds) {
// Update state estimate with RK4
m_x = NumericalIntegration.rk4(this::getDynamics, m_x, m_u, dtSeconds);
m_x = NumericalIntegration.rkdp(this::getDynamics, m_x, m_u, dtSeconds);
m_y = m_x;
if (m_measurementStdDevs != null) {
m_y = m_y.plus(StateSpaceUtil.makeWhiteNoiseVector(m_measurementStdDevs));