一、任务
基于四旋翼飞行器设计一个灭火飞行器(简称飞行器)。飞行器活动区域示意图如图1所示。在图1中,左下方的圆形区域是飞行器起飞及降落点;右侧正方形区域是灭火防区,防区中有4个用红色LED模拟的火源(火源用单只0.5W红色发光二极管来实现,建议LED电流不超过25mA)。飞行器起飞后从A处进入防区,并以指定巡航高度在防区巡逻;发现防区有火源,用激光笔发射激光束的方式模拟灭火操作;所有火源全部熄灭后,飞行器从B处飞离防区返航,返航途中需穿越一个矩形框。从起飞到降落的整个操作过程不得超过5分钟,时间越短越好。
二、要求
三、说明
GPT-4o给出的设计方案:
飞行器组件:
传感器:
灭火装置:
1. 起飞与悬停:
void takeoff_and_hover(float target_height, float hover_time) {
activate_motors();
reach_height(target_height);
delay(hover_time);
}
void activate_motors() {
// 初始化电机控制
}
void reach_height(float target_height) {
// 使用高度传感器和PID控制算法达到目标高度
}
void nav_to_A_and_patrol() {
navigate_to_A();
patrol_in_A();
}
void navigate_to_A() {
// 使用GPS和IMU导航到A点区域
}
void patrol_in_A() {
// 实现防火区内巡航路径规划
}
2. 火源检测与灭火:
void detect_and_extinguish_fire() {
if (detect_fire_source()) {
hover_over_fire_source();
activate_laser_for_extinguish();
}
}
bool detect_fire_source() {
// 使用传感器或摄像头检测火源位置
return new_fire_detected;
}
void hover_over_fire_source() {
// 调整飞行器位置,悬停在火源上方20cm处
}
void activate_laser_for_extinguish() {
activate_laser();
delay(2); // 激光笔照射火源2秒以上
deactivate_laser();
}
3. 返回B点并着陆:
void return_and_land_at_B() {
navigate_to_B();
land_at_B();
}
void navigate_to_B() {
// GPS导航到B点
}
void land_at_B() {
reduce_altitude(0);
deactivate_motors();
}
void reduce_altitude(float target_height) {
// 使用PID控制算法降落到目标高度
}
void deactivate_motors() {
// 关闭电机
}
初步测试:
火源检测测试:
实际测试与调优:
这个题目考察的主要知识点:
这个题目考察了无人机飞控技术,涉及应用的硬件和传感器(如GPS、高度传感器、激光笔等),飞行器的编程和控制(包括起飞、悬停、巡航、火源检测与熄灭,以及返回与降落的自动化控制),以及路径规划和实时图像分析(用于火源检测和精确定位)。