Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
power_limiter.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-2021 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_POWER_LIMITER_HPP_
25#define TAPROOT_POWER_LIMITER_HPP_
26
30
31namespace tap
32{
33class Drivers;
34}
35
37{
68{
69public:
82 const tap::Drivers *drivers,
85 float startingEnergyBuffer,
86 float energyBufferLimitThreshold,
87 float energyBufferCritThreshold);
88
102 float getPowerLimitRatio();
103
104private:
105 const tap::Drivers *drivers;
108 const float startingEnergyBuffer;
109 const float energyBufferLimitThreshold;
110 const float energyBufferCritThreshold;
111
112 float energyBuffer;
113 float consumedPower;
114 uint32_t prevTime;
115 uint32_t prevRobotDataReceivedTimestamp;
116
120 void updatePowerAndEnergyBuffer();
121};
122} // namespace tap::control::chassis
123
124#endif // TAPROOT_POWER_LIMITER_HPP_
Definition drivers.hpp:70
Definition current_sensor_interface.hpp:35
Definition voltage_sensor_interface.hpp:35
Definition power_limiter.hpp:68
float getPowerLimitRatio()
Definition power_limiter.cpp:55
Definition chassis_subsystem_interface.hpp:33
Definition ballistics.cpp:29
tap::Drivers Drivers
Definition drivers.hpp:11
fang::Drivers & drivers
Definition robot_singleton.cpp:45