HoloLib
High-performance holonomic (X-Drive) control library for VEX V5
Loading...
Searching...
No Matches
replay.h
Go to the documentation of this file.
1#pragma once
2
3#include "api.h"
4#include "hololib/pose.h"
5#include <functional>
6#include <vector>
7
8/**
9 * @brief A snapshot of joystick and pose data for macro recording/playback.
10 */
11struct ReplayData {
12 float forwards, sideways, rotation; /**< Raw joystick outputs */
13 Pose pose; /**< Captured pose at the time */
14};
15
16/**
17 * @brief Links a controller button to a lambda callback function.
18 */
20 pros::controller_digital_e_t button; /**< The specific controller button */
21 std::function<void()> callback; /**< The callback to execute when pressed */
22};
23
24/**
25 * @brief List of predefined controller button callbacks.
26 */
27inline std::vector<ControllerButton> controllerButtons{
28 {pros::E_CONTROLLER_DIGITAL_UP, []() {}},
29 {pros::E_CONTROLLER_DIGITAL_DOWN, []() {}},
30 {pros::E_CONTROLLER_DIGITAL_LEFT, []() {}},
31 {pros::E_CONTROLLER_DIGITAL_RIGHT, []() {}},
32 {pros::E_CONTROLLER_DIGITAL_A, []() {}},
33 {pros::E_CONTROLLER_DIGITAL_B, []() {}},
34 {pros::E_CONTROLLER_DIGITAL_X, []() {}},
35 {pros::E_CONTROLLER_DIGITAL_Y, []() {}},
36 {pros::E_CONTROLLER_DIGITAL_L1, []() {}},
37 {pros::E_CONTROLLER_DIGITAL_L2, []() {}},
38 {pros::E_CONTROLLER_DIGITAL_R1, []() {}},
39 {pros::E_CONTROLLER_DIGITAL_R2, []() {}},
40
41};
std::vector< ControllerButton > controllerButtons
List of predefined controller button callbacks.
Definition replay.h:27
Links a controller button to a lambda callback function.
Definition replay.h:19
std::function< void()> callback
The callback to execute when pressed.
Definition replay.h:21
pros::controller_digital_e_t button
The specific controller button.
Definition replay.h:20
Contains global coordinates and velocity.
Definition pose.h:15
A snapshot of joystick and pose data for macro recording/playback.
Definition replay.h:11
float forwards
Definition replay.h:12
float rotation
Raw joystick outputs.
Definition replay.h:12
Pose pose
Captured pose at the time.
Definition replay.h:13
float sideways
Definition replay.h:12