From ca74716c5b10c9e75c9b0768f4bee53b494c6c54 Mon Sep 17 00:00:00 2001 From: Andru Liu <90433630+WallabyLester@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:15:14 -0700 Subject: [PATCH] Changing main to implement simulation. --- CPP_Implementation/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CPP_Implementation/main.cpp b/CPP_Implementation/main.cpp index 1bc8017..bf52b57 100644 --- a/CPP_Implementation/main.cpp +++ b/CPP_Implementation/main.cpp @@ -1,9 +1,21 @@ #include +#include +#include + +#include "rbf_model.h" #include "apid_controller.h" -const double Kp = 1.0, Ki = 0.1, Kd = 0.01, dt = 0.1; +// Simple first order system +double systemResponse(double input, double measurement, double dt) { + return (input - measurement) * dt ; +} int main() { + // Seed random number generator for reproducibility + std::srand(static_cast(std::time(0))); + + const double Kp = 1.0, Ki = 0.1, Kd = 0.01, dt = 0.1; + aPIDController apid(Kp, Ki, Kd, dt); double target = 1.0;