APM:Libraries
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AP_Camera Class Reference

#include <AP_Camera.h>

Collaboration diagram for AP_Camera:
[legend]

Public Member Functions

 AP_Camera (AP_Relay *obj_relay, uint32_t _log_camera_bit, const struct Location &_loc, const AP_AHRS &_ahrs)
 
 AP_Camera (const AP_Camera &other)=delete
 
AP_Cameraoperator= (const AP_Camera &)=delete
 
void control_msg (const mavlink_message_t *msg)
 decode deprecated MavLink message that controls camera. More...
 
void send_feedback (mavlink_channel_t chan)
 
void configure (float shooting_mode, float shutter_speed, float aperture, float ISO, float exposure_type, float cmd_id, float engine_cutoff_time)
 
void control (float session, float zoom_pos, float zoom_step, float focus_lock, float shooting_cmd, float cmd_id)
 
void set_trigger_distance (uint32_t distance_m)
 
void take_picture ()
 
void update ()
 
void update_trigger ()
 
void set_is_auto_mode (bool enable)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

void servo_pic ()
 Servo operated camera. More...
 
void relay_pic ()
 basic relay activation More...
 
void feedback_pin_timer ()
 
void setup_feedback_callback (void)
 
void log_picture ()
 
void trigger_pic ()
 
void trigger_pic_cleanup ()
 
bool check_trigger_pin (void)
 
bool using_feedback_pin (void) const
 

Static Private Member Functions

static void capture_callback (void *context, uint32_t chan_index, hrt_abstime edge_time, uint32_t edge_state, uint32_t overflow)
 

Private Attributes

AP_Int8 _trigger_type
 
AP_Int8 _trigger_duration
 
AP_Int8 _relay_on
 
AP_Int16 _servo_on_pwm
 
AP_Int16 _servo_off_pwm
 
uint8_t _trigger_counter
 
AP_Relay_apm_relay
 
AP_Int8 _auto_mode_only
 
bool _is_in_auto_mode
 
AP_Float _trigg_dist
 
AP_Int16 _min_interval
 
AP_Int16 _max_roll
 
uint32_t _last_photo_time
 
struct Location _last_location
 
uint16_t _image_index
 
uint16_t _feedback_events
 
AP_Int8 _feedback_pin
 
AP_Int8 _feedback_polarity
 
bool _timer_installed:1
 
uint8_t _last_pin_state
 
uint32_t log_camera_bit
 
const struct Locationcurrent_loc
 
const AP_AHRSahrs
 

Static Private Attributes

static volatile bool _camera_triggered
 

Detailed Description

Definition at line 31 of file AP_Camera.h.

Constructor & Destructor Documentation

◆ AP_Camera() [1/2]

AP_Camera::AP_Camera ( AP_Relay obj_relay,
uint32_t  _log_camera_bit,
const struct Location _loc,
const AP_AHRS _ahrs 
)
inline

Definition at line 34 of file AP_Camera.h.

Here is the call graph for this function:

◆ AP_Camera() [2/2]

AP_Camera::AP_Camera ( const AP_Camera other)
delete

Member Function Documentation

◆ capture_callback()

void AP_Camera::capture_callback ( void *  context,
uint32_t  chan_index,
hrt_abstime  edge_time,
uint32_t  edge_state,
uint32_t  overflow 
)
staticprivate

Definition at line 349 of file AP_Camera.cpp.

Referenced by setup_feedback_callback().

Here is the caller graph for this function:

◆ check_trigger_pin()

bool AP_Camera::check_trigger_pin ( void  )
private

Definition at line 336 of file AP_Camera.cpp.

Referenced by update_trigger().

Here is the caller graph for this function:

◆ configure()

void AP_Camera::configure ( float  shooting_mode,
float  shutter_speed,
float  aperture,
float  ISO,
float  exposure_type,
float  cmd_id,
float  engine_cutoff_time 
)

Definition at line 189 of file AP_Camera.cpp.

Referenced by AP_Camera(), and GCS_MAVLINK::handle_command_camera().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ control()

