• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mavlink / MAVSDK / 12401616260

18 Dec 2024 09:26PM UTC coverage: 44.627% (+1.0%) from 43.59%
12401616260

push

github

web-flow
Support Mission Download In Mission Raw Server (#2463)

* Add mission download support (air to ground) in mission raw server

* Removed unused private variable

* Point proto back to mavlink root

---------

Co-authored-by: Jon Reeves <jon.reeves@elroyair.com>

667 of 723 new or added lines in 3 files covered. (92.25%)

3 existing lines in 3 files now uncovered.

14584 of 32680 relevant lines covered (44.63%)

284.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

3.96
/src/mavsdk/plugins/mission_raw_server/mission_raw_server.cpp
1
// WARNING: THIS FILE IS AUTOGENERATED! As such, it should not be edited.
2
// Edits need to be made to the proto files
3
// (see
4
// https://github.com/mavlink/MAVSDK-Proto/blob/master/protos/mission_raw_server/mission_raw_server.proto)
5

6
#include <iomanip>
7

8
#include "mission_raw_server_impl.h"
9
#include "plugins/mission_raw_server/mission_raw_server.h"
10

11
namespace mavsdk {
12

13
using MissionItem = MissionRawServer::MissionItem;
14
using MissionPlan = MissionRawServer::MissionPlan;
15
using MissionProgress = MissionRawServer::MissionProgress;
16

17
MissionRawServer::MissionRawServer(std::shared_ptr<ServerComponent> server_component) :
1✔
18
    ServerPluginBase(),
19
    _impl{std::make_unique<MissionRawServerImpl>(server_component)}
1✔
20
{}
1✔
21

22
MissionRawServer::~MissionRawServer() {}
1✔
23

24
MissionRawServer::IncomingMissionHandle
25
MissionRawServer::subscribe_incoming_mission(const IncomingMissionCallback& callback)
×
26
{
27
    return _impl->subscribe_incoming_mission(callback);
×
28
}
29

30
void MissionRawServer::unsubscribe_incoming_mission(IncomingMissionHandle handle)
×
31
{
32
    _impl->unsubscribe_incoming_mission(handle);
×
33
}
×
34

35
MissionRawServer::CurrentItemChangedHandle
UNCOV
36
MissionRawServer::subscribe_current_item_changed(const CurrentItemChangedCallback& callback)
×
37
{
38
    return _impl->subscribe_current_item_changed(callback);
×
39
}
40

41
void MissionRawServer::unsubscribe_current_item_changed(CurrentItemChangedHandle handle)
×
42
{
43
    _impl->unsubscribe_current_item_changed(handle);
×
44
}
×
45

46
void MissionRawServer::set_current_item_complete() const
×
47
{
48
    _impl->set_current_item_complete();
×
49
}
×
50

51
MissionRawServer::ClearAllHandle
52
MissionRawServer::subscribe_clear_all(const ClearAllCallback& callback)
×
53
{
54
    return _impl->subscribe_clear_all(callback);
×
55
}
56

57
void MissionRawServer::unsubscribe_clear_all(ClearAllHandle handle)
×
58
{
59
    _impl->unsubscribe_clear_all(handle);
×
60
}
×
61

62
bool operator==(const MissionRawServer::MissionItem& lhs, const MissionRawServer::MissionItem& rhs)
×
63
{
64
    return (rhs.seq == lhs.seq) && (rhs.frame == lhs.frame) && (rhs.command == lhs.command) &&
×
65
           (rhs.current == lhs.current) && (rhs.autocontinue == lhs.autocontinue) &&
×
66
           ((std::isnan(rhs.param1) && std::isnan(lhs.param1)) || rhs.param1 == lhs.param1) &&
×
67
           ((std::isnan(rhs.param2) && std::isnan(lhs.param2)) || rhs.param2 == lhs.param2) &&
×
68
           ((std::isnan(rhs.param3) && std::isnan(lhs.param3)) || rhs.param3 == lhs.param3) &&
×
69
           ((std::isnan(rhs.param4) && std::isnan(lhs.param4)) || rhs.param4 == lhs.param4) &&
×
70
           (rhs.x == lhs.x) && (rhs.y == lhs.y) &&
×
71
           ((std::isnan(rhs.z) && std::isnan(lhs.z)) || rhs.z == lhs.z) &&
×
72
           (rhs.mission_type == lhs.mission_type);
×
73
}
74

75
std::ostream& operator<<(std::ostream& str, MissionRawServer::MissionItem const& mission_item)
×
76
{
77
    str << std::setprecision(15);
×
78
    str << "mission_item:" << '\n' << "{\n";
×
79
    str << "    seq: " << mission_item.seq << '\n';
×
80
    str << "    frame: " << mission_item.frame << '\n';
×
81
    str << "    command: " << mission_item.command << '\n';
×
82
    str << "    current: " << mission_item.current << '\n';
×
83
    str << "    autocontinue: " << mission_item.autocontinue << '\n';
×
84
    str << "    param1: " << mission_item.param1 << '\n';
×
85
    str << "    param2: " << mission_item.param2 << '\n';
×
86
    str << "    param3: " << mission_item.param3 << '\n';
×
87
    str << "    param4: " << mission_item.param4 << '\n';
×
88
    str << "    x: " << mission_item.x << '\n';
×
89
    str << "    y: " << mission_item.y << '\n';
×
90
    str << "    z: " << mission_item.z << '\n';
×
91
    str << "    mission_type: " << mission_item.mission_type << '\n';
×
92
    str << '}';
×
93
    return str;
×
94
}
95

96
bool operator==(const MissionRawServer::MissionPlan& lhs, const MissionRawServer::MissionPlan& rhs)
×
97
{
98
    return (rhs.mission_items == lhs.mission_items);
×
99
}
100

101
std::ostream& operator<<(std::ostream& str, MissionRawServer::MissionPlan const& mission_plan)
×
102
{
103
    str << std::setprecision(15);
×
104
    str << "mission_plan:" << '\n' << "{\n";
×
105
    str << "    mission_items: [";
×
106
    for (auto it = mission_plan.mission_items.begin(); it != mission_plan.mission_items.end();
×
107
         ++it) {
×
108
        str << *it;
×
109
        str << (it + 1 != mission_plan.mission_items.end() ? ", " : "]\n");
×
110
    }
111
    str << '}';
×
112
    return str;
×
113
}
114

115
bool operator==(
×
116
    const MissionRawServer::MissionProgress& lhs, const MissionRawServer::MissionProgress& rhs)
117
{
118
    return (rhs.current == lhs.current) && (rhs.total == lhs.total);
×
119
}
120

121
std::ostream&
122
operator<<(std::ostream& str, MissionRawServer::MissionProgress const& mission_progress)
×
123
{
124
    str << std::setprecision(15);
×
125
    str << "mission_progress:" << '\n' << "{\n";
×
126
    str << "    current: " << mission_progress.current << '\n';
×
127
    str << "    total: " << mission_progress.total << '\n';
×
128
    str << '}';
×
129
    return str;
×
130
}
131

132
std::ostream& operator<<(std::ostream& str, MissionRawServer::Result const& result)
×
133
{
134
    switch (result) {
×
135
        case MissionRawServer::Result::Unknown:
×
136
            return str << "Unknown";
×
137
        case MissionRawServer::Result::Success:
×
138
            return str << "Success";
×
139
        case MissionRawServer::Result::Error:
×
140
            return str << "Error";
×
141
        case MissionRawServer::Result::TooManyMissionItems:
×
142
            return str << "Too Many Mission Items";
×
143
        case MissionRawServer::Result::Busy:
×
144
            return str << "Busy";
×
145
        case MissionRawServer::Result::Timeout:
×
146
            return str << "Timeout";
×
147
        case MissionRawServer::Result::InvalidArgument:
×
148
            return str << "Invalid Argument";
×
149
        case MissionRawServer::Result::Unsupported:
×
150
            return str << "Unsupported";
×
151
        case MissionRawServer::Result::NoMissionAvailable:
×
152
            return str << "No Mission Available";
×
153
        case MissionRawServer::Result::UnsupportedMissionCmd:
×
154
            return str << "Unsupported Mission Cmd";
×
155
        case MissionRawServer::Result::TransferCancelled:
×
156
            return str << "Transfer Cancelled";
×
157
        case MissionRawServer::Result::NoSystem:
×
158
            return str << "No System";
×
159
        case MissionRawServer::Result::Next:
×
160
            return str << "Next";
×
161
        default:
×
162
            return str << "Unknown";
×
163
    }
164
}
165

166
} // namespace mavsdk
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc