I’m a Rookie in coding,and i have project which using QT create a UI to control my rov2.below is my code in qt creator.
mavlink_message_t msg;
uint8_t buf[MAVLINK_MAX_PACKET_LEN];
//test servo
mavlink_msg_command_long_pack(255, // System ID
1, // Component ID
&msg, // MAVLink message
0, // Target system ID
0, // Target component ID
MAV_CMD_DO_SET_SERVO, // Command ID
0, // Confirmation
2,
1700, 0, 0, 0, 0,0); // Parameters
qint64 len2 =mavlink_msg_to_send_buffer((uint8_t*)buf,&msg);
m_udpsend->writeDatagram((const char*)buf,QHostAddress("192.168.2.1"),14550);
I can recieve rov message(like heartbeat) from udp connection,but when sending these codes,rov have no reflect.
by the way I qdebug “(const char*)buf” in outpout,it is “0x74ca19”,is normal and corret?
thank u.