Skip to content

Commit

Permalink
Include a VisionTargetEstTask DEBUG which always runs the VTE
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas committed Oct 9, 2024
1 parent 02f4c0a commit 456cc47
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/modules/vision_target_estimator/VisionTargetEst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ bool VisionTargetEst::init()
} else {

if (_vte_task_mask & VisionTargetEstTask::VTE_FOR_PREC_LAND) { PX4_INFO("VTE for precision landing.");}

if (_vte_task_mask & VisionTargetEstTask::VTE_DEBUG) { PX4_WARN("VTE for DEBUG. Always active.");}
}

if (_param_vte_pos_en.get()) {
Expand Down Expand Up @@ -243,6 +245,16 @@ bool VisionTargetEst::new_task_available()
_vte_current_task = VisionTargetEstTask::VTE_FOR_PREC_LAND;
return true;

} else if (_vte_task_mask & VisionTargetEstTask::VTE_DEBUG) {

// DEBUG task already running
if (_vte_current_task == VisionTargetEstTask::VTE_DEBUG) {
return false;
}

PX4_WARN("VTE, DEBUG task requested.");
_vte_current_task = VisionTargetEstTask::VTE_DEBUG;
return true;
}

// To add a new task:
Expand Down
1 change: 1 addition & 0 deletions src/modules/vision_target_estimator/VisionTargetEst.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class VisionTargetEst : public ModuleBase<VisionTargetEst>, ModuleParams, px4::S
// Bit locations for VTE tasks
VTE_NO_TASK = 0,
VTE_FOR_PREC_LAND = (1 << 0), ///< set to true if target GPS position data is ready to be fused
VTE_DEBUG = (2 << 0) ///< set to true if target GPS position data is ready to be fused
};

int _vte_current_task{VisionTargetEstTask::VTE_NO_TASK};
Expand Down

0 comments on commit 456cc47

Please sign in to comment.