Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: commander: ignore REQUEST_CAMERA_INFORMATION #23748

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading