GIMBAL_MANAGER_SET_PITCHYAW 287

Field Name
Type
Units
Values
Description
target_system
uint8_t
System ID
target_component
uint8_t
Component ID
flags
uint32_t

512
gimbal_device_id
uint8_t
1
pitch
float
deg
俯仰角(正值向上, 负值向下, ).




返回command = MAV_CMD_REQUEST_MESSAGE
返回值 param1 33 执行命令id
返回值 param2 0或1 是否执行成功
返回值 param3 失败代码
失败代码列表
0 无异常
1 无法初始化云台控制
2 无法设置云台模式
3 云台到达限位
4 云台无法执行命令

python测试脚本

import time
# Import mavutil
from pymavlink import mavutil

# Create the connection
master = mavutil.mavlink_connection('udpin:0.0.0.0:14550')
# Wait a heartbeat before sending commands
master.wait_heartbeat()

def look_at(pitch):
    master.mav.gimbal_manager_set_pitchyaw_send(
        master.target_system,
        master.target_component,
        mavutil.mavlink.GIMBAL_MANAGER_FLAGS_RC_MIXED,
        1,
        pitch,
        0,
        0,0)

# make camera up and down
look_at(10)
time.sleep(5)
look_at(-10)
作者:bai  创建时间:2024-09-14 16:14
最后编辑:bai  更新时间:2024-09-27 11:15
gimbal_device_id 为1时为固定角度旋转gimbal_device_id 为2时为速度旋转 角度以10hz频率发送gimbal_device_id 为3时为云台回中gimbal_device_id 为4时为云台绝对角度控制范围为 -90 到 45 单位deg