/* shoot on distance */ uint8_t dc_distance(float interval) { dc_autoshoot = DC_AUTOSHOOT_DISTANCE; dc_gps_count = 0; dc_distance_interval = interval; last_shot_pos.x = 0; last_shot_pos.y = 0; dc_info(); return 0; }
/* shoot on circle */ uint8_t dc_circle(float interval, float start) { dc_autoshoot = DC_AUTOSHOOT_CIRCLE; dc_gps_count = 0; dc_circle_interval = fmodf(fmaxf(interval, 1.), 360.); if(start == DC_IGNORE) { start = DegOfRad(stateGetNedToBodyEulers_f()->psi); } dc_circle_start_angle = fmodf(start, 360.); if (start < 0.) start += 360.; //dc_circle_last_block = floorf(dc_circle_start_angle/dc_circle_interval); dc_circle_last_block = 0; dc_circle_max_blocks = floorf(360./dc_circle_interval); dc_info(); return 0; }
/* shoot on survey */ uint8_t dc_survey(float interval, float x, float y) { dc_autoshoot = DC_AUTOSHOOT_SURVEY; dc_gps_count = 0; dc_gps_dist = interval; if (x == DC_IGNORE && y == DC_IGNORE) { dc_gps_x = estimator_x; dc_gps_y = estimator_y; } else if (y == DC_IGNORE) { dc_gps_x = waypoints[(uint8_t)x].x; dc_gps_y = waypoints[(uint8_t)x].y; } else { dc_gps_x = x; dc_gps_y = y; } dc_gps_next_dist = 0; dc_info(); return 0; }
/* shoot on survey */ uint8_t dc_survey(float interval, float x, float y) { dc_autoshoot = DC_AUTOSHOOT_SURVEY; dc_gps_count = 0; dc_survey_interval = interval; if (x == DC_IGNORE && y == DC_IGNORE) { dc_gps_x = stateGetPositionEnu_f()->x; dc_gps_y = stateGetPositionEnu_f()->y; } else if (y == DC_IGNORE) { uint8_t wp = (uint8_t)x; dc_gps_x = WaypointX(wp); dc_gps_y = WaypointY(wp); } else { dc_gps_x = x; dc_gps_y = y; } dc_gps_next_dist = 0; dc_info(); return 0; }
uint8_t dc_stop(void) { dc_autoshoot = DC_AUTOSHOOT_STOP; dc_info(); return 0; }