Copter: Now recognizes DO_FENCE_ENABLE mission command.

This commit is contained in:
Michael Day 2017-02-04 12:26:22 -08:00 committed by Francisco Ferreira
parent bdf49c8a01
commit 49e3ce8e75

View File

@ -112,6 +112,18 @@ bool Copter::start_command(const AP_Mission::Mission_Command& cmd)
// point the camera to a specified angle
do_mount_control(cmd);
break;
case MAV_CMD_DO_FENCE_ENABLE:
#if AC_FENCE == ENABLED
if (cmd.p1 == 0) { //disable
copter.fence.enable(false);
gcs_send_text_fmt(MAV_SEVERITY_INFO, "Fence Disabled");
} else { //enable fence
copter.fence.enable(true);
gcs_send_text_fmt(MAV_SEVERITY_INFO, "Fence Enabled");
}
#endif //AC_FENCE == ENABLED
break;
#if CAMERA == ENABLED
case MAV_CMD_DO_CONTROL_VIDEO: // Control on-board camera capturing. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty|
@ -256,6 +268,7 @@ bool Copter::verify_command(const AP_Mission::Mission_Command& cmd)
case MAV_CMD_DO_PARACHUTE: // assume parachute was released successfully
case MAV_CMD_DO_GRIPPER:
case MAV_CMD_DO_GUIDED_LIMITS:
case MAV_CMD_DO_FENCE_ENABLE:
return true;
default: