AP_Mission: Added mavlink_cmd_long_to_mission_cmd method.
This commit is contained in:
parent
a14bdf949a
commit
62a7074dd7
@ -877,6 +877,24 @@ bool AP_Mission::mission_cmd_to_mavlink(const AP_Mission::Mission_Command& cmd,
|
||||
return ans;
|
||||
}
|
||||
|
||||
// mavlink_cmd_long_to_mission_cmd - converts a mavlink cmd long to an AP_Mission::Mission_Command object which can be stored to eeprom
|
||||
// return MAV_MISSION_ACCEPTED on success, MAV_MISSION_RESULT error on failure
|
||||
MAV_MISSION_RESULT AP_Mission::mavlink_cmd_long_to_mission_cmd(const mavlink_command_long_t& packet, AP_Mission::Mission_Command& cmd)
|
||||
{
|
||||
mavlink_mission_item_t miss_item = {0};
|
||||
|
||||
miss_item.param1 = packet.param1;
|
||||
miss_item.param2 = packet.param2;
|
||||
miss_item.param3 = packet.param3;
|
||||
miss_item.param4 = packet.param4;
|
||||
|
||||
miss_item.command = packet.command;
|
||||
miss_item.target_system = packet.target_system;
|
||||
miss_item.target_component = packet.target_component;
|
||||
|
||||
return mavlink_to_mission_cmd(miss_item, cmd);
|
||||
}
|
||||
|
||||
// mission_cmd_to_mavlink - converts an AP_Mission::Mission_Command object to a mavlink message which can be sent to the GCS
|
||||
// return true on success, false on failure
|
||||
bool AP_Mission::mission_cmd_to_mavlink_int(const AP_Mission::Mission_Command& cmd, mavlink_mission_item_int_t& packet)
|
||||
|
@ -377,6 +377,10 @@ public:
|
||||
static MAV_MISSION_RESULT mavlink_to_mission_cmd(const mavlink_mission_item_t& packet, AP_Mission::Mission_Command& cmd);
|
||||
static MAV_MISSION_RESULT mavlink_int_to_mission_cmd(const mavlink_mission_item_int_t& packet, AP_Mission::Mission_Command& cmd);
|
||||
|
||||
// mavlink_cmd_long_to_mission_cmd - converts a mavlink cmd long to an AP_Mission::Mission_Command object which can be stored to eeprom
|
||||
// return MAV_MISSION_ACCEPTED on success, MAV_MISSION_RESULT error on failure
|
||||
static MAV_MISSION_RESULT mavlink_cmd_long_to_mission_cmd(const mavlink_command_long_t& packet, AP_Mission::Mission_Command& cmd);
|
||||
|
||||
// mission_cmd_to_mavlink - converts an AP_Mission::Mission_Command object to a mavlink message which can be sent to the GCS
|
||||
// return true on success, false on failure
|
||||
static bool mission_cmd_to_mavlink(const AP_Mission::Mission_Command& cmd, mavlink_mission_item_t& packet);
|
||||
|
Loading…
Reference in New Issue
Block a user