void AP_Camera::control ( float  session,
float  zoom_pos,
float  zoom_step,
float  focus_lock,
float  shooting_cmd,
float  cmd_id 
)

Definition at line 214 of file AP_Camera.cpp.

Referenced by AP_Camera(), control_msg(), and GCS_MAVLINK::handle_command_camera().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ control_msg()

void AP_Camera::control_msg ( const mavlink_message_t *  msg)

decode deprecated MavLink message that controls camera.

Definition at line 181 of file AP_Camera.cpp.

Referenced by AP_Camera(), and GCS_MAVLINK::handle_common_camera_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ feedback_pin_timer()

void AP_Camera::feedback_pin_timer ( void  )
private

Definition at line 312 of file AP_Camera.cpp.

Referenced by setup_feedback_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_picture()

void AP_Camera::log_picture ( )
private

Definition at line 400 of file AP_Camera.cpp.

Referenced by trigger_pic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

AP_Camera& AP_Camera::operator= ( const AP_Camera )
delete

Referenced by AP_Camera().

Here is the caller graph for this function:

◆ relay_pic()

void AP_Camera::relay_pic ( )
private

basic relay activation

Definition at line 124 of file AP_Camera.cpp.

Referenced by trigger_pic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_feedback()

void AP_Camera::send_feedback ( mavlink_channel_t  chan)

Definition at line 243 of file AP_Camera.cpp.

Referenced by AP_Camera(), and GCS_MAVLINK::try_send_camera_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ servo_pic()

void AP_Camera::servo_pic ( )
private

Servo operated camera.

Definition at line 114 of file AP_Camera.cpp.

Referenced by trigger_pic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_is_auto_mode()

void AP_Camera::set_is_auto_mode ( bool  enable)
inline

Definition at line 73 of file AP_Camera.h.

◆ set_trigger_distance()

void AP_Camera::set_trigger_distance ( uint32_t  distance_m)
inline

Definition at line 60 of file AP_Camera.h.

Referenced by GCS_MAVLINK::handle_command_camera().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_feedback_callback()

void AP_Camera::setup_feedback_callback ( void  )
private

Definition at line 360 of file AP_Camera.cpp.

Referenced by trigger_pic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ take_picture()

void AP_Camera::take_picture ( )

Definition at line 419 of file AP_Camera.cpp.

