void adjust_trajectory(void) {
// 1. 实时定位
float lat, lon, alt;
get_realtime_position(&lat, &lon, &alt);
// 2. 计算速度
float speed;
get_speed(&speed);
// 3. 引导计算
float correction;
calculate_guidance(lat, lon, alt, speed, &correction);
// 4. 调整轨迹
apply_correction(correction);
}
int main(void) {
// 5. 重复定位和引导
while (!has_reached_target()) {
adjust_trajectory();
}
return 0;
}