-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot_sample.cpp
More file actions
56 lines (51 loc) · 1016 Bytes
/
bot_sample.cpp
File metadata and controls
56 lines (51 loc) · 1016 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "bot_sample.hpp"
#include "utils.hpp"
bot_sample::bot_sample(e_robot id)
: area(0.0)
, id(id)
{
}
bot_sample::~bot_sample()
{
}
void bot_sample::set_center(const cv::Point ¢er)
{
this->center = center;
}
void bot_sample::set_orientation(const cv::Point &orient_vector)
{
this->orientation = orient_vector;
}
void bot_sample::set_speed(const cv::Point &speed_vector)
{
this->speed = speed_vector;
}
void bot_sample::set_shape(const std::vector<cv::Point> &shape)
{
this->shape.assign(shape.begin(), shape.end());
this->area = polygon_area(shape);
}
e_robot bot_sample::get_id() const
{
return id;
}
cv::Point bot_sample::get_center() const
{
return center;
}
cv::Point bot_sample::get_orientation() const
{
return orientation;
}
cv::Point bot_sample::get_speed() const
{
return speed;
}
std::vector<cv::Point> bot_sample::get_shape() const
{
return shape;
}
double bot_sample::get_area() const
{
return area;
}