diff --git a/pkg/dialects/all/dialect.go b/pkg/dialects/all/dialect.go index ab1e6075..020fff87 100644 --- a/pkg/dialects/all/dialect.go +++ b/pkg/dialects/all/dialect.go @@ -364,6 +364,7 @@ var dial = &dialect.Dialect{ &MessageGnssIntegrity{}, &MessageTargetAbsolute{}, &MessageTargetRelative{}, + &MessageControlStatus{}, // pythonarraytest &MessageArrayTest_0{}, &MessageArrayTest_1{}, diff --git a/pkg/dialects/all/enum_gcs_control_status_flags.go b/pkg/dialects/all/enum_gcs_control_status_flags.go new file mode 100644 index 00000000..05cde8de --- /dev/null +++ b/pkg/dialects/all/enum_gcs_control_status_flags.go @@ -0,0 +1,17 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package all + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/development" +) + +// CONTROL_STATUS flags. +type GCS_CONTROL_STATUS_FLAGS = development.GCS_CONTROL_STATUS_FLAGS + +const ( + // If set, this CONTROL_STATUS publishes the controlling GCS for the whole system. If unset, the CONTROL_STATUS indicates the controlling GCS for just the component emitting the message. Note that to request control of the system a GCS should send MAV_CMD_REQUEST_OPERATOR_CONTROL to the component emitting CONTROL_STATUS with this flag set. + GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER GCS_CONTROL_STATUS_FLAGS = development.GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER + // Takeover allowed (requests for control will be granted). If not set requests for control will be rejected, but the controlling GCS will be notified (and may release control or allow takeover). + GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED GCS_CONTROL_STATUS_FLAGS = development.GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED +) diff --git a/pkg/dialects/all/enum_mav_cmd.go b/pkg/dialects/all/enum_mav_cmd.go index 78eefb3f..41b9cbe3 100644 --- a/pkg/dialects/all/enum_mav_cmd.go +++ b/pkg/dialects/all/enum_mav_cmd.go @@ -507,6 +507,29 @@ const ( // Set an external estimate of wind direction and speed. // This might be used to provide an initial wind estimate to the estimator (EKF) in the case where the vehicle is wind dead-reckoning, extending the time when operating without GPS before before position drift builds to an unsafe level. For this use case the command might reasonably be sent every few minutes when operating at altitude, and the value is cleared if the estimator resets itself. MAV_CMD_EXTERNAL_WIND_ESTIMATE MAV_CMD = 43004 + // Request GCS control of a system (or of a specific component in a system). + // A controlled system should only accept MAVLink commands and command-like messages that are sent by its controlling GCS, or from other components with the same system id. + // Commands from other systems should be rejected with MAV_RESULT_PERMISSION_DENIED (except for this command, which may be acknowledged with MAV_RESULT_ACCEPTED if control is granted). + // Command-like messages should be ignored (or rejected if that is supported by their associated protocol). + // GCS control of the whole system is managed via a single component that we will refer to here as the "system manager component". + // This component streams the CONTROL_STATUS message and sets the GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER flag. + // Other components in the system should monitor for the CONTROL_STATUS message with this flag, and set their controlling GCS to match its published system id. + // A GCS that wants to control the system should also monitor for the same message and flag, and address the MAV_CMD_REQUEST_OPERATOR_CONTROL to its component id. + // Note that integrators are required to ensure that there is only one system manager component in the system (i.e. one component emitting the message with GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER set). + // The MAV_CMD_REQUEST_OPERATOR_CONTROL command is sent by a GCS to the system manager component to request or release control of a system, specifying whether subsequent takeover requests from another GCS are automatically granted, or require permission. + // The system manager component should grant control to the GCS if the system does not require takeover permission (or is uncontrolled) and ACK the request with MAV_RESULT_ACCEPTED. + // The system manager component should then stream CONTROL_STATUS indicating its controlling system: all other components with the same system id should monitor this message and set their own controlling GCS to match that of the system manager component. + // If the system manager component cannot grant control (because takeover requires permission), the request should be rejected with MAV_RESULT_PERMISSION_DENIED. + // The system manager component should then send this same command to the current owning GCS in order to notify of the request. + // The owning GCS would ACK with MAV_RESULT_ACCEPTED, and might choose to release control of the vehicle, or re-request control with the takeover bit set to allow permission. + // Note that the pilots of both GCS should co-ordinate safe handover offline. + // Note that in most systems the only controlled component will be the "system manager component", and that will be the autopilot. + // However separate GCS control of a particular component is also permitted, if supported by the component. + // In this case the GCS will address MAV_CMD_REQUEST_OPERATOR_CONTROL to the specific component it wants to control. + // The component will then stream CONTROL_STATUS for its controlling GCS (it must not set GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER). + // The component should fall back to the system GCS (if any) when it is not directly controlled, and may stop emitting CONTROL_STATUS. + // The flow is otherwise the same as for requesting control over the whole system. + MAV_CMD_REQUEST_OPERATOR_CONTROL MAV_CMD = 43005 // Command to a gimbal manager to control the gimbal tilt and pan angles. It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. A gimbal device is never to react to this command. MAV_CMD_STORM32_DO_GIMBAL_MANAGER_CONTROL_PITCHYAW MAV_CMD = 60002 // Command to configure a gimbal manager. A gimbal device is never to react to this command. The selected profile is reported in the STORM32_GIMBAL_MANAGER_STATUS message. @@ -737,6 +760,7 @@ var labels_MAV_CMD = map[MAV_CMD]string{ MAV_CMD_DO_SET_SYS_CMP_ID: "MAV_CMD_DO_SET_SYS_CMP_ID", MAV_CMD_ODID_SET_EMERGENCY: "MAV_CMD_ODID_SET_EMERGENCY", MAV_CMD_EXTERNAL_WIND_ESTIMATE: "MAV_CMD_EXTERNAL_WIND_ESTIMATE", + MAV_CMD_REQUEST_OPERATOR_CONTROL: "MAV_CMD_REQUEST_OPERATOR_CONTROL", MAV_CMD_STORM32_DO_GIMBAL_MANAGER_CONTROL_PITCHYAW: "MAV_CMD_STORM32_DO_GIMBAL_MANAGER_CONTROL_PITCHYAW", MAV_CMD_STORM32_DO_GIMBAL_MANAGER_SETUP: "MAV_CMD_STORM32_DO_GIMBAL_MANAGER_SETUP", MAV_CMD_QSHOT_DO_CONFIGURE: "MAV_CMD_QSHOT_DO_CONFIGURE", @@ -957,6 +981,7 @@ var values_MAV_CMD = map[string]MAV_CMD{ "MAV_CMD_DO_SET_SYS_CMP_ID": MAV_CMD_DO_SET_SYS_CMP_ID, "MAV_CMD_ODID_SET_EMERGENCY": MAV_CMD_ODID_SET_EMERGENCY, "MAV_CMD_EXTERNAL_WIND_ESTIMATE": MAV_CMD_EXTERNAL_WIND_ESTIMATE, + "MAV_CMD_REQUEST_OPERATOR_CONTROL": MAV_CMD_REQUEST_OPERATOR_CONTROL, "MAV_CMD_STORM32_DO_GIMBAL_MANAGER_CONTROL_PITCHYAW": MAV_CMD_STORM32_DO_GIMBAL_MANAGER_CONTROL_PITCHYAW, "MAV_CMD_STORM32_DO_GIMBAL_MANAGER_SETUP": MAV_CMD_STORM32_DO_GIMBAL_MANAGER_SETUP, "MAV_CMD_QSHOT_DO_CONFIGURE": MAV_CMD_QSHOT_DO_CONFIGURE, diff --git a/pkg/dialects/all/enum_mav_protocol_capability.go b/pkg/dialects/all/enum_mav_protocol_capability.go index 52da07c6..5de931c5 100644 --- a/pkg/dialects/all/enum_mav_protocol_capability.go +++ b/pkg/dialects/all/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/all/enum_mav_result.go b/pkg/dialects/all/enum_mav_result.go index 098b8fe0..f45947c3 100644 --- a/pkg/dialects/all/enum_mav_result.go +++ b/pkg/dialects/all/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/all/enum_rc_sub_type.go b/pkg/dialects/all/enum_rc_sub_type.go new file mode 100644 index 00000000..76c16f6e --- /dev/null +++ b/pkg/dialects/all/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package all + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/all/enum_rc_type.go b/pkg/dialects/all/enum_rc_type.go index f207c1b3..8b06fe6a 100644 --- a/pkg/dialects/all/enum_rc_type.go +++ b/pkg/dialects/all/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/all/message_control_status.go b/pkg/dialects/all/message_control_status.go new file mode 100644 index 00000000..2a84d7fa --- /dev/null +++ b/pkg/dialects/all/message_control_status.go @@ -0,0 +1,10 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package all + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/development" +) + +// Information about GCS in control of this MAV. This should be broadcast at low rate (nominally 1 Hz) and emitted when ownership or takeover status change. Control over MAV is requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. +type MessageControlStatus = development.MessageControlStatus diff --git a/pkg/dialects/ardupilotmega/enum_mav_protocol_capability.go b/pkg/dialects/ardupilotmega/enum_mav_protocol_capability.go index 3050764f..1a9d94be 100644 --- a/pkg/dialects/ardupilotmega/enum_mav_protocol_capability.go +++ b/pkg/dialects/ardupilotmega/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/ardupilotmega/enum_mav_result.go b/pkg/dialects/ardupilotmega/enum_mav_result.go index c2cad450..0ffc7a69 100644 --- a/pkg/dialects/ardupilotmega/enum_mav_result.go +++ b/pkg/dialects/ardupilotmega/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/ardupilotmega/enum_rc_sub_type.go b/pkg/dialects/ardupilotmega/enum_rc_sub_type.go new file mode 100644 index 00000000..595e6020 --- /dev/null +++ b/pkg/dialects/ardupilotmega/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package ardupilotmega + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/ardupilotmega/enum_rc_type.go b/pkg/dialects/ardupilotmega/enum_rc_type.go index f200ad07..1907a589 100644 --- a/pkg/dialects/ardupilotmega/enum_rc_type.go +++ b/pkg/dialects/ardupilotmega/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/asluav/enum_mav_protocol_capability.go b/pkg/dialects/asluav/enum_mav_protocol_capability.go index 7276ae3f..295fbb4c 100644 --- a/pkg/dialects/asluav/enum_mav_protocol_capability.go +++ b/pkg/dialects/asluav/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/asluav/enum_mav_result.go b/pkg/dialects/asluav/enum_mav_result.go index e473ceb5..5037360e 100644 --- a/pkg/dialects/asluav/enum_mav_result.go +++ b/pkg/dialects/asluav/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/asluav/enum_rc_sub_type.go b/pkg/dialects/asluav/enum_rc_sub_type.go new file mode 100644 index 00000000..9c3d8571 --- /dev/null +++ b/pkg/dialects/asluav/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package asluav + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/asluav/enum_rc_type.go b/pkg/dialects/asluav/enum_rc_type.go index 2af6fa34..1d56f9c3 100644 --- a/pkg/dialects/asluav/enum_rc_type.go +++ b/pkg/dialects/asluav/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/avssuas/enum_mav_protocol_capability.go b/pkg/dialects/avssuas/enum_mav_protocol_capability.go index cf7b6582..2782e6b8 100644 --- a/pkg/dialects/avssuas/enum_mav_protocol_capability.go +++ b/pkg/dialects/avssuas/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/avssuas/enum_mav_result.go b/pkg/dialects/avssuas/enum_mav_result.go index a8f00a42..0c0a4dd7 100644 --- a/pkg/dialects/avssuas/enum_mav_result.go +++ b/pkg/dialects/avssuas/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/avssuas/enum_rc_sub_type.go b/pkg/dialects/avssuas/enum_rc_sub_type.go new file mode 100644 index 00000000..dcda88a6 --- /dev/null +++ b/pkg/dialects/avssuas/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package avssuas + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/avssuas/enum_rc_type.go b/pkg/dialects/avssuas/enum_rc_type.go index efeaeaa8..44c275d2 100644 --- a/pkg/dialects/avssuas/enum_rc_type.go +++ b/pkg/dialects/avssuas/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/common/enum_mav_protocol_capability.go b/pkg/dialects/common/enum_mav_protocol_capability.go index 6caf29cc..da08d556 100644 --- a/pkg/dialects/common/enum_mav_protocol_capability.go +++ b/pkg/dialects/common/enum_mav_protocol_capability.go @@ -54,6 +54,8 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = 131072 // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = 262144 + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = 524288 ) var labels_MAV_PROTOCOL_CAPABILITY = map[MAV_PROTOCOL_CAPABILITY]string{ @@ -76,6 +78,7 @@ var labels_MAV_PROTOCOL_CAPABILITY = map[MAV_PROTOCOL_CAPABILITY]string{ MAV_PROTOCOL_CAPABILITY_RESERVED2: "MAV_PROTOCOL_CAPABILITY_RESERVED2", MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST: "MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST", MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER: "MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER", + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL: "MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL", } var values_MAV_PROTOCOL_CAPABILITY = map[string]MAV_PROTOCOL_CAPABILITY{ @@ -98,6 +101,7 @@ var values_MAV_PROTOCOL_CAPABILITY = map[string]MAV_PROTOCOL_CAPABILITY{ "MAV_PROTOCOL_CAPABILITY_RESERVED2": MAV_PROTOCOL_CAPABILITY_RESERVED2, "MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST": MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST, "MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER": MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER, + "MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL": MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL, } // MarshalText implements the encoding.TextMarshaler interface. @@ -106,7 +110,7 @@ func (e MAV_PROTOCOL_CAPABILITY) MarshalText() ([]byte, error) { return []byte("0"), nil } var names []string - for i := 0; i < 19; i++ { + for i := 0; i < 20; i++ { mask := MAV_PROTOCOL_CAPABILITY(1 << i) if e&mask == mask { names = append(names, labels_MAV_PROTOCOL_CAPABILITY[mask]) diff --git a/pkg/dialects/common/enum_mav_result.go b/pkg/dialects/common/enum_mav_result.go index 37b7a9c4..692c07f2 100644 --- a/pkg/dialects/common/enum_mav_result.go +++ b/pkg/dialects/common/enum_mav_result.go @@ -31,6 +31,8 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = 8 // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = 9 + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = 10 ) var labels_MAV_RESULT = map[MAV_RESULT]string{ @@ -44,6 +46,7 @@ var labels_MAV_RESULT = map[MAV_RESULT]string{ MAV_RESULT_COMMAND_LONG_ONLY: "MAV_RESULT_COMMAND_LONG_ONLY", MAV_RESULT_COMMAND_INT_ONLY: "MAV_RESULT_COMMAND_INT_ONLY", MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME: "MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME", + MAV_RESULT_PERMISSION_DENIED: "MAV_RESULT_PERMISSION_DENIED", } var values_MAV_RESULT = map[string]MAV_RESULT{ @@ -57,6 +60,7 @@ var values_MAV_RESULT = map[string]MAV_RESULT{ "MAV_RESULT_COMMAND_LONG_ONLY": MAV_RESULT_COMMAND_LONG_ONLY, "MAV_RESULT_COMMAND_INT_ONLY": MAV_RESULT_COMMAND_INT_ONLY, "MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME": MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME, + "MAV_RESULT_PERMISSION_DENIED": MAV_RESULT_PERMISSION_DENIED, } // MarshalText implements the encoding.TextMarshaler interface. diff --git a/pkg/dialects/common/enum_rc_sub_type.go b/pkg/dialects/common/enum_rc_sub_type.go new file mode 100644 index 00000000..9e273fbd --- /dev/null +++ b/pkg/dialects/common/enum_rc_sub_type.go @@ -0,0 +1,58 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package common + +import ( + "fmt" + "strconv" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE uint64 + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = 0 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = 1 + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = 2 +) + +var labels_RC_SUB_TYPE = map[RC_SUB_TYPE]string{ + RC_SUB_TYPE_SPEKTRUM_DSM2: "RC_SUB_TYPE_SPEKTRUM_DSM2", + RC_SUB_TYPE_SPEKTRUM_DSMX: "RC_SUB_TYPE_SPEKTRUM_DSMX", + RC_SUB_TYPE_SPEKTRUM_DSMX8: "RC_SUB_TYPE_SPEKTRUM_DSMX8", +} + +var values_RC_SUB_TYPE = map[string]RC_SUB_TYPE{ + "RC_SUB_TYPE_SPEKTRUM_DSM2": RC_SUB_TYPE_SPEKTRUM_DSM2, + "RC_SUB_TYPE_SPEKTRUM_DSMX": RC_SUB_TYPE_SPEKTRUM_DSMX, + "RC_SUB_TYPE_SPEKTRUM_DSMX8": RC_SUB_TYPE_SPEKTRUM_DSMX8, +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (e RC_SUB_TYPE) MarshalText() ([]byte, error) { + if name, ok := labels_RC_SUB_TYPE[e]; ok { + return []byte(name), nil + } + return []byte(strconv.Itoa(int(e))), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (e *RC_SUB_TYPE) UnmarshalText(text []byte) error { + if value, ok := values_RC_SUB_TYPE[string(text)]; ok { + *e = value + } else if value, err := strconv.Atoi(string(text)); err == nil { + *e = RC_SUB_TYPE(value) + } else { + return fmt.Errorf("invalid label '%s'", text) + } + return nil +} + +// String implements the fmt.Stringer interface. +func (e RC_SUB_TYPE) String() string { + val, _ := e.MarshalText() + return string(val) +} diff --git a/pkg/dialects/common/enum_rc_sub_type_test.go b/pkg/dialects/common/enum_rc_sub_type_test.go new file mode 100644 index 00000000..9733317e --- /dev/null +++ b/pkg/dialects/common/enum_rc_sub_type_test.go @@ -0,0 +1,14 @@ +//autogenerated:yes +//nolint:revive,govet,errcheck +package common + +import ( + "testing" +) + +func TestEnum_RC_SUB_TYPE(t *testing.T) { + var e RC_SUB_TYPE + e.UnmarshalText([]byte{}) + e.MarshalText() + e.String() +} diff --git a/pkg/dialects/common/enum_rc_type.go b/pkg/dialects/common/enum_rc_type.go index 48d3ff72..e7eb0e51 100644 --- a/pkg/dialects/common/enum_rc_type.go +++ b/pkg/dialects/common/enum_rc_type.go @@ -7,24 +7,24 @@ import ( "strconv" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE uint64 const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = 0 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = 1 + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = 0 + // CRSF + RC_TYPE_CRSF RC_TYPE = 1 ) var labels_RC_TYPE = map[RC_TYPE]string{ - RC_TYPE_SPEKTRUM_DSM2: "RC_TYPE_SPEKTRUM_DSM2", - RC_TYPE_SPEKTRUM_DSMX: "RC_TYPE_SPEKTRUM_DSMX", + RC_TYPE_SPEKTRUM: "RC_TYPE_SPEKTRUM", + RC_TYPE_CRSF: "RC_TYPE_CRSF", } var values_RC_TYPE = map[string]RC_TYPE{ - "RC_TYPE_SPEKTRUM_DSM2": RC_TYPE_SPEKTRUM_DSM2, - "RC_TYPE_SPEKTRUM_DSMX": RC_TYPE_SPEKTRUM_DSMX, + "RC_TYPE_SPEKTRUM": RC_TYPE_SPEKTRUM, + "RC_TYPE_CRSF": RC_TYPE_CRSF, } // MarshalText implements the encoding.TextMarshaler interface. diff --git a/pkg/dialects/cubepilot/enum_mav_protocol_capability.go b/pkg/dialects/cubepilot/enum_mav_protocol_capability.go index 3e539f21..ff1abd98 100644 --- a/pkg/dialects/cubepilot/enum_mav_protocol_capability.go +++ b/pkg/dialects/cubepilot/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/cubepilot/enum_mav_result.go b/pkg/dialects/cubepilot/enum_mav_result.go index 64049de0..9237afa1 100644 --- a/pkg/dialects/cubepilot/enum_mav_result.go +++ b/pkg/dialects/cubepilot/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/cubepilot/enum_rc_sub_type.go b/pkg/dialects/cubepilot/enum_rc_sub_type.go new file mode 100644 index 00000000..6cabad81 --- /dev/null +++ b/pkg/dialects/cubepilot/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package cubepilot + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/cubepilot/enum_rc_type.go b/pkg/dialects/cubepilot/enum_rc_type.go index 36c69a12..a86375d9 100644 --- a/pkg/dialects/cubepilot/enum_rc_type.go +++ b/pkg/dialects/cubepilot/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/development/dialect.go b/pkg/dialects/development/dialect.go index f538ae9b..f4acc15f 100644 --- a/pkg/dialects/development/dialect.go +++ b/pkg/dialects/development/dialect.go @@ -260,5 +260,6 @@ var dial = &dialect.Dialect{ &MessageGnssIntegrity{}, &MessageTargetAbsolute{}, &MessageTargetRelative{}, + &MessageControlStatus{}, }, } diff --git a/pkg/dialects/development/enum_gcs_control_status_flags.go b/pkg/dialects/development/enum_gcs_control_status_flags.go new file mode 100644 index 00000000..5fdb4e15 --- /dev/null +++ b/pkg/dialects/development/enum_gcs_control_status_flags.go @@ -0,0 +1,67 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package development + +import ( + "fmt" + "strconv" + "strings" +) + +// CONTROL_STATUS flags. +type GCS_CONTROL_STATUS_FLAGS uint64 + +const ( + // If set, this CONTROL_STATUS publishes the controlling GCS for the whole system. If unset, the CONTROL_STATUS indicates the controlling GCS for just the component emitting the message. Note that to request control of the system a GCS should send MAV_CMD_REQUEST_OPERATOR_CONTROL to the component emitting CONTROL_STATUS with this flag set. + GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER GCS_CONTROL_STATUS_FLAGS = 1 + // Takeover allowed (requests for control will be granted). If not set requests for control will be rejected, but the controlling GCS will be notified (and may release control or allow takeover). + GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED GCS_CONTROL_STATUS_FLAGS = 2 +) + +var labels_GCS_CONTROL_STATUS_FLAGS = map[GCS_CONTROL_STATUS_FLAGS]string{ + GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER: "GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER", + GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED: "GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED", +} + +var values_GCS_CONTROL_STATUS_FLAGS = map[string]GCS_CONTROL_STATUS_FLAGS{ + "GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER": GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER, + "GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED": GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED, +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (e GCS_CONTROL_STATUS_FLAGS) MarshalText() ([]byte, error) { + if e == 0 { + return []byte("0"), nil + } + var names []string + for i := 0; i < 2; i++ { + mask := GCS_CONTROL_STATUS_FLAGS(1 << i) + if e&mask == mask { + names = append(names, labels_GCS_CONTROL_STATUS_FLAGS[mask]) + } + } + return []byte(strings.Join(names, " | ")), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (e *GCS_CONTROL_STATUS_FLAGS) UnmarshalText(text []byte) error { + labels := strings.Split(string(text), " | ") + var mask GCS_CONTROL_STATUS_FLAGS + for _, label := range labels { + if value, ok := values_GCS_CONTROL_STATUS_FLAGS[label]; ok { + mask |= value + } else if value, err := strconv.Atoi(label); err == nil { + mask |= GCS_CONTROL_STATUS_FLAGS(value) + } else { + return fmt.Errorf("invalid label '%s'", label) + } + } + *e = mask + return nil +} + +// String implements the fmt.Stringer interface. +func (e GCS_CONTROL_STATUS_FLAGS) String() string { + val, _ := e.MarshalText() + return string(val) +} diff --git a/pkg/dialects/development/enum_gcs_control_status_flags_test.go b/pkg/dialects/development/enum_gcs_control_status_flags_test.go new file mode 100644 index 00000000..9a683709 --- /dev/null +++ b/pkg/dialects/development/enum_gcs_control_status_flags_test.go @@ -0,0 +1,14 @@ +//autogenerated:yes +//nolint:revive,govet,errcheck +package development + +import ( + "testing" +) + +func TestEnum_GCS_CONTROL_STATUS_FLAGS(t *testing.T) { + var e GCS_CONTROL_STATUS_FLAGS + e.UnmarshalText([]byte{}) + e.MarshalText() + e.String() +} diff --git a/pkg/dialects/development/enum_mav_cmd.go b/pkg/dialects/development/enum_mav_cmd.go index e9cf87e9..616290e0 100644 --- a/pkg/dialects/development/enum_mav_cmd.go +++ b/pkg/dialects/development/enum_mav_cmd.go @@ -440,6 +440,29 @@ const ( // Set an external estimate of wind direction and speed. // This might be used to provide an initial wind estimate to the estimator (EKF) in the case where the vehicle is wind dead-reckoning, extending the time when operating without GPS before before position drift builds to an unsafe level. For this use case the command might reasonably be sent every few minutes when operating at altitude, and the value is cleared if the estimator resets itself. MAV_CMD_EXTERNAL_WIND_ESTIMATE MAV_CMD = 43004 + // Request GCS control of a system (or of a specific component in a system). + // A controlled system should only accept MAVLink commands and command-like messages that are sent by its controlling GCS, or from other components with the same system id. + // Commands from other systems should be rejected with MAV_RESULT_PERMISSION_DENIED (except for this command, which may be acknowledged with MAV_RESULT_ACCEPTED if control is granted). + // Command-like messages should be ignored (or rejected if that is supported by their associated protocol). + // GCS control of the whole system is managed via a single component that we will refer to here as the "system manager component". + // This component streams the CONTROL_STATUS message and sets the GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER flag. + // Other components in the system should monitor for the CONTROL_STATUS message with this flag, and set their controlling GCS to match its published system id. + // A GCS that wants to control the system should also monitor for the same message and flag, and address the MAV_CMD_REQUEST_OPERATOR_CONTROL to its component id. + // Note that integrators are required to ensure that there is only one system manager component in the system (i.e. one component emitting the message with GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER set). + // The MAV_CMD_REQUEST_OPERATOR_CONTROL command is sent by a GCS to the system manager component to request or release control of a system, specifying whether subsequent takeover requests from another GCS are automatically granted, or require permission. + // The system manager component should grant control to the GCS if the system does not require takeover permission (or is uncontrolled) and ACK the request with MAV_RESULT_ACCEPTED. + // The system manager component should then stream CONTROL_STATUS indicating its controlling system: all other components with the same system id should monitor this message and set their own controlling GCS to match that of the system manager component. + // If the system manager component cannot grant control (because takeover requires permission), the request should be rejected with MAV_RESULT_PERMISSION_DENIED. + // The system manager component should then send this same command to the current owning GCS in order to notify of the request. + // The owning GCS would ACK with MAV_RESULT_ACCEPTED, and might choose to release control of the vehicle, or re-request control with the takeover bit set to allow permission. + // Note that the pilots of both GCS should co-ordinate safe handover offline. + // Note that in most systems the only controlled component will be the "system manager component", and that will be the autopilot. + // However separate GCS control of a particular component is also permitted, if supported by the component. + // In this case the GCS will address MAV_CMD_REQUEST_OPERATOR_CONTROL to the specific component it wants to control. + // The component will then stream CONTROL_STATUS for its controlling GCS (it must not set GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER). + // The component should fall back to the system GCS (if any) when it is not directly controlled, and may stop emitting CONTROL_STATUS. + // The flow is otherwise the same as for requesting control over the whole system. + MAV_CMD_REQUEST_OPERATOR_CONTROL MAV_CMD = 43005 ) var labels_MAV_CMD = map[MAV_CMD]string{ @@ -617,6 +640,7 @@ var labels_MAV_CMD = map[MAV_CMD]string{ MAV_CMD_DO_SET_SYS_CMP_ID: "MAV_CMD_DO_SET_SYS_CMP_ID", MAV_CMD_ODID_SET_EMERGENCY: "MAV_CMD_ODID_SET_EMERGENCY", MAV_CMD_EXTERNAL_WIND_ESTIMATE: "MAV_CMD_EXTERNAL_WIND_ESTIMATE", + MAV_CMD_REQUEST_OPERATOR_CONTROL: "MAV_CMD_REQUEST_OPERATOR_CONTROL", } var values_MAV_CMD = map[string]MAV_CMD{ @@ -794,6 +818,7 @@ var values_MAV_CMD = map[string]MAV_CMD{ "MAV_CMD_DO_SET_SYS_CMP_ID": MAV_CMD_DO_SET_SYS_CMP_ID, "MAV_CMD_ODID_SET_EMERGENCY": MAV_CMD_ODID_SET_EMERGENCY, "MAV_CMD_EXTERNAL_WIND_ESTIMATE": MAV_CMD_EXTERNAL_WIND_ESTIMATE, + "MAV_CMD_REQUEST_OPERATOR_CONTROL": MAV_CMD_REQUEST_OPERATOR_CONTROL, } // MarshalText implements the encoding.TextMarshaler interface. diff --git a/pkg/dialects/development/enum_mav_protocol_capability.go b/pkg/dialects/development/enum_mav_protocol_capability.go index 18631506..5694e6e1 100644 --- a/pkg/dialects/development/enum_mav_protocol_capability.go +++ b/pkg/dialects/development/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/development/enum_mav_result.go b/pkg/dialects/development/enum_mav_result.go index 96958976..69510b19 100644 --- a/pkg/dialects/development/enum_mav_result.go +++ b/pkg/dialects/development/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/development/enum_rc_sub_type.go b/pkg/dialects/development/enum_rc_sub_type.go new file mode 100644 index 00000000..d3ff5bf9 --- /dev/null +++ b/pkg/dialects/development/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package development + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/development/enum_rc_type.go b/pkg/dialects/development/enum_rc_type.go index 100c9d67..5826df33 100644 --- a/pkg/dialects/development/enum_rc_type.go +++ b/pkg/dialects/development/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/development/message_control_status.go b/pkg/dialects/development/message_control_status.go new file mode 100644 index 00000000..ca1688de --- /dev/null +++ b/pkg/dialects/development/message_control_status.go @@ -0,0 +1,16 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package development + +// Information about GCS in control of this MAV. This should be broadcast at low rate (nominally 1 Hz) and emitted when ownership or takeover status change. Control over MAV is requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. +type MessageControlStatus struct { + // System ID of GCS MAVLink component in control (0: no GCS in control). + SysidInControl uint8 + // Control status. For example, whether takeover is allowed, and whether this message instance defines the default controlling GCS for the whole system. + Flags GCS_CONTROL_STATUS_FLAGS `mavenum:"uint8"` +} + +// GetID implements the message.Message interface. +func (*MessageControlStatus) GetID() uint32 { + return 512 +} diff --git a/pkg/dialects/matrixpilot/enum_mav_protocol_capability.go b/pkg/dialects/matrixpilot/enum_mav_protocol_capability.go index 281d3589..182bd478 100644 --- a/pkg/dialects/matrixpilot/enum_mav_protocol_capability.go +++ b/pkg/dialects/matrixpilot/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/matrixpilot/enum_mav_result.go b/pkg/dialects/matrixpilot/enum_mav_result.go index 72cedf9e..5a7fda70 100644 --- a/pkg/dialects/matrixpilot/enum_mav_result.go +++ b/pkg/dialects/matrixpilot/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/matrixpilot/enum_rc_sub_type.go b/pkg/dialects/matrixpilot/enum_rc_sub_type.go new file mode 100644 index 00000000..f28ca310 --- /dev/null +++ b/pkg/dialects/matrixpilot/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package matrixpilot + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/matrixpilot/enum_rc_type.go b/pkg/dialects/matrixpilot/enum_rc_type.go index ab328a2a..1b00f867 100644 --- a/pkg/dialects/matrixpilot/enum_rc_type.go +++ b/pkg/dialects/matrixpilot/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/paparazzi/enum_mav_protocol_capability.go b/pkg/dialects/paparazzi/enum_mav_protocol_capability.go index 415aeacc..995e5f82 100644 --- a/pkg/dialects/paparazzi/enum_mav_protocol_capability.go +++ b/pkg/dialects/paparazzi/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/paparazzi/enum_mav_result.go b/pkg/dialects/paparazzi/enum_mav_result.go index 0285e4b4..b074c970 100644 --- a/pkg/dialects/paparazzi/enum_mav_result.go +++ b/pkg/dialects/paparazzi/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/paparazzi/enum_rc_sub_type.go b/pkg/dialects/paparazzi/enum_rc_sub_type.go new file mode 100644 index 00000000..c6dc6111 --- /dev/null +++ b/pkg/dialects/paparazzi/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package paparazzi + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/paparazzi/enum_rc_type.go b/pkg/dialects/paparazzi/enum_rc_type.go index 64f75469..c4ea8610 100644 --- a/pkg/dialects/paparazzi/enum_rc_type.go +++ b/pkg/dialects/paparazzi/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/pythonarraytest/enum_mav_protocol_capability.go b/pkg/dialects/pythonarraytest/enum_mav_protocol_capability.go index 7abc0475..22de3d8d 100644 --- a/pkg/dialects/pythonarraytest/enum_mav_protocol_capability.go +++ b/pkg/dialects/pythonarraytest/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/pythonarraytest/enum_mav_result.go b/pkg/dialects/pythonarraytest/enum_mav_result.go index 8078a78d..1860d0bb 100644 --- a/pkg/dialects/pythonarraytest/enum_mav_result.go +++ b/pkg/dialects/pythonarraytest/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/pythonarraytest/enum_rc_sub_type.go b/pkg/dialects/pythonarraytest/enum_rc_sub_type.go new file mode 100644 index 00000000..031cee4d --- /dev/null +++ b/pkg/dialects/pythonarraytest/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package pythonarraytest + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/pythonarraytest/enum_rc_type.go b/pkg/dialects/pythonarraytest/enum_rc_type.go index 7ddc885f..7ff03239 100644 --- a/pkg/dialects/pythonarraytest/enum_rc_type.go +++ b/pkg/dialects/pythonarraytest/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/storm32/enum_mav_protocol_capability.go b/pkg/dialects/storm32/enum_mav_protocol_capability.go index 1b0818ba..b83e49a9 100644 --- a/pkg/dialects/storm32/enum_mav_protocol_capability.go +++ b/pkg/dialects/storm32/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/storm32/enum_mav_result.go b/pkg/dialects/storm32/enum_mav_result.go index ac5321d1..4d488a28 100644 --- a/pkg/dialects/storm32/enum_mav_result.go +++ b/pkg/dialects/storm32/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/storm32/enum_rc_sub_type.go b/pkg/dialects/storm32/enum_rc_sub_type.go new file mode 100644 index 00000000..57408e2a --- /dev/null +++ b/pkg/dialects/storm32/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package storm32 + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/storm32/enum_rc_type.go b/pkg/dialects/storm32/enum_rc_type.go index 66406b36..1bf2b207 100644 --- a/pkg/dialects/storm32/enum_rc_type.go +++ b/pkg/dialects/storm32/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/ualberta/enum_mav_protocol_capability.go b/pkg/dialects/ualberta/enum_mav_protocol_capability.go index f2117654..7f562e1b 100644 --- a/pkg/dialects/ualberta/enum_mav_protocol_capability.go +++ b/pkg/dialects/ualberta/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/ualberta/enum_mav_result.go b/pkg/dialects/ualberta/enum_mav_result.go index b914b16c..192b0900 100644 --- a/pkg/dialects/ualberta/enum_mav_result.go +++ b/pkg/dialects/ualberta/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/ualberta/enum_rc_sub_type.go b/pkg/dialects/ualberta/enum_rc_sub_type.go new file mode 100644 index 00000000..4e565c82 --- /dev/null +++ b/pkg/dialects/ualberta/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package ualberta + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/ualberta/enum_rc_type.go b/pkg/dialects/ualberta/enum_rc_type.go index 66b45190..78bea628 100644 --- a/pkg/dialects/ualberta/enum_rc_type.go +++ b/pkg/dialects/ualberta/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF ) diff --git a/pkg/dialects/uavionix/enum_mav_protocol_capability.go b/pkg/dialects/uavionix/enum_mav_protocol_capability.go index e7409678..84ce6ea6 100644 --- a/pkg/dialects/uavionix/enum_mav_protocol_capability.go +++ b/pkg/dialects/uavionix/enum_mav_protocol_capability.go @@ -52,4 +52,6 @@ const ( MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST // This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER + // Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL MAV_PROTOCOL_CAPABILITY = common.MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL ) diff --git a/pkg/dialects/uavionix/enum_mav_result.go b/pkg/dialects/uavionix/enum_mav_result.go index 123fed68..efffa6cd 100644 --- a/pkg/dialects/uavionix/enum_mav_result.go +++ b/pkg/dialects/uavionix/enum_mav_result.go @@ -30,4 +30,6 @@ const ( MAV_RESULT_COMMAND_INT_ONLY MAV_RESULT = common.MAV_RESULT_COMMAND_INT_ONLY // Command is invalid because a frame is required and the specified frame is not supported. MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME MAV_RESULT = common.MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME + // Sender is not authorized to control this MAV component. Control may be requested using MAV_CMD_REQUEST_OPERATOR_CONTROL. + MAV_RESULT_PERMISSION_DENIED MAV_RESULT = common.MAV_RESULT_PERMISSION_DENIED ) diff --git a/pkg/dialects/uavionix/enum_rc_sub_type.go b/pkg/dialects/uavionix/enum_rc_sub_type.go new file mode 100644 index 00000000..ec6e50c2 --- /dev/null +++ b/pkg/dialects/uavionix/enum_rc_sub_type.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package uavionix + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. +type RC_SUB_TYPE = common.RC_SUB_TYPE + +const ( + // Spektrum DSM2 + RC_SUB_TYPE_SPEKTRUM_DSM2 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSM2 + // Spektrum DSMX + RC_SUB_TYPE_SPEKTRUM_DSMX RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX + // Spektrum DSMX8 + RC_SUB_TYPE_SPEKTRUM_DSMX8 RC_SUB_TYPE = common.RC_SUB_TYPE_SPEKTRUM_DSMX8 +) diff --git a/pkg/dialects/uavionix/enum_rc_type.go b/pkg/dialects/uavionix/enum_rc_type.go index d40a3d42..a67b5f9c 100644 --- a/pkg/dialects/uavionix/enum_rc_type.go +++ b/pkg/dialects/uavionix/enum_rc_type.go @@ -6,12 +6,12 @@ import ( "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) -// RC type +// RC type. Used in MAV_CMD_START_RX_PAIR. type RC_TYPE = common.RC_TYPE const ( - // Spektrum DSM2 - RC_TYPE_SPEKTRUM_DSM2 RC_TYPE = common.RC_TYPE_SPEKTRUM_DSM2 - // Spektrum DSMX - RC_TYPE_SPEKTRUM_DSMX RC_TYPE = common.RC_TYPE_SPEKTRUM_DSMX + // Spektrum + RC_TYPE_SPEKTRUM RC_TYPE = common.RC_TYPE_SPEKTRUM + // CRSF + RC_TYPE_CRSF RC_TYPE = common.RC_TYPE_CRSF )