mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Enhance Command Sendable implementations (#4822)
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <wpi/sendable/SendableBuilder.h>
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
RamseteCommand::RamseteCommand(
|
||||
@@ -158,3 +160,11 @@ void RamseteCommand::End(bool interrupted) {
|
||||
bool RamseteCommand::IsFinished() {
|
||||
return m_timer.HasElapsed(m_trajectory.TotalTime());
|
||||
}
|
||||
|
||||
void RamseteCommand::InitSendable(wpi::SendableBuilder& builder) {
|
||||
CommandBase::InitSendable(builder);
|
||||
builder.AddDoubleProperty(
|
||||
"leftVelocity", [this] { return m_prevSpeeds.left.value(); }, nullptr);
|
||||
builder.AddDoubleProperty(
|
||||
"rightVelocity", [this] { return m_prevSpeeds.right.value(); }, nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user