-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathControlCommunicator.h
More file actions
33 lines (26 loc) · 1010 Bytes
/
ControlCommunicator.h
File metadata and controls
33 lines (26 loc) · 1010 Bytes
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
#ifndef CONTROL_COMMUNICATOR_HPP
#define CONTROL_COMMUNICATOR_HPP
#include <cmath>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <cstring>
#include "PitchLookupModel.hpp"
#include "messages.h"
class ControlCommunicator
{
public:
ControlCommunicator() {}
~ControlCommunicator() {}
// Class methods
int aim(float bullet_speed, float target_x, float target_y, float target_z, float &yaw, float &pitch, bool &impossible);
void compute_aim(float bullet_speed, float target_x, float target_y, float target_z, float &yaw, float &pitch, bool &impossible);
bool start_uart_connection(const char *port);
bool read_uart(int port_fd, PackageIn &package, const char *port);
PitchLookupModel *lut = new PitchLookupModel("/home/purduerm/ros2-ws/auto-aiming/src/prm_control/control_communicator/include/lookup_tables/pitch_lookup_table.txt");
int port_fd = -1;
const char *port;
bool is_connected = false;
private:
};
#endif // CONTROL_COMMUNICATOR_HPP