2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
vibration.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <units/time.h>
8
9#include <functional>
10
11namespace argos_lib {
12
17 double intensityLeft = 0.0;
18 double intensityRight = 0.0;
19 };
20
21 using VibrationModel = std::function<VibrationStatus()>;
22
29
36 VibrationModel VibrationConstant(double intensity);
37
45 VibrationModel VibrationConstant(double intensityLeft, double intensityRight);
46
56 VibrationModel VibrationSyncPulse(units::millisecond_t pulsePeriod, double intensityOn, double intensityOff = 0.0);
57
67 VibrationModel VibrationSyncWave(units::millisecond_t pulsePeriod, double intensityOn, double intensityOff = 0.0);
68
79 VibrationModel VibrationAlternatePulse(units::millisecond_t pulsePeriod,
80 double intensityOn,
81 double intensityOff = 0.0);
82
93 VibrationModel VibrationAlternateWave(units::millisecond_t pulsePeriod,
94 double intensityOn,
95 double intensityOff = 0.0);
96
106 units::millisecond_t temporaryModelDuration,
107 VibrationModel lastingModel = VibrationOff());
108
109} // namespace argos_lib
Definition swap_controllers_command.h:12
VibrationModel VibrationAlternateWave(units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0)
Smoothly transition vibration between intensityOn and intensityOff levels. Left output is in intensit...
Definition vibration.cpp:66
VibrationModel VibrationOff()
Turn off vibration.
Definition vibration.cpp:12
VibrationModel VibrationConstant(double intensity)
Set vibration to a constant value where left and right are the same intensity.
Definition vibration.cpp:16
VibrationModel VibrationAlternatePulse(units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0)
Toggle vibration between intensityOn and intensityOff levels. Left output is in intensityOn phase whi...
Definition vibration.cpp:38
VibrationModel TemporaryVibrationPattern(VibrationModel temporaryModel, units::millisecond_t temporaryModelDuration, VibrationModel lastingModel=VibrationOff())
Run a vibration model for a specified duration, then run another model in perpetuity thereafter.
Definition vibration.cpp:83
VibrationModel VibrationSyncWave(units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0)
Smoothly transition vibration between intensityOn and intensityOff levels. Left and right have the sa...
Definition vibration.cpp:52
std::function< VibrationStatus()> VibrationModel
Definition vibration.h:21
VibrationModel VibrationSyncPulse(units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0)
Toggle vibration between intensityOn and intensityOff levels. Left and right have the same vibration ...
Definition vibration.cpp:24
Vibration percentages that can be sent to controller for user feedback.
Definition vibration.h:16
double intensityRight
Intensity percent for right vibration [0,1.0].
Definition vibration.h:18
double intensityLeft
Intensity percent for left vibration [0,1.0].
Definition vibration.h:17