Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "UASWaypointManager.h"
#include "UAS.h"
UASWaypointManager::UASWaypointManager(UAS &_uas)
: uas(_uas)
{
}
void UASWaypointManager::waypointChanged(Waypoint*)
{
}
void UASWaypointManager::currentWaypointChanged(int)
{
}
void UASWaypointManager::removeWaypointId(int)
{
}
void UASWaypointManager::requestWaypoints()
{
if(current_state == WP_IDLE)
{
mavlink_message_t message;
mavlink_waypoint_request_list_t wprl;
wprl.target_system = uas.getUASID();
wprl.target_system = MAV_COMP_ID_WAYPOINTPLANNER;
current_state = WP_GETLIST;
current_wp_id = 0;
current_partner_systemid = uas.getUASID();
current_partner_compid = MAV_COMP_ID_WAYPOINTPLANNER;
uas.sendMessage(message);
}
}
void UASWaypointManager::handleWaypointCount(quint8 systemId, quint8 compId, quint16 count)
{
if (current_state == WP_GETLIST && systemId == current_partner_systemid && compId == current_partner_compid)
{
current_count = count;
mavlink_message_t message;
mavlink_waypoint_request_t wpr;
wpr.target_system = uas.getUASID();
wpr.target_system = MAV_COMP_ID_WAYPOINTPLANNER;
wpr.seq = current_wp_id;
current_state = WP_GETLIST_GETWPS;
uas.sendMessage(message);
}
}
void UASWaypointManager::getWaypoint(quint16 seq)
{
}
void UASWaypointManager::clearWaypointList()
{
}