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

mavlink / MAVSDK / 4899817366

pending completion
4899817366

Pull #1772

github

GitHub
Merge c0bb90862 into e4e9c71dd
Pull Request #1772: Refactor MAVLinkParameters into client and server classes

2192 of 2192 new or added lines in 34 files covered. (100.0%)

7708 of 24812 relevant lines covered (31.07%)

19.96 hits per line

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

1.04
/src/mavsdk/plugins/camera/camera.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 https://github.com/mavlink/MAVSDK-Proto/blob/master/protos/camera/camera.proto)
4

5
#include <iomanip>
6

7
#include "camera_impl.h"
8
#include "plugins/camera/camera.h"
9

10
namespace mavsdk {
11

12
using Position = Camera::Position;
13
using Quaternion = Camera::Quaternion;
14
using EulerAngle = Camera::EulerAngle;
15
using CaptureInfo = Camera::CaptureInfo;
16
using VideoStreamSettings = Camera::VideoStreamSettings;
17
using VideoStreamInfo = Camera::VideoStreamInfo;
18
using Status = Camera::Status;
19
using Option = Camera::Option;
20
using Setting = Camera::Setting;
21
using SettingOptions = Camera::SettingOptions;
22
using Information = Camera::Information;
23

24
Camera::Camera(System& system) : PluginBase(), _impl{std::make_unique<CameraImpl>(system)} {}
×
25

26
Camera::Camera(std::shared_ptr<System> system) :
1✔
27
    PluginBase(),
28
    _impl{std::make_unique<CameraImpl>(system)}
1✔
29
{}
1✔
30

31
Camera::~Camera() {}
1✔
32

33
void Camera::prepare_async(const ResultCallback callback)
×
34
{
35
    _impl->prepare_async(callback);
×
36
}
×
37

38
Camera::Result Camera::prepare() const
×
39
{
40
    return _impl->prepare();
×
41
}
42

43
void Camera::take_photo_async(const ResultCallback callback)
×
44
{
45
    _impl->take_photo_async(callback);
×
46
}
×
47

48
Camera::Result Camera::take_photo() const
×
49
{
50
    return _impl->take_photo();
×
51
}
52

53
void Camera::start_photo_interval_async(float interval_s, const ResultCallback callback)
×
54
{
55
    _impl->start_photo_interval_async(interval_s, callback);
×
56
}
×
57

58
Camera::Result Camera::start_photo_interval(float interval_s) const
×
59
{
60
    return _impl->start_photo_interval(interval_s);
×
61
}
62

63
void Camera::stop_photo_interval_async(const ResultCallback callback)
×
64
{
65
    _impl->stop_photo_interval_async(callback);
×
66
}
×
67

68
Camera::Result Camera::stop_photo_interval() const
×
69
{
70
    return _impl->stop_photo_interval();
×
71
}
72

73
void Camera::start_video_async(const ResultCallback callback)
×
74
{
75
    _impl->start_video_async(callback);
×
76
}
×
77

78
Camera::Result Camera::start_video() const
×
79
{
80
    return _impl->start_video();
×
81
}
82

83
void Camera::stop_video_async(const ResultCallback callback)
×
84
{
85
    _impl->stop_video_async(callback);
×
86
}
×
87

88
Camera::Result Camera::stop_video() const
×
89
{
90
    return _impl->stop_video();
×
91
}
92

93
Camera::Result Camera::start_video_streaming() const
×
94
{
95
    return _impl->start_video_streaming();
×
96
}
97

98
Camera::Result Camera::stop_video_streaming() const
×
99
{
100
    return _impl->stop_video_streaming();
×
101
}
102

103
void Camera::set_mode_async(Mode mode, const ResultCallback callback)
×
104
{
105
    _impl->set_mode_async(mode, callback);
×
106
}
×
107

108
Camera::Result Camera::set_mode(Mode mode) const
×
109
{
110
    return _impl->set_mode(mode);
×
111
}
112

113
void Camera::list_photos_async(PhotosRange photos_range, const ListPhotosCallback callback)
×
114
{
115
    _impl->list_photos_async(photos_range, callback);
×
116
}
×
117

118
std::pair<Camera::Result, std::vector<Camera::CaptureInfo>>
119
Camera::list_photos(PhotosRange photos_range) const
×
120
{
121
    return _impl->list_photos(photos_range);
×
122
}
123

124
Camera::ModeHandle Camera::subscribe_mode(const ModeCallback& callback)
×
125
{
126
    return _impl->subscribe_mode(callback);
×
127
}
128

129
void Camera::unsubscribe_mode(ModeHandle handle)
×
130
{
131
    _impl->unsubscribe_mode(handle);
×
132
}
×
133

134
Camera::Mode Camera::mode() const
×
135
{
136
    return _impl->mode();
×
137
}
138

139
Camera::InformationHandle Camera::subscribe_information(const InformationCallback& callback)
×
140
{
141
    return _impl->subscribe_information(callback);
×
142
}
143

144
void Camera::unsubscribe_information(InformationHandle handle)
×
145
{
146
    _impl->unsubscribe_information(handle);
×
147
}
×
148

149
Camera::Information Camera::information() const
×
150
{
151
    return _impl->information();
×
152
}
153

154
Camera::VideoStreamInfoHandle
155
Camera::subscribe_video_stream_info(const VideoStreamInfoCallback& callback)
×
156
{
157
    return _impl->subscribe_video_stream_info(callback);
×
158
}
159

160
void Camera::unsubscribe_video_stream_info(VideoStreamInfoHandle handle)
×
161
{
162
    _impl->unsubscribe_video_stream_info(handle);
×
163
}
×
164

165
Camera::VideoStreamInfo Camera::video_stream_info() const
×
166
{
167
    return _impl->video_stream_info();
×
168
}
169

170
Camera::CaptureInfoHandle Camera::subscribe_capture_info(const CaptureInfoCallback& callback)
×
171
{
172
    return _impl->subscribe_capture_info(callback);
×
173
}
174

175
void Camera::unsubscribe_capture_info(CaptureInfoHandle handle)
×
176
{
177
    _impl->unsubscribe_capture_info(handle);
×
178
}
×
179

180
Camera::StatusHandle Camera::subscribe_status(const StatusCallback& callback)
×
181
{
182
    return _impl->subscribe_status(callback);
×
183
}
184

185
void Camera::unsubscribe_status(StatusHandle handle)
×
186
{
187
    _impl->unsubscribe_status(handle);
×
188
}
×
189

190
Camera::Status Camera::status() const
×
191
{
192
    return _impl->status();
×
193
}
194

195
Camera::CurrentSettingsHandle
196
Camera::subscribe_current_settings(const CurrentSettingsCallback& callback)
×
197
{
198
    return _impl->subscribe_current_settings(callback);
×
199
}
200

201
void Camera::unsubscribe_current_settings(CurrentSettingsHandle handle)
×
202
{
203
    _impl->unsubscribe_current_settings(handle);
×
204
}
×
205

206
Camera::PossibleSettingOptionsHandle
207
Camera::subscribe_possible_setting_options(const PossibleSettingOptionsCallback& callback)
×
208
{
209
    return _impl->subscribe_possible_setting_options(callback);
×
210
}
211

212
void Camera::unsubscribe_possible_setting_options(PossibleSettingOptionsHandle handle)
×
213
{
214
    _impl->unsubscribe_possible_setting_options(handle);
×
215
}
×
216

217
std::vector<Camera::SettingOptions> Camera::possible_setting_options() const
×
218
{
219
    return _impl->possible_setting_options();
×
220
}
221

222
void Camera::set_setting_async(Setting setting, const ResultCallback callback)
×
223
{
224
    _impl->set_setting_async(setting, callback);
×
225
}
×
226

227
Camera::Result Camera::set_setting(Setting setting) const
×
228
{
229
    return _impl->set_setting(setting);
×
230
}
231

232
void Camera::get_setting_async(Setting setting, const GetSettingCallback callback)
×
233
{
234
    _impl->get_setting_async(setting, callback);
×
235
}
×
236

237
std::pair<Camera::Result, Camera::Setting> Camera::get_setting(Setting setting) const
×
238
{
239
    return _impl->get_setting(setting);
×
240
}
241

242
void Camera::format_storage_async(const ResultCallback callback)
×
243
{
244
    _impl->format_storage_async(callback);
×
245
}
×
246

247
Camera::Result Camera::format_storage() const
×
248
{
249
    return _impl->format_storage();
×
250
}
251

252
Camera::Result Camera::select_camera(int32_t camera_id) const
×
253
{
254
    return _impl->select_camera(camera_id);
×
255
}
256

257
std::ostream& operator<<(std::ostream& str, Camera::Result const& result)
×
258
{
259
    switch (result) {
×
260
        case Camera::Result::Unknown:
×
261
            return str << "Unknown";
×
262
        case Camera::Result::Success:
×
263
            return str << "Success";
×
264
        case Camera::Result::InProgress:
×
265
            return str << "In Progress";
×
266
        case Camera::Result::Busy:
×
267
            return str << "Busy";
×
268
        case Camera::Result::Denied:
×
269
            return str << "Denied";
×
270
        case Camera::Result::Error:
×
271
            return str << "Error";
×
272
        case Camera::Result::Timeout:
×
273
            return str << "Timeout";
×
274
        case Camera::Result::WrongArgument:
×
275
            return str << "Wrong Argument";
×
276
        case Camera::Result::NoSystem:
×
277
            return str << "No System";
×
278
        case Camera::Result::ProtocolUnsupported:
×
279
            return str << "Protocol Unsupported";
×
280
        default:
×
281
            return str << "Unknown";
×
282
    }
283
}
284

285
bool operator==(const Camera::Position& lhs, const Camera::Position& rhs)
×
286
{
287
    return ((std::isnan(rhs.latitude_deg) && std::isnan(lhs.latitude_deg)) ||
×
288
            rhs.latitude_deg == lhs.latitude_deg) &&
×
289
           ((std::isnan(rhs.longitude_deg) && std::isnan(lhs.longitude_deg)) ||
×
290
            rhs.longitude_deg == lhs.longitude_deg) &&
×
291
           ((std::isnan(rhs.absolute_altitude_m) && std::isnan(lhs.absolute_altitude_m)) ||
×
292
            rhs.absolute_altitude_m == lhs.absolute_altitude_m) &&
×
293
           ((std::isnan(rhs.relative_altitude_m) && std::isnan(lhs.relative_altitude_m)) ||
×
294
            rhs.relative_altitude_m == lhs.relative_altitude_m);
×
295
}
296

297
std::ostream& operator<<(std::ostream& str, Camera::Position const& position)
×
298
{
299
    str << std::setprecision(15);
×
300
    str << "position:" << '\n' << "{\n";
×
301
    str << "    latitude_deg: " << position.latitude_deg << '\n';
×
302
    str << "    longitude_deg: " << position.longitude_deg << '\n';
×
303
    str << "    absolute_altitude_m: " << position.absolute_altitude_m << '\n';
×
304
    str << "    relative_altitude_m: " << position.relative_altitude_m << '\n';
×
305
    str << '}';
×
306
    return str;
×
307
}
308

309
bool operator==(const Camera::Quaternion& lhs, const Camera::Quaternion& rhs)
×
310
{
311
    return ((std::isnan(rhs.w) && std::isnan(lhs.w)) || rhs.w == lhs.w) &&
×
312
           ((std::isnan(rhs.x) && std::isnan(lhs.x)) || rhs.x == lhs.x) &&
×
313
           ((std::isnan(rhs.y) && std::isnan(lhs.y)) || rhs.y == lhs.y) &&
×
314
           ((std::isnan(rhs.z) && std::isnan(lhs.z)) || rhs.z == lhs.z);
×
315
}
316

317
std::ostream& operator<<(std::ostream& str, Camera::Quaternion const& quaternion)
×
318
{
319
    str << std::setprecision(15);
×
320
    str << "quaternion:" << '\n' << "{\n";
×
321
    str << "    w: " << quaternion.w << '\n';
×
322
    str << "    x: " << quaternion.x << '\n';
×
323
    str << "    y: " << quaternion.y << '\n';
×
324
    str << "    z: " << quaternion.z << '\n';
×
325
    str << '}';
×
326
    return str;
×
327
}
328

329
bool operator==(const Camera::EulerAngle& lhs, const Camera::EulerAngle& rhs)
×
330
{
331
    return ((std::isnan(rhs.roll_deg) && std::isnan(lhs.roll_deg)) ||
×
332
            rhs.roll_deg == lhs.roll_deg) &&
×
333
           ((std::isnan(rhs.pitch_deg) && std::isnan(lhs.pitch_deg)) ||
×
334
            rhs.pitch_deg == lhs.pitch_deg) &&
×
335
           ((std::isnan(rhs.yaw_deg) && std::isnan(lhs.yaw_deg)) || rhs.yaw_deg == lhs.yaw_deg);
×
336
}
337

338
std::ostream& operator<<(std::ostream& str, Camera::EulerAngle const& euler_angle)
×
339
{
340
    str << std::setprecision(15);
×
341
    str << "euler_angle:" << '\n' << "{\n";
×
342
    str << "    roll_deg: " << euler_angle.roll_deg << '\n';
×
343
    str << "    pitch_deg: " << euler_angle.pitch_deg << '\n';
×
344
    str << "    yaw_deg: " << euler_angle.yaw_deg << '\n';
×
345
    str << '}';
×
346
    return str;
×
347
}
348

349
bool operator==(const Camera::CaptureInfo& lhs, const Camera::CaptureInfo& rhs)
×
350
{
351
    return (rhs.position == lhs.position) && (rhs.attitude_quaternion == lhs.attitude_quaternion) &&
×
352
           (rhs.attitude_euler_angle == lhs.attitude_euler_angle) &&
×
353
           (rhs.time_utc_us == lhs.time_utc_us) && (rhs.is_success == lhs.is_success) &&
×
354
           (rhs.index == lhs.index) && (rhs.file_url == lhs.file_url);
×
355
}
356

357
std::ostream& operator<<(std::ostream& str, Camera::CaptureInfo const& capture_info)
×
358
{
359
    str << std::setprecision(15);
×
360
    str << "capture_info:" << '\n' << "{\n";
×
361
    str << "    position: " << capture_info.position << '\n';
×
362
    str << "    attitude_quaternion: " << capture_info.attitude_quaternion << '\n';
×
363
    str << "    attitude_euler_angle: " << capture_info.attitude_euler_angle << '\n';
×
364
    str << "    time_utc_us: " << capture_info.time_utc_us << '\n';
×
365
    str << "    is_success: " << capture_info.is_success << '\n';
×
366
    str << "    index: " << capture_info.index << '\n';
×
367
    str << "    file_url: " << capture_info.file_url << '\n';
×
368
    str << '}';
×
369
    return str;
×
370
}
371

372
bool operator==(const Camera::VideoStreamSettings& lhs, const Camera::VideoStreamSettings& rhs)
×
373
{
374
    return ((std::isnan(rhs.frame_rate_hz) && std::isnan(lhs.frame_rate_hz)) ||
×
375
            rhs.frame_rate_hz == lhs.frame_rate_hz) &&
×
376
           (rhs.horizontal_resolution_pix == lhs.horizontal_resolution_pix) &&
×
377
           (rhs.vertical_resolution_pix == lhs.vertical_resolution_pix) &&
×
378
           (rhs.bit_rate_b_s == lhs.bit_rate_b_s) && (rhs.rotation_deg == lhs.rotation_deg) &&
×
379
           (rhs.uri == lhs.uri) &&
×
380
           ((std::isnan(rhs.horizontal_fov_deg) && std::isnan(lhs.horizontal_fov_deg)) ||
×
381
            rhs.horizontal_fov_deg == lhs.horizontal_fov_deg);
×
382
}
383

384
std::ostream&
385
operator<<(std::ostream& str, Camera::VideoStreamSettings const& video_stream_settings)
×
386
{
387
    str << std::setprecision(15);
×
388
    str << "video_stream_settings:" << '\n' << "{\n";
×
389
    str << "    frame_rate_hz: " << video_stream_settings.frame_rate_hz << '\n';
×
390
    str << "    horizontal_resolution_pix: " << video_stream_settings.horizontal_resolution_pix
×
391
        << '\n';
×
392
    str << "    vertical_resolution_pix: " << video_stream_settings.vertical_resolution_pix << '\n';
×
393
    str << "    bit_rate_b_s: " << video_stream_settings.bit_rate_b_s << '\n';
×
394
    str << "    rotation_deg: " << video_stream_settings.rotation_deg << '\n';
×
395
    str << "    uri: " << video_stream_settings.uri << '\n';
×
396
    str << "    horizontal_fov_deg: " << video_stream_settings.horizontal_fov_deg << '\n';
×
397
    str << '}';
×
398
    return str;
×
399
}
400

401
std::ostream&
402
operator<<(std::ostream& str, Camera::VideoStreamInfo::VideoStreamStatus const& video_stream_status)
×
403
{
404
    switch (video_stream_status) {
×
405
        case Camera::VideoStreamInfo::VideoStreamStatus::NotRunning:
×
406
            return str << "Not Running";
×
407
        case Camera::VideoStreamInfo::VideoStreamStatus::InProgress:
×
408
            return str << "In Progress";
×
409
        default:
×
410
            return str << "Unknown";
×
411
    }
412
}
413

414
std::ostream& operator<<(
×
415
    std::ostream& str, Camera::VideoStreamInfo::VideoStreamSpectrum const& video_stream_spectrum)
416
{
417
    switch (video_stream_spectrum) {
×
418
        case Camera::VideoStreamInfo::VideoStreamSpectrum::Unknown:
×
419
            return str << "Unknown";
×
420
        case Camera::VideoStreamInfo::VideoStreamSpectrum::VisibleLight:
×
421
            return str << "Visible Light";
×
422
        case Camera::VideoStreamInfo::VideoStreamSpectrum::Infrared:
×
423
            return str << "Infrared";
×
424
        default:
×
425
            return str << "Unknown";
×
426
    }
427
}
428
bool operator==(const Camera::VideoStreamInfo& lhs, const Camera::VideoStreamInfo& rhs)
×
429
{
430
    return (rhs.settings == lhs.settings) && (rhs.status == lhs.status) &&
×
431
           (rhs.spectrum == lhs.spectrum);
×
432
}
433

434
std::ostream& operator<<(std::ostream& str, Camera::VideoStreamInfo const& video_stream_info)
×
435
{
436
    str << std::setprecision(15);
×
437
    str << "video_stream_info:" << '\n' << "{\n";
×
438
    str << "    settings: " << video_stream_info.settings << '\n';
×
439
    str << "    status: " << video_stream_info.status << '\n';
×
440
    str << "    spectrum: " << video_stream_info.spectrum << '\n';
×
441
    str << '}';
×
442
    return str;
×
443
}
444

445
std::ostream& operator<<(std::ostream& str, Camera::Status::StorageStatus const& storage_status)
×
446
{
447
    switch (storage_status) {
×
448
        case Camera::Status::StorageStatus::NotAvailable:
×
449
            return str << "Not Available";
×
450
        case Camera::Status::StorageStatus::Unformatted:
×
451
            return str << "Unformatted";
×
452
        case Camera::Status::StorageStatus::Formatted:
×
453
            return str << "Formatted";
×
454
        case Camera::Status::StorageStatus::NotSupported:
×
455
            return str << "Not Supported";
×
456
        default:
×
457
            return str << "Unknown";
×
458
    }
459
}
460

461
std::ostream& operator<<(std::ostream& str, Camera::Status::StorageType const& storage_type)
×
462
{
463
    switch (storage_type) {
×
464
        case Camera::Status::StorageType::Unknown:
×
465
            return str << "Unknown";
×
466
        case Camera::Status::StorageType::UsbStick:
×
467
            return str << "Usb Stick";
×
468
        case Camera::Status::StorageType::Sd:
×
469
            return str << "Sd";
×
470
        case Camera::Status::StorageType::Microsd:
×
471
            return str << "Microsd";
×
472
        case Camera::Status::StorageType::Hd:
×
473
            return str << "Hd";
×
474
        case Camera::Status::StorageType::Other:
×
475
            return str << "Other";
×
476
        default:
×
477
            return str << "Unknown";
×
478
    }
479
}
480
bool operator==(const Camera::Status& lhs, const Camera::Status& rhs)
×
481
{
482
    return (rhs.video_on == lhs.video_on) && (rhs.photo_interval_on == lhs.photo_interval_on) &&
×
483
           ((std::isnan(rhs.used_storage_mib) && std::isnan(lhs.used_storage_mib)) ||
×
484
            rhs.used_storage_mib == lhs.used_storage_mib) &&
×
485
           ((std::isnan(rhs.available_storage_mib) && std::isnan(lhs.available_storage_mib)) ||
×
486
            rhs.available_storage_mib == lhs.available_storage_mib) &&
×
487
           ((std::isnan(rhs.total_storage_mib) && std::isnan(lhs.total_storage_mib)) ||
×
488
            rhs.total_storage_mib == lhs.total_storage_mib) &&
×
489
           ((std::isnan(rhs.recording_time_s) && std::isnan(lhs.recording_time_s)) ||
×
490
            rhs.recording_time_s == lhs.recording_time_s) &&
×
491
           (rhs.media_folder_name == lhs.media_folder_name) &&
×
492
           (rhs.storage_status == lhs.storage_status) && (rhs.storage_id == lhs.storage_id) &&
×
493
           (rhs.storage_type == lhs.storage_type);
×
494
}
495

496
std::ostream& operator<<(std::ostream& str, Camera::Status const& status)
×
497
{
498
    str << std::setprecision(15);
×
499
    str << "status:" << '\n' << "{\n";
×
500
    str << "    video_on: " << status.video_on << '\n';
×
501
    str << "    photo_interval_on: " << status.photo_interval_on << '\n';
×
502
    str << "    used_storage_mib: " << status.used_storage_mib << '\n';
×
503
    str << "    available_storage_mib: " << status.available_storage_mib << '\n';
×
504
    str << "    total_storage_mib: " << status.total_storage_mib << '\n';
×
505
    str << "    recording_time_s: " << status.recording_time_s << '\n';
×
506
    str << "    media_folder_name: " << status.media_folder_name << '\n';
×
507
    str << "    storage_status: " << status.storage_status << '\n';
×
508
    str << "    storage_id: " << status.storage_id << '\n';
×
509
    str << "    storage_type: " << status.storage_type << '\n';
×
510
    str << '}';
×
511
    return str;
×
512
}
513

514
bool operator==(const Camera::Option& lhs, const Camera::Option& rhs)
×
515
{
516
    return (rhs.option_id == lhs.option_id) && (rhs.option_description == lhs.option_description);
×
517
}
518

519
std::ostream& operator<<(std::ostream& str, Camera::Option const& option)
×
520
{
521
    str << std::setprecision(15);
×
522
    str << "option:" << '\n' << "{\n";
×
523
    str << "    option_id: " << option.option_id << '\n';
×
524
    str << "    option_description: " << option.option_description << '\n';
×
525
    str << '}';
×
526
    return str;
×
527
}
528

529
bool operator==(const Camera::Setting& lhs, const Camera::Setting& rhs)
×
530
{
531
    return (rhs.setting_id == lhs.setting_id) &&
×
532
           (rhs.setting_description == lhs.setting_description) && (rhs.option == lhs.option) &&
×
533
           (rhs.is_range == lhs.is_range);
×
534
}
535

536
std::ostream& operator<<(std::ostream& str, Camera::Setting const& setting)
×
537
{
538
    str << std::setprecision(15);
×
539
    str << "setting:" << '\n' << "{\n";
×
540
    str << "    setting_id: " << setting.setting_id << '\n';
×
541
    str << "    setting_description: " << setting.setting_description << '\n';
×
542
    str << "    option: " << setting.option << '\n';
×
543
    str << "    is_range: " << setting.is_range << '\n';
×
544
    str << '}';
×
545
    return str;
×
546
}
547

548
bool operator==(const Camera::SettingOptions& lhs, const Camera::SettingOptions& rhs)
×
549
{
550
    return (rhs.setting_id == lhs.setting_id) &&
×
551
           (rhs.setting_description == lhs.setting_description) && (rhs.options == lhs.options) &&
×
552
           (rhs.is_range == lhs.is_range);
×
553
}
554

555
std::ostream& operator<<(std::ostream& str, Camera::SettingOptions const& setting_options)
×
556
{
557
    str << std::setprecision(15);
×
558
    str << "setting_options:" << '\n' << "{\n";
×
559
    str << "    setting_id: " << setting_options.setting_id << '\n';
×
560
    str << "    setting_description: " << setting_options.setting_description << '\n';
×
561
    str << "    options: [";
×
562
    for (auto it = setting_options.options.begin(); it != setting_options.options.end(); ++it) {
×
563
        str << *it;
×
564
        str << (it + 1 != setting_options.options.end() ? ", " : "]\n");
×
565
    }
566
    str << "    is_range: " << setting_options.is_range << '\n';
×
567
    str << '}';
×
568
    return str;
×
569
}
570

571
bool operator==(const Camera::Information& lhs, const Camera::Information& rhs)
×
572
{
573
    return (rhs.vendor_name == lhs.vendor_name) && (rhs.model_name == lhs.model_name) &&
×
574
           ((std::isnan(rhs.focal_length_mm) && std::isnan(lhs.focal_length_mm)) ||
×
575
            rhs.focal_length_mm == lhs.focal_length_mm) &&
×
576
           ((std::isnan(rhs.horizontal_sensor_size_mm) &&
×
577
             std::isnan(lhs.horizontal_sensor_size_mm)) ||
×
578
            rhs.horizontal_sensor_size_mm == lhs.horizontal_sensor_size_mm) &&
×
579
           ((std::isnan(rhs.vertical_sensor_size_mm) && std::isnan(lhs.vertical_sensor_size_mm)) ||
×
580
            rhs.vertical_sensor_size_mm == lhs.vertical_sensor_size_mm) &&
×
581
           (rhs.horizontal_resolution_px == lhs.horizontal_resolution_px) &&
×
582
           (rhs.vertical_resolution_px == lhs.vertical_resolution_px);
×
583
}
584

585
std::ostream& operator<<(std::ostream& str, Camera::Information const& information)
×
586
{
587
    str << std::setprecision(15);
×
588
    str << "information:" << '\n' << "{\n";
×
589
    str << "    vendor_name: " << information.vendor_name << '\n';
×
590
    str << "    model_name: " << information.model_name << '\n';
×
591
    str << "    focal_length_mm: " << information.focal_length_mm << '\n';
×
592
    str << "    horizontal_sensor_size_mm: " << information.horizontal_sensor_size_mm << '\n';
×
593
    str << "    vertical_sensor_size_mm: " << information.vertical_sensor_size_mm << '\n';
×
594
    str << "    horizontal_resolution_px: " << information.horizontal_resolution_px << '\n';
×
595
    str << "    vertical_resolution_px: " << information.vertical_resolution_px << '\n';
×
596
    str << '}';
×
597
    return str;
×
598
}
599

600
std::ostream& operator<<(std::ostream& str, Camera::Mode const& mode)
×
601
{
602
    switch (mode) {
×
603
        case Camera::Mode::Unknown:
×
604
            return str << "Unknown";
×
605
        case Camera::Mode::Photo:
×
606
            return str << "Photo";
×
607
        case Camera::Mode::Video:
×
608
            return str << "Video";
×
609
        default:
×
610
            return str << "Unknown";
×
611
    }
612
}
613

614
std::ostream& operator<<(std::ostream& str, Camera::PhotosRange const& photos_range)
×
615
{
616
    switch (photos_range) {
×
617
        case Camera::PhotosRange::All:
×
618
            return str << "All";
×
619
        case Camera::PhotosRange::SinceConnection:
×
620
            return str << "Since Connection";
×
621
        default:
×
622
            return str << "Unknown";
×
623
    }
624
}
625

626
} // 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

© 2025 Coveralls, Inc