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

ActionServer: allow direct setting of arm/disarm state and vehicle flight mode #370

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
20 changes: 20 additions & 0 deletions protos/action_server/action_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ service ActionServerService {
rpc SetAllowableFlightModes(SetAllowableFlightModesRequest) returns(SetAllowableFlightModesResponse) { option (mavsdk.options.async_type) = SYNC; }
// Get which modes the vehicle can transition to (Manual always allowed)
rpc GetAllowableFlightModes(GetAllowableFlightModesRequest) returns(GetAllowableFlightModesResponse) { option (mavsdk.options.async_type) = SYNC; }
// Set/override the armed/disarmed state of the vehicle directly, and notify subscribers
rpc SetArmedState(SetArmedStateRequest) returns(SetArmedStateResponse) { option (mavsdk.options.async_type) = SYNC; }
// Set/override the flight mode of the vehicle directly, and notify subscribers
rpc SetFlightMode(SetFlightModeRequest) returns(SetFlightModeResponse) { option (mavsdk.options.async_type) = SYNC; }
}

message SetAllowTakeoffRequest {
Expand All @@ -55,6 +59,14 @@ message SetAllowableFlightModesRequest
AllowableFlightModes flight_modes = 1;
}

message SetArmedStateRequest {
bool is_armed = 1; // Is armed now?
}

message SetFlightModeRequest {
FlightMode flight_mode = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs a docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, makes sense. I'll add it right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

message GetAllowableFlightModesRequest {}

message SubscribeArmDisarmRequest {}
Expand Down Expand Up @@ -126,6 +138,14 @@ message GetAllowableFlightModesResponse {
AllowableFlightModes flight_modes = 1;
}

message SetArmedStateResponse {
ActionServerResult action_server_result = 1;
}

message SetFlightModeResponse {
ActionServerResult action_server_result = 1;
}

// State to check if the vehicle can transition to
// respective flightmodes
message AllowableFlightModes {
Expand Down