AP_Camera: call update in update_trigger

This commit is contained in:
Mirko Denecke 2020-06-22 22:32:21 +02:00 committed by Randy Mackay
parent 12c9578a66
commit 2dfc7c4108
2 changed files with 9 additions and 6 deletions

View File

@ -49,7 +49,7 @@ const AP_Param::GroupInfo AP_Camera::var_info[] = {
// @Param: TRIGG_DIST // @Param: TRIGG_DIST
// @DisplayName: Camera trigger distance // @DisplayName: Camera trigger distance
// @Description: Distance in meters between camera triggers. If this value is non-zero then the camera will trigger whenever the GPS position changes by this number of meters regardless of what mode the APM is in. Note that this parameter can also be set in an auto mission using the DO_SET_CAM_TRIGG_DIST command, allowing you to enable/disable the triggering of the camera during the flight. // @Description: Distance in meters between camera triggers. If this value is non-zero then the camera will trigger whenever the position changes by this number of meters regardless of what mode the APM is in. Note that this parameter can also be set in an auto mission using the DO_SET_CAM_TRIGG_DIST command, allowing you to enable/disable the triggering of the camera during the flight.
// @User: Standard // @User: Standard
// @Units: m // @Units: m
// @Range: 0 1000 // @Range: 0 1000
@ -334,10 +334,13 @@ void AP_Camera::send_feedback(mavlink_channel_t chan)
} }
/* update; triggers by distance moved /*
update; triggers by distance moved and camera trigger
*/ */
void AP_Camera::update() void AP_Camera::update()
{ {
update_trigger();
if (AP::gps().status() < AP_GPS::GPS_OK_FIX_3D) { if (AP::gps().status() < AP_GPS::GPS_OK_FIX_3D) {
return; return;
} }

View File

@ -56,12 +56,9 @@ public:
void take_picture(); void take_picture();
// Update - to be called periodically @at least 10Hz // Update - to be called periodically @at least 50Hz
void update(); void update();
// update camera trigger - 50Hz
void update_trigger();
static const struct AP_Param::GroupInfo var_info[]; static const struct AP_Param::GroupInfo var_info[];
// set if vehicle is in AUTO mode // set if vehicle is in AUTO mode
@ -129,6 +126,9 @@ private:
uint32_t log_camera_bit; uint32_t log_camera_bit;
const struct Location &current_loc; const struct Location &current_loc;
// update camera trigger - 50Hz
void update_trigger();
// entry point to trip local shutter (e.g. by relay or servo) // entry point to trip local shutter (e.g. by relay or servo)
void trigger_pic(); void trigger_pic();