libstp
Robotics library for Botball
Loading...
Searching...
No Matches
vel_lpf_tune.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <vector>
5
6#include "autotune/types.hpp"
7#include "hal/IMotor.hpp"
8
9namespace libstp::autotune
10{
27 {
28 public:
29 explicit VelLpfTuner(const std::vector<hal::motor::IMotor*>& motors);
30
33 [[nodiscard]] VelLpfResult tuneMotor(
34 hal::motor::IMotor* motor,
35 const VelLpfConfig& cfg) const;
36
38 [[nodiscard]] std::map<int, VelLpfResult> tune(
39 const VelLpfConfig& cfg) const;
40
41 private:
44 [[nodiscard]] VelLpfResult scoreFromRaw(
45 hal::motor::IMotor* motor,
46 std::vector<int> raw,
47 const VelLpfConfig& cfg) const;
48
49 std::vector<hal::motor::IMotor*> motors_;
50 };
51
52} // namespace libstp::autotune
std::map< int, VelLpfResult > tune(const VelLpfConfig &cfg) const
Spin all motors forward together, sample simultaneously, tune each.
VelLpfResult tuneMotor(hal::motor::IMotor *motor, const VelLpfConfig &cfg) const
VelLpfTuner(const std::vector< hal::motor::IMotor * > &motors)
Configuration for the VelLpfTuner (encoder-velocity LPF alpha).
Definition types.hpp:361
Per-motor LPF-alpha tuning result.
Definition types.hpp:393
Interface for motor abstraction.
Definition IMotor.hpp:17