Files
allwpilib/wpimath/src/main/native/cpp/controller/BangBangController.cpp

25 lines
1008 B
C++

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "../../include/frc/controller/BangBangController.h"
#include <wpi/sendable/SendableBuilder.h>
using namespace frc;
void BangBangController::InitSendable(wpi::SendableBuilder& builder) {
builder.SetSmartDashboardType("BangBangController");
builder.AddDoubleProperty(
"tolerance", [this] { return GetTolerance(); },
[this](double tolerance) { SetTolerance(tolerance); });
builder.AddDoubleProperty(
"setpoint", [this] { return GetSetpoint(); },
[this](double setpoint) { SetSetpoint(setpoint); });
builder.AddDoubleProperty(
"measurement", [this] { return GetMeasurement(); }, nullptr);
builder.AddDoubleProperty("error", [this] { return GetError(); }, nullptr);
builder.AddBooleanProperty(
"atSetpoint", [this] { return AtSetpoint(); }, nullptr);
}