blob: bb449da11930d5cffa2a5bcd51bd83d5b9526f41 [file] [log] [blame]
John Park0a245a02020-02-02 14:10:15 -08001#include "y2020/control_loops/superstructure/climber.h"
2
3#include <algorithm>
4
5#include "y2020/control_loops/superstructure/superstructure_goal_generated.h"
6#include "y2020/control_loops/superstructure/superstructure_output_generated.h"
7
8namespace y2020 {
9namespace control_loops {
10namespace superstructure {
11
12void Climber::Iterate(const Goal *unsafe_goal, OutputT *output) {
13 if (unsafe_goal && output) {
14 // Pass through the voltage request from the user. Backwards isn't
15 // supported, so prevent that.
16 output->climber_voltage =
17 std::clamp(unsafe_goal->climber_voltage(), 0.0f, 12.0f);
18 }
19}
20
21} // namespace superstructure
22} // namespace control_loops
23} // namespace y2020