Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
imu_heater.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2022 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_IMU_HEATER_HPP_
25#define TAPROOT_IMU_HEATER_HPP_
26
27#include "tap/util_macros.hpp"
28
29#include "modm/math/filter/pid.hpp"
30
31namespace tap
32{
33class Drivers;
34}
35
37{
39{
40public:
41 ImuHeater(Drivers *drivers);
43 ~ImuHeater() = default;
44
48 void initialize();
49
55 void runTemperatureController(float temperature);
56
62 inline void setDesiredTemperature(float temperature) { imuDesiredTemperature = temperature; }
63
64private:
68 static constexpr float TEMPERATURE_PID_P = 1.0f;
69 static constexpr float TEMPERATURE_PID_I = 0.0f;
70 static constexpr float TEMPERATURE_PID_D = 20.0f;
71 static constexpr float TEMPERATURE_PID_MAX_ERR_SUM = 0.0f;
72 static constexpr float TEMPERATURE_PID_MAX_OUT = 1.0f;
73
78 static constexpr float HEATER_PWM_FREQUENCY = 1000.0f;
79
84 float imuDesiredTemperature = 50.0f;
85
86 Drivers *drivers;
87
88 modm::Pid<float> imuTemperatureController;
89};
90} // namespace tap::communication::sensors::imu_heater
91
92#endif // TAPROOT_MPU6500_HEATER_HPP_
Definition drivers.hpp:70
void setDesiredTemperature(float temperature)
Set the target temperature for the IMU heater.
Definition imu_heater.hpp:62
void initialize()
Definition imu_heater.cpp:43
void runTemperatureController(float temperature)
Definition imu_heater.cpp:49
Definition imu_heater.cpp:31
Definition ballistics.cpp:29
tap::Drivers Drivers
Definition drivers.hpp:11
#define DISALLOW_COPY_AND_ASSIGN(Typename)
Definition util_macros.hpp:27