-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvehicle.h
53 lines (42 loc) · 1.08 KB
/
vehicle.h
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
#ifndef PATH_PLANNING_VEHICLE_H
#define PATH_PLANNING_VEHICLE_H
#include <map>
#include <string>
#include <vector>
using std::map;
using std::string;
using std::vector;
double const CONTROLLER_WAYPOINT_INTERVAL = 0.02; // Time-interval for the controller to achieve successive waypoints.
double const SAFE_FRENET_S_DISTANCE = 30.0;
double const MAXIMUM_SPEED = 49.5; // in mph.
double const MAXIMUM_ACCELERATION = 0.225;
double const MPH_TO_METRE_PER_SEC = 2.237;
struct Waypoints {
vector<double> waypoints_x;
vector<double> waypoints_y;
};
class Vehicle {
public:
Vehicle();
Vehicle(double vx, double vy, double s, double d, int id=-1);
virtual ~Vehicle() = default;
enum Lane {
LEFT_LANE,
CENTRE_LANE,
RIGHT_LANE,
INVALID_LANE = -1
};
// Localisation and Kinematics getters.
int getVehicleLane();
double getVehicleSpeed();
double getProjectedSCoordinate(int numPastWaypoints);
private:
int id;
double vx;
double vy;
double s;
double d;
Lane lane;
Vehicle::Lane computeVehicleLane(double d_coordinate);
};
#endif //PATH_PLANNING_VEHICLE_H