Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
imu_terminal_serial_handler.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_TERMINAL_SERIAL_HANDLER_HPP_
25#define TAPROOT_IMU_TERMINAL_SERIAL_HANDLER_HPP_
26
28#include "tap/util_macros.hpp"
29
30#include "modm/architecture/interface/register.hpp"
31
32#include "abstract_imu.hpp"
33
34namespace tap
35{
36class Drivers;
37}
38
40{
47{
48public:
51 imu(imu),
52 subjectsBeingInspected(0)
53 {
54 }
55
56 mockable void init();
57
59 char* inputLine,
60 modm::IOStream& outputStream,
61 bool streamingEnabled) override;
62
63 void terminalSerialStreamCallback(modm::IOStream& outputStream) override;
64
65private:
67 static constexpr char USAGE[] =
68 " [-h] [angle] [gyro] [accel] [temp]\n"
69 " Where:\n"
70 " - [-h] Prints usage\n"
71 " - [angle] Prints angle data\n"
72 " - [gyro] Prints gyro data\n"
73 " - [accel] Prints accel data\n"
74 " - [temp] Prints temp data\n";
75
76 Drivers* drivers;
77
78 AbstractIMU* imu;
79
85 enum InspectSubject : uint8_t
86 {
87 ANGLES = 1,
88 GYRO = 1 << 1,
89 ACCEL = 1 << 2,
90 TEMP = 1 << 3
91 };
92
93 MODM_FLAGS8(InspectSubject);
94
102 InspectSubject_t subjectsBeingInspected;
103
104 void printHeader(modm::IOStream& outputStream);
105}; // class ImuTerminalSerialHandler
106} // namespace tap::communication::sensors::imu
107
108#endif // TAPROOT_MPU6500_TERMINAL_SERIAL_HANDLER_HPP_
Definition drivers.hpp:70
Definition abstract_imu.hpp:45
Definition imu_terminal_serial_handler.hpp:47
void terminalSerialStreamCallback(modm::IOStream &outputStream) override
Definition imu_terminal_serial_handler.cpp:118
mockable void init()
Definition imu_terminal_serial_handler.cpp:36
ImuTerminalSerialHandler(Drivers *drivers, AbstractIMU *imu)
Definition imu_terminal_serial_handler.hpp:49
bool terminalSerialCallback(char *inputLine, modm::IOStream &outputStream, bool streamingEnabled) override
Definition imu_terminal_serial_handler.cpp:38
Definition abstract_imu.cpp:26
Definition ballistics.cpp:29
tap::Drivers Drivers
Definition drivers.hpp:11
fang::Drivers & drivers
Definition robot_singleton.cpp:45
#define mockable
Wrap class functions that are not already virtual in this function if you wish to mock them.
Definition util_macros.hpp:38