固件代码
mavlink_msg_position_target_local_ned_send(
MAVLINK_COMM_0,//chan
AP_HAL::millis(), // time boot ms
MAV_FRAME_LOCAL_NED,
0,
1, // x in metres
2, // y in metres
3, // z in metres NED frame
4, // vx in m/s
5, // vy in m/s
6666, // vz in m/s NED frame
10.0f, // afx
20.0f, // afy
30.0f, // afz
40.0f, // yaw
50.0f); // yaw_rate
pymavlink代码
while 1:
a= self.master.recv_match(type='POSITION_TARGET_LOCAL_NED')
if a:
d = a.to_dict()
结果
POSITION_TARGET_LOCAL_NED {time_boot_ms : 1515870, coordinate_frame : 1, type_mask : 0, x : 1.0, y : 2.0, z : 3.0, vx : 4.0, vy : 5.0, vz : 6666.0, afx : 10.0, afy : 20.0, afz : 30.0, yaw : 40.0, yaw_rate : 50.0} {'coordinate_frame': 1, 'yaw_rate': 50.0, 'vy': 5.0, 'type_mask': 0, 'time_boot_ms': 1515870, 'vx': 4.0, 'afx': 10.0, 'afy': 20.0, 'afz': 30.0, 'x': 1.0, 'y': 2.0, 'mavpackettype': 'POSITION_TARGET_LOCAL_NED', 'vz': 6666.0, 'z': 3.0, 'yaw': 40.0}