Path: blob/master/libraries/AP_Camera/AP_Camera_Servo.h
9677 views
/*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 servo driver backend class17*/18#pragma once1920#include "AP_Camera_Backend.h"2122#if AP_CAMERA_SERVO_ENABLED2324class AP_Camera_Servo : public AP_Camera_Backend25{26public:2728// Constructor29using AP_Camera_Backend::AP_Camera_Backend;3031/* Do not allow copies */32CLASS_NO_COPY(AP_Camera_Servo);3334// update - should be called at 50hz35void update() override;3637// set zoom specified as a rate or percentage38bool set_zoom(ZoomType zoom_type, float zoom_value) override;3940// set focus specified as rate, percentage or auto41// focus in = -1, focus hold = 0, focus out = 142SetFocusResult set_focus(FocusType focus_type, float focus_value) override;4344// entry point to actually take a picture. returns true on success45bool trigger_pic() override;4647// send camera settings message to GCS48void send_camera_settings(mavlink_channel_t chan) const override;4950// configure camera51void configure(float shooting_mode, float shutter_speed, float aperture, float ISO, int32_t exposure_type, int32_t cmd_id, float engine_cutoff_time) override;5253// initialize the AP_Camera_Servo driver54void init() override;5556private:57float zoom_current_rate; // current zoom rate of change58float focus_current_rate; // current focus rate of change59uint16_t trigger_counter; // count of number of cycles shutter should be held open60uint16_t iso_counter; // count of number of cycles iso output should be held open61};6263#endif // AP_CAMERA_SERVO_ENABLED646566