Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_Camera/AP_Camera_MAVLinkCamV2.h
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/1415/*16Camera driver for cameras that implement the newer MAVLink camera v2 protocol17see https://mavlink.io/en/services/camera.html18*/19#pragma once2021#include "AP_Camera_Backend.h"2223#if AP_CAMERA_MAVLINKCAMV2_ENABLED2425class AP_Camera_MAVLinkCamV2 : public AP_Camera_Backend26{27public:2829// Constructor30using AP_Camera_Backend::AP_Camera_Backend;3132/* Do not allow copies */33CLASS_NO_COPY(AP_Camera_MAVLinkCamV2);3435// update - should be called at 50hz36void update() override;3738// entry point to actually take a picture39bool trigger_pic() override;4041// start or stop video recording. returns true on success42// set start_recording = true to start record, false to stop recording43bool record_video(bool start_recording) override;4445// set zoom specified as a rate or percentage46bool set_zoom(ZoomType zoom_type, float zoom_value) override;4748// set focus specified as rate, percentage or auto49// focus in = -1, focus hold = 0, focus out = 150SetFocusResult set_focus(FocusType focus_type, float focus_value) override;5152// handle MAVLink messages from the camera53void handle_message(mavlink_channel_t chan, const mavlink_message_t &msg) override;5455// send camera information message to GCS56void send_camera_information(mavlink_channel_t chan) const override;5758private:5960// search for camera in GCS_MAVLink routing table61void find_camera();6263// request CAMERA_INFORMATION (holds vendor and model name)64void request_camera_information() const;6566// internal members67bool _initialised; // true once the camera has provided a CAMERA_INFORMATION68bool _got_camera_info; // true once camera has provided CAMERA_INFORMATION69mavlink_camera_information_t _cam_info {}; // latest camera information received from camera70uint32_t _last_caminfo_req_ms; // system time that CAMERA_INFORMATION was last requested (used to throttle requests)71class GCS_MAVLINK *_link; // link we have found the camera on. nullptr if not seen yet72uint8_t _sysid; // sysid of camera73uint8_t _compid; // component id of gimbal74};7576#endif // AP_CAMERA_MAVLINKCAMV2_ENABLED777879