File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
px4_ros2_cpp/include/px4_ros2/mission Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,36 @@ class ActionHandler
418
418
419
419
const Mission & mission () const {return _mission_executor.mission ();}
420
420
421
+ /* *
422
+ * @brief enable/disable deferral of failsafes
423
+ *
424
+ * @param enabled
425
+ * @param timeout_s 0=system default, -1=no timeout
426
+ * @return true on success
427
+ */
428
+ bool deferFailsafes (bool enabled, int timeout_s = 0 )
429
+ {
430
+ if (!_valid) {
431
+ RCLCPP_WARN (_mission_executor._node .get_logger (), " ActionHandler is not valid anymore" );
432
+ return false ;
433
+ }
434
+ return _mission_executor.deferFailsafes (enabled, timeout_s);
435
+ }
436
+
437
+ /* *
438
+ * @brief register callback for failsafe notification
439
+ *
440
+ * The callback is triggerd when a failsafe occurs while deferral is enabled.
441
+ */
442
+ void onFailsafeDeferred (const std::function<void ()> & callback)
443
+ {
444
+ if (!_valid) {
445
+ RCLCPP_WARN (_mission_executor._node .get_logger (), " ActionHandler is not valid anymore" );
446
+ return ;
447
+ }
448
+ _mission_executor.onFailsafeDeferred (callback);
449
+ }
450
+
421
451
/* *
422
452
* @brief Check if the handler is still valid
423
453
*
You can’t perform that action at this time.
0 commit comments