mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[wpilib] Fix acceleration getter for DCMotorSim (#7449)
This commit is contained in:
committed by
GitHub
parent
0941251375
commit
b91864a5ec
@@ -52,7 +52,7 @@ units::radians_per_second_t DCMotorSim::GetAngularVelocity() const {
|
||||
|
||||
units::radians_per_second_squared_t DCMotorSim::GetAngularAcceleration() const {
|
||||
return units::radians_per_second_squared_t{
|
||||
(m_plant.A() * m_x + m_plant.B() * m_u)(0, 0)};
|
||||
(m_plant.A() * m_x + m_plant.B() * m_u)(1, 0)};
|
||||
}
|
||||
|
||||
units::newton_meter_t DCMotorSim::GetTorque() const {
|
||||
|
||||
@@ -184,7 +184,7 @@ public class DCMotorSim extends LinearSystemSim<N2, N1, N2> {
|
||||
*/
|
||||
public double getAngularAccelerationRadPerSecSq() {
|
||||
var acceleration = (m_plant.getA().times(m_x)).plus(m_plant.getB().times(m_u));
|
||||
return acceleration.get(0, 0);
|
||||
return acceleration.get(1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user