forked from frc971/971-Robot-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjoystick_reader.cc
63 lines (49 loc) · 2.24 KB
/
joystick_reader.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <unistd.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include "absl/flags/flag.h"
#include "aos/actions/actions.h"
#include "aos/init.h"
#include "aos/logging/logging.h"
#include "aos/network/team_number.h"
#include "aos/util/log_interval.h"
#include "frc971/autonomous/base_autonomous_actor.h"
#include "frc971/constants/constants_sender_lib.h"
#include "frc971/control_loops/drivetrain/localizer_generated.h"
#include "frc971/control_loops/profiled_subsystem_generated.h"
#include "frc971/control_loops/static_zeroing_single_dof_profiled_subsystem.h"
#include "frc971/input/action_joystick_input.h"
#include "frc971/input/driver_station_data.h"
#include "frc971/input/drivetrain_input.h"
#include "frc971/input/joystick_input.h"
#include "frc971/input/redundant_joystick_data.h"
#include "frc971/zeroing/wrap.h"
#include "y2024_bot3/constants/constants_generated.h"
#include "y2024_bot3/control_loops/superstructure/superstructure_goal_static.h"
#include "y2024_bot3/control_loops/superstructure/superstructure_status_static.h"
using frc971::CreateProfileParameters;
using frc971::input::driver_station::ButtonLocation;
using frc971::input::driver_station::ControlBit;
using frc971::input::driver_station::JoystickAxis;
using frc971::input::driver_station::POVLocation;
namespace y2024_bot3::input::joysticks {
namespace superstructure = y2024_bot3::control_loops::superstructure;
// ButtonLocation constants go here
class Reader : public ::frc971::input::ActionJoystickInput {};
} // namespace y2024_bot3::input::joysticks
int main(int argc, char **argv) {
::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("aos_config.json");
frc971::constants::WaitForConstants<y2024_bot3::Constants>(&config.message());
::aos::ShmEventLoop constant_fetcher_event_loop(&config.message());
frc971::constants::ConstantsFetcher<y2024_bot3::Constants> constants_fetcher(
&constant_fetcher_event_loop);
const y2024_bot3::Constants *robot_constants = &constants_fetcher.constants();
::aos::ShmEventLoop event_loop(&config.message());
(void)robot_constants;
//::y2024_bot3::input::joysticks::Reader reader(&event_loop, robot_constants);
event_loop.Run();
return 0;
}