Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill px4-hold-mode명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | px4-hold-mode |
| description | PX4 悬停/盘旋模式技能 - 在当前位置上空自动悬停等待指令,适用于等待起飞许可、悬停观察等场景 |
| argument-hint | 悬停 OR Hold Mode OR Loiter OR 盘旋模式 |
| user-invocable | true |
在当前位置上空自动悬停等待指令,可设置时间或手动退出
当需要以下帮助时使用此技能:
hold_mode:
position_lock: CURRENT_POSITION
altitude_control: ALTITUDE_HOLD
heading_control: YAW_HOLD / YAW_RATE
loiter_type:
- horizontal: 小圈盘旋 (NAV_LOITER_RAD)
- stationary: 定点悬停
time_control:
- duration: 定时退出
- manual_exit: 手动切出
| 特性 | 位置模式 | 悬停模式 |
|---|---|---|
| 推杆响应 | 速度控制 | 位置修正 |
| 释放后行为 | 回到原位 | 保持悬停 |
| 适合场景 | 移动飞行 | 定点等待 |
| 抗风能力 | 较好 | 一般 |
# 订阅话题
/fmu/out/vehicle_local_position: 本地位置
/fmu/out/vehicle_odometry: 里程计
/fmu/out/vehicle_attitude: 当前姿态
/fmu/out/loiter_status: 悬停状态
- active: 是否悬停中
- time_remaining: 剩余时间
- heading_lock: 偏航锁定状态
# 发布话题
/fmu/in/vehicle_command: 发送命令
- command: DO_SET_MODE
- mode: LOITER
# 订阅话题
/mavros/local_position/pose: 位置
/mavros/loiter/status: 悬停状态
# 服务
/mavros/cmd/command: 发送命令
- command: MAV_CMD_NAV_LOITER_TIME
- param1: 盘旋圈数/时间
name: loiter_control_skill
description: 盘旋/悬停控制技能
type: control
params:
# 盘旋参数
loiter_radius: {type: float, default: 50.0} # m (正=右转)
loiter_direction: {type: enum, values: [cw, ccw]} # 盘旋方向
# 悬停参数
hover_position: [x, y, z] # 保持位置
hover_tolerance: {type: float, default: 0.5} # m
# 高度控制
hold_altitude: {type: float} # m
altitude_tolerance: {type: float, default: 0.3} # m
control_laws:
position_maintenance:
target: current_position
correction: P(position_error)
altitude_maintenance:
target: hold_altitude
throttle: auto_from_thrust_curve
{ , [, ]}
{ }
{ }
name: timed_loiter_skill
description: 定时悬停技能
type: timed_action
interface:
inputs:
- topic: /loiter_duration
- topic: /cancel_loiter
outputs:
- topic: /loiter_status
params:
duration: {type: float, default: 30.0} # s
exit_mode: {type: enum, values: [auto_return, manual]}
# 自动返回模式
auto_return_action:
- action: resume_mission # 继续任务
- action: rtl # 返航
- action: land # 降落
timeouts:
loiter_timeout: 0 # 0=无限
warning_time: 10.0 # 剩余10秒警告
name: circling_skill
description: 环绕飞行技能
type: flight
params:
center_point: {type: position, unit: m}
radius: {type: float, default: 10.0} # m
altitude: {type: float, default: 30.0} # m
direction: {type: enum, values: [cw, ccw]}
angular_velocity: {type: float, default: 30.0} # deg/s
# 摄像头指向
gimbal_mode: {type: enum, values: [center, forward, nadir]}
gimbal_center: [lat, lon, alt]
loiter_patterns:
circle:
radius: fixed
altitude: fixed
spiral:
radius_change: 1.0 # m/revolution
| 参数 | 说明 | 典型值 |
|---|---|---|
NAV_LOITER_RAD | 盘旋半径 | 50 m |
| `LOITER_JERK | 盘旋加加速度限制 | 1.0 m/s³ |
MPC_XY_CRUISE | 巡航速度 | 5.0 m/s |
MPC_Z_VEL_MAX_UP | 最大上升速度 | 3.0 m/s |
MPC_Z_VEL_MAX_DN | 最大下降速度 | 1.5 m/s |
loiter_direction:
# 右转 (常用)
right_hand: positive_radius
# 左转
left_hand: negative_radius
# 根据任务自动选择
auto: shortest_turn_to_next_waypoint
# 1. 基本悬停测试
起飞到 5m → 切换到 Loiter → 观察位置保持
# 2. 抗风测试
人工制造气流 → 观察位置修正
# 3. 长时间悬停
悬停 5 分钟 → 观察电池消耗和位置漂移
# 4. 切换测试
Loiter → Position → Loiter → 验证位置一致
loiter_performance:
position_accuracy: ±1.0m (GPS)
position_accuracy: ±0.3m (RTK)
altitude_accuracy: ±0.5m
battery_consumption: ~5% per 5 min (varies by model)
heading_stability: ±5°
recovery_from_wind:
max_drift: 2.0m
recovery_time: < 3s
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 位置漂移大 | GPS 精度差 | 等待更多卫星 |
| 高度不稳定 | 气压漂移 | 使用测距仪定高 |
| 盘旋半径不稳 | 速度P值问题 | 调整 MPC_XY_VEL_P |
| 无法进入悬停 | 位置模式未激活 | 先切换到 Position |
| 偏航持续旋转 | 偏航控制问题 | 检查偏航参数 |
px4-position-mode: 位置模式(悬停的基础)px4-mission-mode: 任务模式(航点间暂停)px4-rtl-mode: RTL 模式(悬停后可接 RTL)px4-landing: 着陆模式(悬停后可接着陆)