Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
move_command.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_MOVE_COMMAND_HPP_
25#define TAPROOT_MOVE_COMMAND_HPP_
26
32
33#include "modm/math/filter/pid.hpp"
34
35namespace tap
36{
37namespace control
38{
39namespace setpoint
40{
49{
50public:
70 SetpointSubsystem* setpointSubsystem,
71 float targetDisplacement,
72 uint32_t moveTime,
73 uint32_t pauseAfterMoveTime,
74 bool setToTargetOnEnd,
75 float setpointTolerance);
76
77 const char* getName() const override { return "move command"; }
78
79 bool isReady() override
80 {
81 return !setpointSubsystem->isJammed() && setpointSubsystem->isOnline();
82 }
83
84 void initialize() override;
85
86 void execute() override;
87
88 void end(bool interrupted) override;
89
90 bool isFinished() const override;
91
92private:
93 SetpointSubsystem* setpointSubsystem;
94
99 float targetDisplacement;
100
101 tap::algorithms::Ramp rampToTargetValue;
102
106 uint32_t moveTime;
107
108 tap::arch::MilliTimeout minMoveTimeout;
109
110 uint32_t pauseAfterMoveTime;
111
112 float setpointTolerance;
113
114 uint32_t previousMoveTime;
115
116 bool setToTargetOnEnd;
117}; // class MoveCommand
118
119} // namespace setpoint
120
121} // namespace control
122
123} // namespace tap
124
125#endif // TAPROOT_MOVE_COMMAND_HPP_
Definition ramp.hpp:43
Definition timeout.hpp:44
Definition command.hpp:44
Definition move_command.hpp:49
void execute() override
Definition move_command.cpp:69
bool isFinished() const override
Definition move_command.cpp:109
bool isReady() override
Definition move_command.hpp:79
void end(bool interrupted) override
Definition move_command.cpp:92
void initialize() override
Definition move_command.cpp:54
const char * getName() const override
Definition move_command.hpp:77
Definition setpoint_subsystem.hpp:48
Definition ballistics.cpp:29