2019-07-16 23:32:05 -03:00
|
|
|
#pragma once
|
|
|
|
|
2022-09-21 10:13:20 -03:00
|
|
|
#include <AP_Rally/AP_Rally.h>
|
2019-07-16 23:32:05 -03:00
|
|
|
|
2022-09-21 09:58:19 -03:00
|
|
|
#if HAL_RALLY_ENABLED
|
|
|
|
|
2022-09-21 10:13:20 -03:00
|
|
|
#include "MissionItemProtocol.h"
|
|
|
|
|
2019-07-16 23:32:05 -03:00
|
|
|
class MissionItemProtocol_Rally : public MissionItemProtocol {
|
|
|
|
public:
|
|
|
|
MissionItemProtocol_Rally(class AP_Rally &_rally) :
|
|
|
|
rally(_rally) {}
|
|
|
|
void truncate(const mavlink_mission_count_t &packet) override;
|
|
|
|
MAV_MISSION_TYPE mission_type() const override { return MAV_MISSION_TYPE_RALLY; }
|
|
|
|
|
2019-08-06 21:23:05 -03:00
|
|
|
MAV_MISSION_RESULT complete(const GCS_MAVLINK &_link) override;
|
2019-07-16 23:32:05 -03:00
|
|
|
void timeout() override;
|
|
|
|
|
2021-04-04 23:45:16 -03:00
|
|
|
/*
|
|
|
|
static function to get rally item as mavlink_mission_item_int_t
|
|
|
|
*/
|
|
|
|
static bool get_item_as_mission_item(uint16_t seq, mavlink_mission_item_int_t &ret_packet);
|
2024-01-23 00:23:15 -04:00
|
|
|
|
|
|
|
static MAV_MISSION_RESULT convert_MISSION_ITEM_INT_to_RallyLocation(const mavlink_mission_item_int_t &cmd, class RallyLocation &ret) WARN_IF_UNUSED;
|
|
|
|
|
2019-07-16 23:32:05 -03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
ap_message next_item_ap_message_id() const override {
|
|
|
|
return MSG_NEXT_MISSION_REQUEST_RALLY;
|
|
|
|
}
|
|
|
|
bool clear_all_items() override WARN_IF_UNUSED;
|
|
|
|
|
|
|
|
private:
|
|
|
|
AP_Rally &rally;
|
|
|
|
|
|
|
|
uint16_t item_count() const override;
|
|
|
|
uint16_t max_items() const override;
|
|
|
|
|
|
|
|
MAV_MISSION_RESULT replace_item(const mavlink_mission_item_int_t&) override WARN_IF_UNUSED;
|
|
|
|
MAV_MISSION_RESULT append_item(const mavlink_mission_item_int_t&) override WARN_IF_UNUSED;
|
|
|
|
|
|
|
|
MAV_MISSION_RESULT get_item(const GCS_MAVLINK &_link,
|
|
|
|
const mavlink_message_t &msg,
|
|
|
|
const mavlink_mission_request_int_t &packet,
|
|
|
|
mavlink_mission_item_int_t &ret_packet) override WARN_IF_UNUSED;
|
|
|
|
|
|
|
|
};
|
2022-09-21 09:58:19 -03:00
|
|
|
|
2022-09-21 10:13:20 -03:00
|
|
|
#endif // HAL_RALLY_ENABLED
|