From 26b2f73c6fce19982136e12a73faf96eee4895c6 Mon Sep 17 00:00:00 2001 From: Simon Wilks Date: Sat, 16 Aug 2014 14:42:18 +0200 Subject: Call the appropriate functions directly. --- src/modules/bottle_drop/bottle_drop.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/modules/bottle_drop') diff --git a/src/modules/bottle_drop/bottle_drop.cpp b/src/modules/bottle_drop/bottle_drop.cpp index 4367d1343..1c5c0f57f 100644 --- a/src/modules/bottle_drop/bottle_drop.cpp +++ b/src/modules/bottle_drop/bottle_drop.cpp @@ -684,7 +684,6 @@ BottleDrop::handle_command(struct vehicle_command_s *cmd) { switch (cmd->command) { case VEHICLE_CMD_CUSTOM_0: - /* * param1 and param2 set to 1: open and drop * param1 set to 1: open @@ -693,16 +692,19 @@ BottleDrop::handle_command(struct vehicle_command_s *cmd) if (cmd->param1 > 0.5f && cmd->param2 > 0.5f) { _open_door = true; _drop = true; + drop(); mavlink_log_info(_mavlink_fd, "#audio: drop bottle"); } else if (cmd->param1 > 0.5f) { _open_door = true; _drop = false; + open_bay(); mavlink_log_info(_mavlink_fd, "#audio: open doors"); } else { _open_door = false; _drop = false; + close_bay(); mavlink_log_info(_mavlink_fd, "#audio: close doors"); } -- cgit v1.2.3