|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <remote.hpp>
Public Types | |
| enum class | Channel { RIGHT_HORIZONTAL , RIGHT_VERTICAL , LEFT_HORIZONTAL , LEFT_VERTICAL , WHEEL } |
| enum class | Switch { LEFT_SWITCH , RIGHT_SWITCH } |
| enum class | SwitchState { UNKNOWN = 0 , UP = 1 , DOWN = 2 , MID = 3 } |
| enum class | Key { W = 0 , S , A , D , SHIFT , CTRL , Q , E , R , F , G , Z , X , C , V , B } |
Public Member Functions | |
| Remote (Drivers *drivers) | |
| mockable | ~Remote ()=default |
| mockable void | initialize () |
| mockable void | read () |
| mockable bool | isConnected () const |
| mockable float | getChannel (Channel ch) const |
| mockable SwitchState | getSwitch (Switch sw) const |
| mockable int16_t | getMouseX () const |
| mockable int16_t | getMouseY () const |
| mockable int16_t | getMouseZ () const |
| mockable bool | getMouseL () const |
| mockable bool | getMouseR () const |
| mockable bool | keyPressed (Key key) const |
| mockable uint32_t | getUpdateCounter () const |
A unique UART handler that uses timing in leu of DBUS communication (modm does not support DBUS) to interact with the DR16 receiver.
Information for implementation was translated from a user manual for the DR16 that was only available in Chinese. AI-Translated version of document available here: https://drive.google.com/file/d/1-ZGe4mXVhxP4IEmHccphnzKzYWJyw3C3/view?usp=sharing
|
strong |
|
strong |
|
strong |
|
strong |
|
inline |
|
default |
| float tap::communication::serial::Remote::getChannel | ( | Channel | ch | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Remote::SwitchState tap::communication::serial::Remote::getSwitch | ( | Switch | sw | ) | const |
| uint32_t tap::communication::serial::Remote::getUpdateCounter | ( | ) | const |
| void tap::communication::serial::Remote::initialize | ( | ) |
Enables and initializes bound_ports::REMOTE_SERIAL_UART_PORT.
| bool tap::communication::serial::Remote::isConnected | ( | ) | const |
true if the remote is connected, false otherwise. true if the given key is pressed, false otherwise. | void tap::communication::serial::Remote::read | ( | ) |
Reads/parses the current buffer and updates the current remote info state and CommandMapper state.