Skip to content

Commit

Permalink
commander: ignore REQUEST_CAMERA_INFORMATION
Browse files Browse the repository at this point in the history
 - add answer command logging
  • Loading branch information
dagar committed Sep 30, 2024
1 parent cf1c03e commit f5f7dfc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions msg/VehicleCommand.msg
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ uint16 VEHICLE_CMD_RUN_PREARM_CHECKS = 401 # Instructs a target system to
uint16 VEHICLE_CMD_INJECT_FAILURE = 420 # Inject artificial failure for testing purposes
uint16 VEHICLE_CMD_START_RX_PAIR = 500 # Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX|
uint16 VEHICLE_CMD_REQUEST_MESSAGE = 512 # Request to send a single instance of the specified message
uint16 VEHICLE_CMD_REQUEST_CAMERA_INFORMATION = 521 # Request camera information (CAMERA_INFORMATION). |0: No action 1: Request camera capabilities| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */
uint16 VEHICLE_CMD_SET_CAMERA_MODE = 530 # Set camera capture mode (photo, video, etc.)
uint16 VEHICLE_CMD_SET_CAMERA_ZOOM = 531 # Set camera zoom
uint16 VEHICLE_CMD_SET_CAMERA_FOCUS = 532
Expand Down
9 changes: 8 additions & 1 deletion src/modules/commander/Commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,8 @@ Commander::handle_command(const vehicle_command_s &cmd)
case vehicle_command_s::VEHICLE_CMD_REQUEST_MESSAGE:
case vehicle_command_s::VEHICLE_CMD_DO_WINCH:
case vehicle_command_s::VEHICLE_CMD_DO_GRIPPER:
case vehicle_command_s::VEHICLE_CMD_EXTERNAL_POSITION_ESTIMATE:
case vehicle_command_s::VEHICLE_CMD_REQUEST_CAMERA_INFORMATION:
/* ignore commands that are handled by other parts of the system */
break;

Expand Down Expand Up @@ -2601,23 +2603,28 @@ void Commander::answer_command(const vehicle_command_s &cmd, uint8_t result)
break;

case vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED:
PX4_DEBUG("command %" PRIu32 " denied", cmd.command);
tune_negative(true);
break;

case vehicle_command_ack_s::VEHICLE_CMD_RESULT_FAILED:
PX4_DEBUG("command %" PRIu32 " failed", cmd.command);
tune_negative(true);
break;

case vehicle_command_ack_s::VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED:
PX4_DEBUG("command %" PRIu32 " temporarily rejected", cmd.command);
tune_negative(true);
break;

case vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED:
PX4_WARN("command %" PRIu32 " unsupported", cmd.command);
tune_negative(true);
break;

default:
break;
PX4_ERR("command %" PRIu32 " invalid result %d", cmd.command, result);
return;
}

/* publish ACK */
Expand Down

0 comments on commit f5f7dfc

Please sign in to comment.