Hi everyone,
I’m struggling with an issue currently. I’m working on a copter (APM2.8), 3.2.1 release. I’m planning to set a mission via mavlink protocol using an Arduino and its serial port. I’ve written an script and some commands are working properly, for example, ARMING the copter (mavlink_msg_command_long_pack(255, 1, &msg, 1, 0, MAV_CMD_COMPONENT_ARM_DISARM, 0, 1,0,0,0,0,0,0)), CLEAR PREVIOUS MISSION (mavlink_msg_mission_clear_all_pack(255, 1, &msg, 1, 0)).
I’m aware of the mission protocol described in the following link: http://qgroundcontrol.org/mavlink/waypoint_protocol
However, I’m not sure about this protocol due to the old terminology (for example: WAYPOINT_ACK should be MISSION_ACK) and because it’s not working. Anyway, I’ve been trying this protocol, I show you my function calls below(I’m not sure about the function parameters) :
//mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t target_system, uint8_t target_component, uint16_t count)
mavlink_msg_mission_count_pack(255, 1, &msg, 1, 0, 3);
//mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, /float param2, float param3, float param4, float x, float y, float z)
mavlink_msg_mission_item_pack(255, 1, &msg, 1, 0, 0, MAV_FRAME_GLOBAL, MAV_CMD_NAV_TAKEOFF, 0, 0, 0, 0, 0, 0, 0, 0, 25);
//mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,uint8_t target_system, uint8_t target_component,uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z)
mavlink_msg_mission_item_pack(255, 1, &msg, 1, 0, 0, MAV_FRAME_GLOBAL, MAV_CMD_NAV_WAYPOINT, 0, 0, 0, 2, 0, 0, 52.464217, -1.280222, 50);
//mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z)
mavlink_msg_mission_item_pack(255, 1, &msg, 1, 0, 0, MAV_FRAME_GLOBAL, MAV_CMD_NAV_RETURN_TO_LAUNCH, 0, 0, 0, 0, 0, 0, 0, 0, 0);
Can anyone help me with this problem? Are the function parameters correct?
I will really appreciate your help.
Thanks in advance.
Sergi