You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While defining the proto API for MAVSDK autopilot server plugins I ran into an issue where I needed to provide logic to allow or disallow a certain action in a timely manner. for example with an arming request MAV_CMD_COMPONENT_ARM_DISARM
As this request is a mavlink command, it requires an ack to be successful, failed or unsupported almost immediately. The only way for me to fulfil this at current was to store the state of is_armable in the plugin and provide proto to change that state. This state is checked when a command is observed and the ack is sent immediately. It works, but not an ideal solution.
I would like to be able to do something like the following:
action_server.subscribe_arm_request([](action_server::ArmRequest arm_request)
{
return some_check_to_see_if_can_arm(arm_request); // True if allow // False if not
});
In the plugin, this callback result could then be used to ack the command correctly.
The return value should probably map to command ack states really - instead of just a boolean.
The text was updated successfully, but these errors were encountered:
@JonasVautherin what's your take on this? For now, we just use several workarounds, either state like is_armable or explicit responses that need to be made when requests come in.
While defining the proto API for MAVSDK autopilot server plugins I ran into an issue where I needed to provide logic to allow or disallow a certain action in a timely manner. for example with an arming request
MAV_CMD_COMPONENT_ARM_DISARM
As this request is a mavlink command, it requires an
ack
to be successful, failed or unsupported almost immediately. The only way for me to fulfil this at current was to store the state ofis_armable
in the plugin and provide proto to change that state. This state is checked when a command is observed and the ack is sent immediately. It works, but not an ideal solution.https://github.com/mavlink/MAVSDK/blob/main/src/plugins/action_server/action_server_impl.cpp#L57
I would like to be able to do something like the following:
In the plugin, this callback result could then be used to
ack
the command correctly.The return value should probably map to command ack states really - instead of just a boolean.
The text was updated successfully, but these errors were encountered: