mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Fix Mecanum and SwerveControllerCommand when desired rotation passed (#3808)
This commit is contained in:
@@ -242,9 +242,11 @@ MecanumControllerCommand::MecanumControllerCommand(
|
||||
}
|
||||
|
||||
void MecanumControllerCommand::Initialize() {
|
||||
m_desiredRotation = [&] {
|
||||
return m_trajectory.States().back().pose.Rotation();
|
||||
};
|
||||
if (m_desiredRotation == nullptr) {
|
||||
m_desiredRotation = [&] {
|
||||
return m_trajectory.States().back().pose.Rotation();
|
||||
};
|
||||
}
|
||||
m_prevTime = 0_s;
|
||||
auto initialState = m_trajectory.Sample(0_s);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user