CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_Camera/AP_Camera_Mount.h
Views: 1798
1
/*
2
This program is free software: you can redistribute it and/or modify
3
it under the terms of the GNU General Public License as published by
4
the Free Software Foundation, either version 3 of the License, or
5
(at your option) any later version.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
11
12
You should have received a copy of the GNU General Public License
13
along with this program. If not, see <http://www.gnu.org/licenses/>.
14
*/
15
16
/*
17
Camera driver for cameras included in Mount
18
*/
19
#pragma once
20
21
#include "AP_Camera_Backend.h"
22
23
#if AP_CAMERA_MOUNT_ENABLED
24
25
#include "AP_Camera.h"
26
27
class AP_Camera_Mount : public AP_Camera_Backend
28
{
29
public:
30
31
// Constructor
32
using AP_Camera_Backend::AP_Camera_Backend;
33
34
/* Do not allow copies */
35
CLASS_NO_COPY(AP_Camera_Mount);
36
37
// entry point to actually take a picture. returns true on success
38
bool trigger_pic() override;
39
40
// start or stop video recording. returns true on success
41
// set start_recording = true to start record, false to stop recording
42
bool record_video(bool start_recording) override;
43
44
// set zoom specified as a rate or percentage
45
bool set_zoom(ZoomType zoom_type, float zoom_value) override;
46
47
// set focus specified as rate, percentage or auto
48
// focus in = -1, focus hold = 0, focus out = 1
49
SetFocusResult set_focus(FocusType focus_type, float focus_value) override;
50
51
// set tracking to none, point or rectangle (see TrackingType enum)
52
// if POINT only p1 is used, if RECTANGLE then p1 is top-left, p2 is bottom-right
53
// p1,p2 are in range 0 to 1. 0 is left or top, 1 is right or bottom
54
bool set_tracking(TrackingType tracking_type, const Vector2f& p1, const Vector2f& p2) override;
55
56
// set camera lens as a value from 0 to 5
57
bool set_lens(uint8_t lens) override;
58
59
#if AP_CAMERA_SET_CAMERA_SOURCE_ENABLED
60
// set_camera_source is functionally the same as set_lens except primary and secondary lenses are specified by type
61
bool set_camera_source(AP_Camera::CameraSource primary_source, AP_Camera::CameraSource secondary_source) override;
62
#endif // AP_CAMERA_SET_CAMERA_SOURCE_ENABLED
63
64
// send camera information message to GCS
65
void send_camera_information(mavlink_channel_t chan) const override;
66
67
// send camera settings message to GCS
68
void send_camera_settings(mavlink_channel_t chan) const override;
69
70
// send camera capture status message to GCS
71
void send_camera_capture_status(mavlink_channel_t chan) const override;
72
73
#if AP_CAMERA_SEND_THERMAL_RANGE_ENABLED
74
// send camera thermal range message to GCS
75
void send_camera_thermal_range(mavlink_channel_t chan) const override;
76
#endif
77
78
#if AP_CAMERA_SCRIPTING_ENABLED
79
// change camera settings not normally used by autopilot
80
bool change_setting(CameraSetting setting, float value) override;
81
#endif
82
};
83
84
#endif // AP_CAMERA_MOUNT_ENABLED
85
86