Referenced by set_trigger_distance(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trigger_pic()

void AP_Camera::trigger_pic ( )
private

single entry point to take pictures set send_mavlink_msg to true to send DO_DIGICAM_CONTROL message to all components

Definition at line 138 of file AP_Camera.cpp.

Referenced by control(), and take_picture().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trigger_pic_cleanup()

void AP_Camera::trigger_pic_cleanup ( )
private

de-activate the trigger after some delay, but without using a delay() function should be called at 50hz

Definition at line 159 of file AP_Camera.cpp.

Referenced by update_trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void AP_Camera::update ( void  )

Definition at line 267 of file AP_Camera.cpp.

Referenced by set_trigger_distance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_trigger()

void AP_Camera::update_trigger ( )

Definition at line 440 of file AP_Camera.cpp.

Referenced by set_trigger_distance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ using_feedback_pin()

bool AP_Camera::using_feedback_pin ( void  ) const
inlineprivate

Definition at line 129 of file AP_Camera.h.

Referenced by log_picture().

Here is the caller graph for this function:

Member Data Documentation

◆ _apm_relay

AP_Relay* AP_Camera::_apm_relay
private

Definition at line 82 of file AP_Camera.h.

Referenced by AP_Camera(), relay_pic(), and trigger_pic_cleanup().

◆ _auto_mode_only

AP_Int8 AP_Camera::_auto_mode_only
private

Definition at line 83 of file AP_Camera.h.

Referenced by update().

◆ _camera_triggered

volatile bool AP_Camera::_camera_triggered
staticprivate

Definition at line 108 of file AP_Camera.h.

Referenced by capture_callback(), check_trigger_pin(), and feedback_pin_timer().

◆ _feedback_events

uint16_t AP_Camera::_feedback_events
private

Definition at line 101 of file AP_Camera.h.

Referenced by send_feedback(), and update_trigger().

◆ _feedback_pin

AP_Int8 AP_Camera::_feedback_pin
private

Definition at line 104 of file AP_Camera.h.

Referenced by feedback_pin_timer(), and setup_feedback_callback().

◆ _feedback_polarity

AP_Int8 AP_Camera::_feedback_polarity
private

Definition at line 105 of file AP_Camera.h.

Referenced by feedback_pin_timer(), and setup_feedback_callback().

◆ _image_index

uint16_t AP_Camera::_image_index
private

Definition at line 100 of file AP_Camera.h.

Referenced by send_feedback(), and trigger_pic().

◆ _is_in_auto_mode

bool AP_Camera::_is_in_auto_mode
private

Definition at line 84 of file AP_Camera.h.

Referenced by set_is_auto_mode(), and update().

◆ _last_location

struct Location AP_Camera::_last_location
private

Definition at line 99 of file AP_Camera.h.

Referenced by update().

◆ _last_photo_time

uint32_t AP_Camera::_last_photo_time
private

Definition at line 98 of file AP_Camera.h.

Referenced by update().

◆ _last_pin_state

uint8_t AP_Camera::_last_pin_state
private

Definition at line 110 of file AP_Camera.h.

Referenced by feedback_pin_timer().

◆ _max_roll

AP_Int16 AP_Camera::_max_roll
private

Definition at line 97 of file AP_Camera.h.

Referenced by update().

◆ _min_interval

AP_Int16 AP_Camera::_min_interval
private

Definition at line 96 of file AP_Camera.h.

Referenced by update().

◆ _relay_on

AP_Int8 AP_Camera::_relay_on
private

Definition at line 78 of file AP_Camera.h.

Referenced by relay_pic(), and trigger_pic_cleanup().

◆ _servo_off_pwm

AP_Int16 AP_Camera::_servo_off_pwm
private

Definition at line 80 of file AP_Camera.h.

Referenced by trigger_pic_cleanup().

◆ _servo_on_pwm

AP_Int16 AP_Camera::_servo_on_pwm
private

Definition at line 79 of file AP_Camera.h.

Referenced by servo_pic().

◆ _timer_installed

bool AP_Camera::_timer_installed
private

Definition at line 109 of file AP_Camera.h.

Referenced by setup_feedback_callback().

◆ _trigg_dist

AP_Float AP_Camera::_trigg_dist
private

Definition at line 95 of file AP_Camera.h.

Referenced by set_trigger_distance(), and update().

◆ _trigger_counter

uint8_t AP_Camera::_trigger_counter
private

Definition at line 81 of file AP_Camera.h.

Referenced by relay_pic(), servo_pic(), and trigger_pic_cleanup().

◆ _trigger_duration

AP_Int8 AP_Camera::_trigger_duration
private

Definition at line 77 of file AP_Camera.h.

Referenced by relay_pic(), and servo_pic().

◆ _trigger_type

AP_Int8 AP_Camera::_trigger_type
private

Definition at line 76 of file AP_Camera.h.

Referenced by trigger_pic(), and trigger_pic_cleanup().

◆ ahrs

const AP_AHRS& AP_Camera::ahrs
private

Definition at line 116 of file AP_Camera.h.

Referenced by log_picture(), send_feedback(), update(), and update_trigger().

◆ current_loc

const struct Location& AP_Camera::current_loc
private

Definition at line 115 of file AP_Camera.h.

Referenced by log_picture(), send_feedback(), update(), and update_trigger().

◆ log_camera_bit

uint32_t AP_Camera::log_camera_bit
private

Definition at line 114 of file AP_Camera.h.

Referenced by log_picture(), and update_trigger().

◆ var_info

const AP_Param::GroupInfo AP_Camera::var_info
static

Definition at line 70 of file AP_Camera.h.

Referenced by AP_Camera().


The documentation for this class was generated from the following files: