mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:33:39 +08:00
camera_trigger : enforce a minimum activation time in PWM modes
This commit is contained in:
committed by
Lorenz Meier
parent
24f57b00a6
commit
ae35bf524d
@@ -231,7 +231,7 @@ CameraTrigger::CameraTrigger() :
|
||||
//Initiate Camera interface basedon camera_interface_mode
|
||||
if (_camera_interface != nullptr) {
|
||||
delete (_camera_interface);
|
||||
/* set to zero to ensure parser is not used while not instantiated */
|
||||
// set to zero to ensure parser is not used while not instantiated
|
||||
_camera_interface = nullptr;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ CameraTrigger::CameraTrigger() :
|
||||
#endif
|
||||
|
||||
case CAMERA_INTERFACE_MODE_MAVLINK:
|
||||
/* start an interface that does nothing. Instead mavlink will listen to the camera_trigger uORB message */
|
||||
// start an interface that does nothing. Instead mavlink will listen to the camera_trigger uORB message
|
||||
_camera_interface = new CameraInterface();
|
||||
break;
|
||||
|
||||
@@ -277,6 +277,16 @@ CameraTrigger::CameraTrigger() :
|
||||
break;
|
||||
}
|
||||
|
||||
// Enforce a lower bound on the activation interval in PWM modes to not miss
|
||||
// engage calls in-between 50Hz PWM pulses. (see PX4 PR #6973)
|
||||
if ((_activation_time < 40.0f) &&
|
||||
(_camera_interface_mode == CAMERA_INTERFACE_MODE_GENERIC_PWM ||
|
||||
_camera_interface_mode == CAMERA_INTERFACE_MODE_SEAGULL_MAP2_PWM)) {
|
||||
_activation_time = 40.0f;
|
||||
PX4_WARN("Trigger interval too low for PWM interface, setting to 40 ms");
|
||||
param_set(_p_activation_time, &(_activation_time));
|
||||
}
|
||||
|
||||
struct camera_trigger_s report = {};
|
||||
|
||||
_trigger_pub = orb_advertise(ORB_ID(camera_trigger), &report);
|
||||
|
||||
@@ -92,7 +92,7 @@ PARAM_DEFINE_INT32(TRIG_POLARITY, 0);
|
||||
* @decimal 1
|
||||
* @group Camera trigger
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(TRIG_ACT_TIME, 0.5f);
|
||||
PARAM_DEFINE_FLOAT(TRIG_ACT_TIME, 40.0f);
|
||||
|
||||
/**
|
||||
* Camera trigger mode
|
||||
|
||||
Reference in New Issue
Block a user