mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 03:23:37 +08:00
camera_trigger : completely refactor state handling
This commit is contained in:
committed by
Lorenz Meier
parent
7af7c86384
commit
2e92a3946d
@@ -73,6 +73,7 @@ bool
|
||||
MissionBlock::is_mission_item_reached()
|
||||
{
|
||||
/* handle non-navigation or indefinite waypoints */
|
||||
|
||||
switch (_mission_item.nav_cmd) {
|
||||
case NAV_CMD_DO_SET_SERVO:
|
||||
return true;
|
||||
@@ -86,6 +87,7 @@ MissionBlock::is_mission_item_reached()
|
||||
return false;
|
||||
|
||||
case NAV_CMD_DO_LAND_START:
|
||||
case NAV_CMD_DO_TRIGGER_CONTROL:
|
||||
case NAV_CMD_DO_DIGICAM_CONTROL:
|
||||
case NAV_CMD_IMAGE_START_CAPTURE:
|
||||
case NAV_CMD_IMAGE_STOP_CAPTURE:
|
||||
@@ -96,6 +98,7 @@ MissionBlock::is_mission_item_reached()
|
||||
case NAV_CMD_DO_SET_ROI:
|
||||
case NAV_CMD_ROI:
|
||||
case NAV_CMD_DO_SET_CAM_TRIGG_DIST:
|
||||
case NAV_CMD_DO_SET_CAM_TRIGG_INTERVAL:
|
||||
return true;
|
||||
|
||||
case NAV_CMD_DO_VTOL_TRANSITION:
|
||||
@@ -445,6 +448,7 @@ MissionBlock::mission_item_to_vehicle_command(const struct mission_item_s *item,
|
||||
void
|
||||
MissionBlock::issue_command(const struct mission_item_s *item)
|
||||
{
|
||||
|
||||
if (item_contains_position(item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -280,6 +280,7 @@ MissionFeasibilityChecker::checkMissionItemValidity(dm_item_t dm_current, size_t
|
||||
missionitem.nav_cmd != NAV_CMD_DO_CHANGE_SPEED &&
|
||||
missionitem.nav_cmd != NAV_CMD_DO_SET_SERVO &&
|
||||
missionitem.nav_cmd != NAV_CMD_DO_LAND_START &&
|
||||
missionitem.nav_cmd != NAV_CMD_DO_TRIGGER_CONTROL &&
|
||||
missionitem.nav_cmd != NAV_CMD_DO_DIGICAM_CONTROL &&
|
||||
missionitem.nav_cmd != NAV_CMD_IMAGE_START_CAPTURE &&
|
||||
missionitem.nav_cmd != NAV_CMD_IMAGE_STOP_CAPTURE &&
|
||||
@@ -290,6 +291,7 @@ MissionFeasibilityChecker::checkMissionItemValidity(dm_item_t dm_current, size_t
|
||||
missionitem.nav_cmd != NAV_CMD_DO_SET_ROI &&
|
||||
missionitem.nav_cmd != NAV_CMD_ROI &&
|
||||
missionitem.nav_cmd != NAV_CMD_DO_SET_CAM_TRIGG_DIST &&
|
||||
missionitem.nav_cmd != NAV_CMD_DO_SET_CAM_TRIGG_INTERVAL &&
|
||||
missionitem.nav_cmd != NAV_CMD_DO_VTOL_TRANSITION) {
|
||||
|
||||
mavlink_log_critical(_navigator->get_mavlink_log_pub(), "Mission rejected: item %i: unsupported cmd: %d", (int)(i + 1),
|
||||
|
||||
@@ -78,9 +78,11 @@ enum NAV_CMD {
|
||||
NAV_CMD_DO_DIGICAM_CONTROL = 203,
|
||||
NAV_CMD_DO_MOUNT_CONFIGURE = 204,
|
||||
NAV_CMD_DO_MOUNT_CONTROL = 205,
|
||||
NAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
|
||||
NAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
|
||||
NAV_CMD_IMAGE_START_CAPTURE = 2000,
|
||||
NAV_CMD_IMAGE_STOP_CAPTURE = 2001,
|
||||
NAV_CMD_DO_TRIGGER_CONTROL = 2003,
|
||||
NAV_CMD_VIDEO_START_CAPTURE = 2500,
|
||||
NAV_CMD_VIDEO_STOP_CAPTURE = 2501,
|
||||
NAV_CMD_DO_VTOL_TRANSITION = 3000,
|
||||
|
||||
Reference in New Issue
Block a user