-
Notifications
You must be signed in to change notification settings - Fork 8
/
Control.hpp
55 lines (38 loc) · 1.25 KB
/
Control.hpp
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
/*
* File: Command.hpp
* Author: Jan Dufek
*/
#ifndef CONTROL_HPP
#define CONTROL_HPP
#include "Command.hpp"
#include "Settings.hpp"
// Target was reached
extern bool target_reached;
class Control {
public:
Control();
Control(Settings&);
Control(const Control& orig);
virtual ~Control();
Command * get_control_commands(double, double, double, double, double);
private:
// Returns throttle based on distance to target
double get_throttle(double, double);
void get_distance_to_target(double xe, double ye, double xv, double yv, double& distance_to_target);
void get_target_vector(double xe, double ye, double xv, double yv, double& target_vector);
// Turning throttle
//const double turning_throttle = 0.3;
// This makes USV faster:
const double turning_throttle = 0.4;
// Cruising throttle
//const double cruising_throttle = 0.6;
// This makes USV faster:
const double cruising_throttle = 0.7;
// Slowing distance as multiple of target radius. When this threshold is reached, EMILY will start linearly slowing down.
int slowing_distance = 3;
// Angle difference
double angle_difference;
// Program settings
Settings * settings;
};
#endif /* CONTROL_HPP */