libstp
Robotics library for Botball
Loading...
Searching...
No Matches
control_path_param_estimation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <utility>
4#include <vector>
5
8
10{
11
25{
26public:
27 using MeasPoint = std::pair<double, double>;
28
30 const std::vector<MeasPoint>& measData);
31
36 std::vector<double> optimize(double limitMinParams,
37 double limitMaxParams,
38 bool dither,
39 int maxNumSteps,
40 double stepHeight,
41 double stepTime,
42 std::uint32_t seed = 0xC0FFEEu);
43
45 double rateCandidate(const std::vector<double>& paramList) override;
46
48 [[nodiscard]] double dt() const { return dt_; }
49
52 void setStep(double stepHeight, double stepTime)
53 {
54 step_height_ = stepHeight;
55 step_time_ = stepTime;
56 }
57
58private:
59 double evaluate(const std::vector<double>& params,
60 double stepHeight,
61 double stepTime);
62
63 ControlPath& control_path_;
64 std::vector<MeasPoint> meas_data_;
65 double dt_{0};
66 double step_height_{0};
67 double step_time_{0};
68};
69
70} // namespace libstp::autotune::control
ControlPathParamEstimation(ControlPath &controlPath, const std::vector< MeasPoint > &measData)
std::vector< double > optimize(double limitMinParams, double limitMaxParams, bool dither, int maxNumSteps, double stepHeight, double stepTime, std::uint32_t seed=0xC0FFEEu)
Run DE to fit the control path to the measured data.
double rateCandidate(const std::vector< double > &paramList) override
DE cost callback: squared error of the simulated vs. measured response.
double dt() const
Mean sample time derived from the measurement timestamps.
Series chain of control elements. Port of ControlPath.ts.
Cost function to minimise. Port of IDifferentialEvolutionRating.