25 #include <fvmodels/relative_position/omni_relative.h>
30 namespace firevision {
41 this->mirror_model = mirror_model;
43 avg_x = avg_y = avg_x_sum = avg_y_sum = 0.f;
44 avg_x_num = avg_y_num = 0;
46 ball_x = ball_y = bearing = slope = distance_ball_motor = distance_ball_cam = 0.f;
51 DEFAULT_X_VARIANCE = 36.f;
52 DEFAULT_Y_VARIANCE = 25.f;
73 return distance_ball_motor;
103 image_x = (
unsigned int)roundf(x);
104 image_y = (
unsigned int)roundf(y);
139 return "OmniRelative";
145 last_available =
false;
155 distance_ball_cam = rel_pos.
r;
156 bearing = rel_pos.
phi;
159 ball_x = cos(bearing) * distance_ball_cam;
160 ball_y = sin(bearing) * distance_ball_cam;
164 distance_ball_motor = sqrt(ball_x * ball_x + ball_y * ball_y);
179 distance_ball_cam = rel_pos.
r;
180 bearing = rel_pos.
phi;
186 ball_x = cos(bearing) * distance_ball_cam;
187 ball_y = sin(bearing) * distance_ball_cam;
189 distance_ball_motor = sqrt(ball_x * ball_x + ball_y * ball_y);