From 5a65632a2d9098d4dd500c5817f31b94bb858d21 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 19 Oct 2023 13:34:30 +1100 Subject: [PATCH] AP_Mission: allow payload place to be compiled out of code --- libraries/AP_Mission/AP_Mission.cpp | 6 ++++++ libraries/AP_Mission/AP_Mission_config.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/libraries/AP_Mission/AP_Mission.cpp b/libraries/AP_Mission/AP_Mission.cpp index 617d8a77aa..d4d6030764 100644 --- a/libraries/AP_Mission/AP_Mission.cpp +++ b/libraries/AP_Mission/AP_Mission.cpp @@ -1250,9 +1250,11 @@ MAV_MISSION_RESULT AP_Mission::mavlink_int_to_mission_cmd(const mavlink_mission_ cmd.content.do_engine_control.allow_disarmed_start = (((uint32_t)packet.param4) & ENGINE_CONTROL_OPTIONS_ALLOW_START_WHILE_DISARMED) != 0; break; +#if AP_MISSION_NAV_PAYLOAD_PLACE_ENABLED case MAV_CMD_NAV_PAYLOAD_PLACE: cmd.p1 = packet.param1*100; // copy max-descend parameter (m->cm) break; +#endif case MAV_CMD_NAV_SET_YAW_SPEED: cmd.content.set_yaw_speed.angle_deg = packet.param1; // target angle in degrees @@ -1757,9 +1759,11 @@ bool AP_Mission::mission_cmd_to_mavlink_int(const AP_Mission::Mission_Command& c } break; +#if AP_MISSION_NAV_PAYLOAD_PLACE_ENABLED case MAV_CMD_NAV_PAYLOAD_PLACE: packet.param1 = cmd.p1/100.0f; // copy max-descend parameter (cm->m) break; +#endif case MAV_CMD_NAV_SET_YAW_SPEED: packet.param1 = cmd.content.set_yaw_speed.angle_deg; // target angle in degrees @@ -2617,8 +2621,10 @@ const char *AP_Mission::Mission_Command::type() const case MAV_CMD_DO_GRIPPER: return "Gripper"; #endif +#if AP_MISSION_NAV_PAYLOAD_PLACE_ENABLED case MAV_CMD_NAV_PAYLOAD_PLACE: return "PayloadPlace"; +#endif case MAV_CMD_DO_PARACHUTE: return "Parachute"; case MAV_CMD_DO_SPRAYER: diff --git a/libraries/AP_Mission/AP_Mission_config.h b/libraries/AP_Mission/AP_Mission_config.h index 94be328bcf..fee3f39a3b 100644 --- a/libraries/AP_Mission/AP_Mission_config.h +++ b/libraries/AP_Mission/AP_Mission_config.h @@ -3,3 +3,7 @@ #ifndef AP_MISSION_ENABLED #define AP_MISSION_ENABLED 1 #endif + +#ifndef AP_MISSION_NAV_PAYLOAD_PLACE_ENABLED +#define AP_MISSION_NAV_PAYLOAD_PLACE_ENABLED 1 +#endif