forked from StevensDeptECE/robosim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
robot.hh
43 lines (33 loc) · 1.48 KB
/
robot.hh
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
#pragma once
/*
Author : Ming-Hung Yen and Aleksandar Dimoski and Tim Demetriades
*/
#include <vector>
#include "vec_3d.hh"
#include "beacon.hh"
#include <string>
class robot {
private:
string name; // name of the robot
vec_3d location; // the real location of this robot in the simulation
vec_3d estLocation; // the estimated location based on navigation, which will have gaussian error
double BatteryLife; // current battery life left in the robot
double posVarHoriz; // horizontal variance for random error
double posVarVert; // vertical variance for random error
double heading; // horizontal direction from 0 to 2pi
double speed; // speed in forward direction
double headingVert; // vertical direction from 0 to 2pi
public:
// Constructor
robot(string name, double x, double y, double z, double posVarHoriz,
double posVarVert, double heading, double speed, double headingVert,
double BatteryLife = 100);
robot(string name, const vec_3d& pos, double posVarHoriz, double posVarVert,
double heading, double speed, double headingVert, double BatteryLife = 100);
void move(double time);
vec_3d getEstLocation(vector<beacon> beacons);
vec_3d getLocation() const { return location; }
double getBatLife() const { return BatteryLife; }
string getName() const { return name; }
friend std::ostream& operator<<(std::ostream& a, robot& xyz);
};