diff --git a/pkg/dialects/all/dialect.go b/pkg/dialects/all/dialect.go index e6a7eda72..944ce78e4 100644 --- a/pkg/dialects/all/dialect.go +++ b/pkg/dialects/all/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, @@ -350,12 +351,10 @@ var dial = &dialect.Dialect{ // development &MessageParamAckTransaction{}, &MessageAirspeed{}, - &MessageWifiNetworkInfo{}, &MessageSetVelocityLimits{}, &MessageVelocityLimits{}, &MessageFigureEightExecutionStatus{}, &MessageBatteryStatusV2{}, - &MessageFuelStatus{}, &MessageGroupStart{}, &MessageGroupEnd{}, &MessageRadioRcChannels{}, diff --git a/pkg/dialects/all/enum_mav_cmd.go b/pkg/dialects/all/enum_mav_cmd.go index ddddc788a..897b430bb 100644 --- a/pkg/dialects/all/enum_mav_cmd.go +++ b/pkg/dialects/all/enum_mav_cmd.go @@ -480,16 +480,6 @@ const ( // The system doing the upgrade will report progress using the normal command protocol sequence for a long running operation. // Command protocol information: https://mavlink.io/en/services/command.html. MAV_CMD_DO_UPGRADE MAV_CMD = 247 - // Define start of a group of mission items. When control reaches this command a GROUP_START message is emitted. - // The end of a group is marked using MAV_CMD_GROUP_END with the same group id. - // Group ids are expected, but not required, to iterate sequentially. - // Groups can be nested. - MAV_CMD_GROUP_START MAV_CMD = 301 - // Define end of a group of mission items. When control reaches this command a GROUP_END message is emitted. - // The start of the group is marked is marked using MAV_CMD_GROUP_START with the same group id. - // Group ids are expected, but not required, to iterate sequentially. - // Groups can be nested. - MAV_CMD_GROUP_END MAV_CMD = 302 // Enable the specified standard MAVLink mode. // If the mode is not supported the vehicle should ACK with MAV_RESULT_FAILED. MAV_CMD_DO_SET_STANDARD_MODE MAV_CMD = 262 @@ -753,8 +743,6 @@ var labels_MAV_CMD = map[MAV_CMD]string{ MAV_CMD_DO_FIGURE_EIGHT: "MAV_CMD_DO_FIGURE_EIGHT", MAV_CMD_PARAM_TRANSACTION: "MAV_CMD_PARAM_TRANSACTION", MAV_CMD_DO_UPGRADE: "MAV_CMD_DO_UPGRADE", - MAV_CMD_GROUP_START: "MAV_CMD_GROUP_START", - MAV_CMD_GROUP_END: "MAV_CMD_GROUP_END", MAV_CMD_DO_SET_STANDARD_MODE: "MAV_CMD_DO_SET_STANDARD_MODE", MAV_CMD_SET_AT_S_PARAM: "MAV_CMD_SET_AT_S_PARAM", MAV_CMD_DO_SET_SYS_CMP_ID: "MAV_CMD_DO_SET_SYS_CMP_ID", @@ -974,8 +962,6 @@ var values_MAV_CMD = map[string]MAV_CMD{ "MAV_CMD_DO_FIGURE_EIGHT": MAV_CMD_DO_FIGURE_EIGHT, "MAV_CMD_PARAM_TRANSACTION": MAV_CMD_PARAM_TRANSACTION, "MAV_CMD_DO_UPGRADE": MAV_CMD_DO_UPGRADE, - "MAV_CMD_GROUP_START": MAV_CMD_GROUP_START, - "MAV_CMD_GROUP_END": MAV_CMD_GROUP_END, "MAV_CMD_DO_SET_STANDARD_MODE": MAV_CMD_DO_SET_STANDARD_MODE, "MAV_CMD_SET_AT_S_PARAM": MAV_CMD_SET_AT_S_PARAM, "MAV_CMD_DO_SET_SYS_CMP_ID": MAV_CMD_DO_SET_SYS_CMP_ID, diff --git a/pkg/dialects/all/enum_mav_fuel_type.go b/pkg/dialects/all/enum_mav_fuel_type.go index 74231dc66..143496286 100644 --- a/pkg/dialects/all/enum_mav_fuel_type.go +++ b/pkg/dialects/all/enum_mav_fuel_type.go @@ -3,17 +3,17 @@ package all import ( - "github.com/bluenviron/gomavlib/v3/pkg/dialects/development" + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) // Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. -type MAV_FUEL_TYPE = development.MAV_FUEL_TYPE +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE const ( - // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1. - MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = development.MAV_FUEL_TYPE_UNKNOWN + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. - MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = development.MAV_FUEL_TYPE_LIQUID + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). - MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = development.MAV_FUEL_TYPE_GAS + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS ) diff --git a/pkg/dialects/all/enum_wifi_network_security.go b/pkg/dialects/all/enum_wifi_network_security.go deleted file mode 100644 index 1ff95e884..000000000 --- a/pkg/dialects/all/enum_wifi_network_security.go +++ /dev/null @@ -1,25 +0,0 @@ -//autogenerated:yes -//nolint:revive,misspell,govet,lll,dupl,gocritic -package all - -import ( - "github.com/bluenviron/gomavlib/v3/pkg/dialects/development" -) - -// WiFi wireless security protocols. -type WIFI_NETWORK_SECURITY = development.WIFI_NETWORK_SECURITY - -const ( - // Undefined or unknown security protocol. - WIFI_NETWORK_SECURITY_UNDEFINED WIFI_NETWORK_SECURITY = development.WIFI_NETWORK_SECURITY_UNDEFINED - // Open network, no security. - WIFI_NETWORK_SECURITY_OPEN WIFI_NETWORK_SECURITY = development.WIFI_NETWORK_SECURITY_OPEN - // WEP. - WIFI_NETWORK_SECURITY_WEP WIFI_NETWORK_SECURITY = development.WIFI_NETWORK_SECURITY_WEP - // WPA1. - WIFI_NETWORK_SECURITY_WPA1 WIFI_NETWORK_SECURITY = development.WIFI_NETWORK_SECURITY_WPA1 - // WPA2. - WIFI_NETWORK_SECURITY_WPA2 WIFI_NETWORK_SECURITY = development.WIFI_NETWORK_SECURITY_WPA2 - // WPA3. - WIFI_NETWORK_SECURITY_WPA3 WIFI_NETWORK_SECURITY = development.WIFI_NETWORK_SECURITY_WPA3 -) diff --git a/pkg/dialects/all/message_fuel_status.go b/pkg/dialects/all/message_fuel_status.go index 0dd61e964..fa9b9c0a7 100644 --- a/pkg/dialects/all/message_fuel_status.go +++ b/pkg/dialects/all/message_fuel_status.go @@ -3,7 +3,7 @@ package all import ( - "github.com/bluenviron/gomavlib/v3/pkg/dialects/development" + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) // Fuel status. @@ -16,4 +16,4 @@ import ( // This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. // If both messages are sent for the same fuel system, the ids and corresponding information must match. // This should be streamed (nominally at 0.1 Hz). -type MessageFuelStatus = development.MessageFuelStatus +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/all/message_wifi_network_info.go b/pkg/dialects/all/message_wifi_network_info.go deleted file mode 100644 index 91f6614e8..000000000 --- a/pkg/dialects/all/message_wifi_network_info.go +++ /dev/null @@ -1,10 +0,0 @@ -//autogenerated:yes -//nolint:revive,misspell,govet,lll -package all - -import ( - "github.com/bluenviron/gomavlib/v3/pkg/dialects/development" -) - -// Detected WiFi network status information. This message is sent per each WiFi network detected in range with known SSID and general status parameters. -type MessageWifiNetworkInfo = development.MessageWifiNetworkInfo diff --git a/pkg/dialects/ardupilotmega/dialect.go b/pkg/dialects/ardupilotmega/dialect.go index 7539e809c..eb5de65af 100644 --- a/pkg/dialects/ardupilotmega/dialect.go +++ b/pkg/dialects/ardupilotmega/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/ardupilotmega/enum_mav_fuel_type.go b/pkg/dialects/ardupilotmega/enum_mav_fuel_type.go new file mode 100644 index 000000000..2b89888de --- /dev/null +++ b/pkg/dialects/ardupilotmega/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/ardupilotmega/message_fuel_status.go b/pkg/dialects/ardupilotmega/message_fuel_status.go new file mode 100644 index 000000000..fa50da2ea --- /dev/null +++ b/pkg/dialects/ardupilotmega/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package ardupilotmega + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/asluav/dialect.go b/pkg/dialects/asluav/dialect.go index 8f6e7f5dc..768ac2055 100644 --- a/pkg/dialects/asluav/dialect.go +++ b/pkg/dialects/asluav/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/asluav/enum_mav_fuel_type.go b/pkg/dialects/asluav/enum_mav_fuel_type.go new file mode 100644 index 000000000..7b9e6e3a4 --- /dev/null +++ b/pkg/dialects/asluav/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/asluav/message_fuel_status.go b/pkg/dialects/asluav/message_fuel_status.go new file mode 100644 index 000000000..c4955ddfc --- /dev/null +++ b/pkg/dialects/asluav/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package asluav + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/avssuas/dialect.go b/pkg/dialects/avssuas/dialect.go index ff0934501..3e921af2a 100644 --- a/pkg/dialects/avssuas/dialect.go +++ b/pkg/dialects/avssuas/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/avssuas/enum_mav_fuel_type.go b/pkg/dialects/avssuas/enum_mav_fuel_type.go new file mode 100644 index 000000000..a080e89e7 --- /dev/null +++ b/pkg/dialects/avssuas/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/avssuas/message_fuel_status.go b/pkg/dialects/avssuas/message_fuel_status.go new file mode 100644 index 000000000..beb82aa16 --- /dev/null +++ b/pkg/dialects/avssuas/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package avssuas + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/common/dialect.go b/pkg/dialects/common/dialect.go index e663d58d0..32cdcf54b 100644 --- a/pkg/dialects/common/dialect.go +++ b/pkg/dialects/common/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/common/enum_mav_fuel_type.go b/pkg/dialects/common/enum_mav_fuel_type.go new file mode 100644 index 000000000..bb2743839 --- /dev/null +++ b/pkg/dialects/common/enum_mav_fuel_type.go @@ -0,0 +1,58 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll,dupl,gocritic +package common + +import ( + "fmt" + "strconv" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE uint64 + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = 0 + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = 1 + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = 2 +) + +var labels_MAV_FUEL_TYPE = map[MAV_FUEL_TYPE]string{ + MAV_FUEL_TYPE_UNKNOWN: "MAV_FUEL_TYPE_UNKNOWN", + MAV_FUEL_TYPE_LIQUID: "MAV_FUEL_TYPE_LIQUID", + MAV_FUEL_TYPE_GAS: "MAV_FUEL_TYPE_GAS", +} + +var values_MAV_FUEL_TYPE = map[string]MAV_FUEL_TYPE{ + "MAV_FUEL_TYPE_UNKNOWN": MAV_FUEL_TYPE_UNKNOWN, + "MAV_FUEL_TYPE_LIQUID": MAV_FUEL_TYPE_LIQUID, + "MAV_FUEL_TYPE_GAS": MAV_FUEL_TYPE_GAS, +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (e MAV_FUEL_TYPE) MarshalText() ([]byte, error) { + if name, ok := labels_MAV_FUEL_TYPE[e]; ok { + return []byte(name), nil + } + return []byte(strconv.Itoa(int(e))), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (e *MAV_FUEL_TYPE) UnmarshalText(text []byte) error { + if value, ok := values_MAV_FUEL_TYPE[string(text)]; ok { + *e = value + } else if value, err := strconv.Atoi(string(text)); err == nil { + *e = MAV_FUEL_TYPE(value) + } else { + return fmt.Errorf("invalid label '%s'", text) + } + return nil +} + +// String implements the fmt.Stringer interface. +func (e MAV_FUEL_TYPE) String() string { + val, _ := e.MarshalText() + return string(val) +} diff --git a/pkg/dialects/development/enum_mav_fuel_type_test.go b/pkg/dialects/common/enum_mav_fuel_type_test.go similarity index 90% rename from pkg/dialects/development/enum_mav_fuel_type_test.go rename to pkg/dialects/common/enum_mav_fuel_type_test.go index d042dd7a2..ab5e8c401 100644 --- a/pkg/dialects/development/enum_mav_fuel_type_test.go +++ b/pkg/dialects/common/enum_mav_fuel_type_test.go @@ -1,6 +1,6 @@ //autogenerated:yes //nolint:revive,govet,errcheck -package development +package common import ( "testing" diff --git a/pkg/dialects/common/message_fuel_status.go b/pkg/dialects/common/message_fuel_status.go new file mode 100644 index 000000000..c3b585e35 --- /dev/null +++ b/pkg/dialects/common/message_fuel_status.go @@ -0,0 +1,37 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package common + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus struct { + // Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2. + Id uint8 + // Capacity when full. Must be provided. + MaximumFuel float32 + // Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided. + ConsumedFuel float32 + // Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided. + RemainingFuel float32 + // Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided. + PercentRemaining uint8 + // Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided. + FlowRate float32 + // Fuel temperature. NaN: field not provided. + Temperature float32 + // Fuel type. Defines units for fuel capacity and consumption fields above. + FuelType MAV_FUEL_TYPE `mavenum:"uint32"` +} + +// GetID implements the message.Message interface. +func (*MessageFuelStatus) GetID() uint32 { + return 371 +} diff --git a/pkg/dialects/cubepilot/dialect.go b/pkg/dialects/cubepilot/dialect.go index 65c812205..8953a5bb6 100644 --- a/pkg/dialects/cubepilot/dialect.go +++ b/pkg/dialects/cubepilot/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/cubepilot/enum_mav_fuel_type.go b/pkg/dialects/cubepilot/enum_mav_fuel_type.go new file mode 100644 index 000000000..716594f6f --- /dev/null +++ b/pkg/dialects/cubepilot/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/cubepilot/message_fuel_status.go b/pkg/dialects/cubepilot/message_fuel_status.go new file mode 100644 index 000000000..61b300cad --- /dev/null +++ b/pkg/dialects/cubepilot/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package cubepilot + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/development/dialect.go b/pkg/dialects/development/dialect.go index 6b3548426..17d21b7da 100644 --- a/pkg/dialects/development/dialect.go +++ b/pkg/dialects/development/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, @@ -246,12 +247,10 @@ var dial = &dialect.Dialect{ // development &MessageParamAckTransaction{}, &MessageAirspeed{}, - &MessageWifiNetworkInfo{}, &MessageSetVelocityLimits{}, &MessageVelocityLimits{}, &MessageFigureEightExecutionStatus{}, &MessageBatteryStatusV2{}, - &MessageFuelStatus{}, &MessageGroupStart{}, &MessageGroupEnd{}, &MessageRadioRcChannels{}, diff --git a/pkg/dialects/development/enum_mav_cmd.go b/pkg/dialects/development/enum_mav_cmd.go index 476f55b77..6a223bdb9 100644 --- a/pkg/dialects/development/enum_mav_cmd.go +++ b/pkg/dialects/development/enum_mav_cmd.go @@ -413,16 +413,6 @@ const ( // The system doing the upgrade will report progress using the normal command protocol sequence for a long running operation. // Command protocol information: https://mavlink.io/en/services/command.html. MAV_CMD_DO_UPGRADE MAV_CMD = 247 - // Define start of a group of mission items. When control reaches this command a GROUP_START message is emitted. - // The end of a group is marked using MAV_CMD_GROUP_END with the same group id. - // Group ids are expected, but not required, to iterate sequentially. - // Groups can be nested. - MAV_CMD_GROUP_START MAV_CMD = 301 - // Define end of a group of mission items. When control reaches this command a GROUP_END message is emitted. - // The start of the group is marked is marked using MAV_CMD_GROUP_START with the same group id. - // Group ids are expected, but not required, to iterate sequentially. - // Groups can be nested. - MAV_CMD_GROUP_END MAV_CMD = 302 // Enable the specified standard MAVLink mode. // If the mode is not supported the vehicle should ACK with MAV_RESULT_FAILED. MAV_CMD_DO_SET_STANDARD_MODE MAV_CMD = 262 @@ -633,8 +623,6 @@ var labels_MAV_CMD = map[MAV_CMD]string{ MAV_CMD_DO_FIGURE_EIGHT: "MAV_CMD_DO_FIGURE_EIGHT", MAV_CMD_PARAM_TRANSACTION: "MAV_CMD_PARAM_TRANSACTION", MAV_CMD_DO_UPGRADE: "MAV_CMD_DO_UPGRADE", - MAV_CMD_GROUP_START: "MAV_CMD_GROUP_START", - MAV_CMD_GROUP_END: "MAV_CMD_GROUP_END", MAV_CMD_DO_SET_STANDARD_MODE: "MAV_CMD_DO_SET_STANDARD_MODE", MAV_CMD_SET_AT_S_PARAM: "MAV_CMD_SET_AT_S_PARAM", MAV_CMD_DO_SET_SYS_CMP_ID: "MAV_CMD_DO_SET_SYS_CMP_ID", @@ -811,8 +799,6 @@ var values_MAV_CMD = map[string]MAV_CMD{ "MAV_CMD_DO_FIGURE_EIGHT": MAV_CMD_DO_FIGURE_EIGHT, "MAV_CMD_PARAM_TRANSACTION": MAV_CMD_PARAM_TRANSACTION, "MAV_CMD_DO_UPGRADE": MAV_CMD_DO_UPGRADE, - "MAV_CMD_GROUP_START": MAV_CMD_GROUP_START, - "MAV_CMD_GROUP_END": MAV_CMD_GROUP_END, "MAV_CMD_DO_SET_STANDARD_MODE": MAV_CMD_DO_SET_STANDARD_MODE, "MAV_CMD_SET_AT_S_PARAM": MAV_CMD_SET_AT_S_PARAM, "MAV_CMD_DO_SET_SYS_CMP_ID": MAV_CMD_DO_SET_SYS_CMP_ID, diff --git a/pkg/dialects/development/enum_mav_fuel_type.go b/pkg/dialects/development/enum_mav_fuel_type.go index 42ce9e13e..ca200ee2a 100644 --- a/pkg/dialects/development/enum_mav_fuel_type.go +++ b/pkg/dialects/development/enum_mav_fuel_type.go @@ -3,56 +3,17 @@ package development import ( - "fmt" - "strconv" + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" ) // Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. -type MAV_FUEL_TYPE uint64 +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE const ( - // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1. - MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = 0 + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. - MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = 1 + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). - MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = 2 + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS ) - -var labels_MAV_FUEL_TYPE = map[MAV_FUEL_TYPE]string{ - MAV_FUEL_TYPE_UNKNOWN: "MAV_FUEL_TYPE_UNKNOWN", - MAV_FUEL_TYPE_LIQUID: "MAV_FUEL_TYPE_LIQUID", - MAV_FUEL_TYPE_GAS: "MAV_FUEL_TYPE_GAS", -} - -var values_MAV_FUEL_TYPE = map[string]MAV_FUEL_TYPE{ - "MAV_FUEL_TYPE_UNKNOWN": MAV_FUEL_TYPE_UNKNOWN, - "MAV_FUEL_TYPE_LIQUID": MAV_FUEL_TYPE_LIQUID, - "MAV_FUEL_TYPE_GAS": MAV_FUEL_TYPE_GAS, -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (e MAV_FUEL_TYPE) MarshalText() ([]byte, error) { - if name, ok := labels_MAV_FUEL_TYPE[e]; ok { - return []byte(name), nil - } - return []byte(strconv.Itoa(int(e))), nil -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -func (e *MAV_FUEL_TYPE) UnmarshalText(text []byte) error { - if value, ok := values_MAV_FUEL_TYPE[string(text)]; ok { - *e = value - } else if value, err := strconv.Atoi(string(text)); err == nil { - *e = MAV_FUEL_TYPE(value) - } else { - return fmt.Errorf("invalid label '%s'", text) - } - return nil -} - -// String implements the fmt.Stringer interface. -func (e MAV_FUEL_TYPE) String() string { - val, _ := e.MarshalText() - return string(val) -} diff --git a/pkg/dialects/development/enum_wifi_network_security.go b/pkg/dialects/development/enum_wifi_network_security.go deleted file mode 100644 index aab84eeee..000000000 --- a/pkg/dialects/development/enum_wifi_network_security.go +++ /dev/null @@ -1,70 +0,0 @@ -//autogenerated:yes -//nolint:revive,misspell,govet,lll,dupl,gocritic -package development - -import ( - "fmt" - "strconv" -) - -// WiFi wireless security protocols. -type WIFI_NETWORK_SECURITY uint64 - -const ( - // Undefined or unknown security protocol. - WIFI_NETWORK_SECURITY_UNDEFINED WIFI_NETWORK_SECURITY = 0 - // Open network, no security. - WIFI_NETWORK_SECURITY_OPEN WIFI_NETWORK_SECURITY = 1 - // WEP. - WIFI_NETWORK_SECURITY_WEP WIFI_NETWORK_SECURITY = 2 - // WPA1. - WIFI_NETWORK_SECURITY_WPA1 WIFI_NETWORK_SECURITY = 3 - // WPA2. - WIFI_NETWORK_SECURITY_WPA2 WIFI_NETWORK_SECURITY = 4 - // WPA3. - WIFI_NETWORK_SECURITY_WPA3 WIFI_NETWORK_SECURITY = 5 -) - -var labels_WIFI_NETWORK_SECURITY = map[WIFI_NETWORK_SECURITY]string{ - WIFI_NETWORK_SECURITY_UNDEFINED: "WIFI_NETWORK_SECURITY_UNDEFINED", - WIFI_NETWORK_SECURITY_OPEN: "WIFI_NETWORK_SECURITY_OPEN", - WIFI_NETWORK_SECURITY_WEP: "WIFI_NETWORK_SECURITY_WEP", - WIFI_NETWORK_SECURITY_WPA1: "WIFI_NETWORK_SECURITY_WPA1", - WIFI_NETWORK_SECURITY_WPA2: "WIFI_NETWORK_SECURITY_WPA2", - WIFI_NETWORK_SECURITY_WPA3: "WIFI_NETWORK_SECURITY_WPA3", -} - -var values_WIFI_NETWORK_SECURITY = map[string]WIFI_NETWORK_SECURITY{ - "WIFI_NETWORK_SECURITY_UNDEFINED": WIFI_NETWORK_SECURITY_UNDEFINED, - "WIFI_NETWORK_SECURITY_OPEN": WIFI_NETWORK_SECURITY_OPEN, - "WIFI_NETWORK_SECURITY_WEP": WIFI_NETWORK_SECURITY_WEP, - "WIFI_NETWORK_SECURITY_WPA1": WIFI_NETWORK_SECURITY_WPA1, - "WIFI_NETWORK_SECURITY_WPA2": WIFI_NETWORK_SECURITY_WPA2, - "WIFI_NETWORK_SECURITY_WPA3": WIFI_NETWORK_SECURITY_WPA3, -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (e WIFI_NETWORK_SECURITY) MarshalText() ([]byte, error) { - if name, ok := labels_WIFI_NETWORK_SECURITY[e]; ok { - return []byte(name), nil - } - return []byte(strconv.Itoa(int(e))), nil -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -func (e *WIFI_NETWORK_SECURITY) UnmarshalText(text []byte) error { - if value, ok := values_WIFI_NETWORK_SECURITY[string(text)]; ok { - *e = value - } else if value, err := strconv.Atoi(string(text)); err == nil { - *e = WIFI_NETWORK_SECURITY(value) - } else { - return fmt.Errorf("invalid label '%s'", text) - } - return nil -} - -// String implements the fmt.Stringer interface. -func (e WIFI_NETWORK_SECURITY) String() string { - val, _ := e.MarshalText() - return string(val) -} diff --git a/pkg/dialects/development/enum_wifi_network_security_test.go b/pkg/dialects/development/enum_wifi_network_security_test.go deleted file mode 100644 index 4d63d28e5..000000000 --- a/pkg/dialects/development/enum_wifi_network_security_test.go +++ /dev/null @@ -1,14 +0,0 @@ -//autogenerated:yes -//nolint:revive,govet,errcheck -package development - -import ( - "testing" -) - -func TestEnum_WIFI_NETWORK_SECURITY(t *testing.T) { - var e WIFI_NETWORK_SECURITY - e.UnmarshalText([]byte{}) - e.MarshalText() - e.String() -} diff --git a/pkg/dialects/development/message_fuel_status.go b/pkg/dialects/development/message_fuel_status.go index 16d0a1975..7654441c4 100644 --- a/pkg/dialects/development/message_fuel_status.go +++ b/pkg/dialects/development/message_fuel_status.go @@ -2,6 +2,10 @@ //nolint:revive,misspell,govet,lll package development +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + // Fuel status. // This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. // The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. @@ -12,26 +16,4 @@ package development // This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. // If both messages are sent for the same fuel system, the ids and corresponding information must match. // This should be streamed (nominally at 0.1 Hz). -type MessageFuelStatus struct { - // Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2. - Id uint8 - // Capacity when full. Must be provided. - MaximumFuel float32 - // Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided. - ConsumedFuel float32 - // Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided. - RemainingFuel float32 - // Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided. - PercentRemaining uint8 - // Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided. - FlowRate float32 - // Fuel temperature. NaN: field not provided. - Temperature float32 - // Fuel type. Defines units for fuel capacity and consumption fields above. - FuelType MAV_FUEL_TYPE `mavenum:"uint32"` -} - -// GetID implements the message.Message interface. -func (*MessageFuelStatus) GetID() uint32 { - return 371 -} +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/development/message_wifi_network_info.go b/pkg/dialects/development/message_wifi_network_info.go deleted file mode 100644 index 6de5bc5c1..000000000 --- a/pkg/dialects/development/message_wifi_network_info.go +++ /dev/null @@ -1,22 +0,0 @@ -//autogenerated:yes -//nolint:revive,misspell,govet,lll -package development - -// Detected WiFi network status information. This message is sent per each WiFi network detected in range with known SSID and general status parameters. -type MessageWifiNetworkInfo struct { - // Name of Wi-Fi network (SSID). - Ssid string `mavlen:"32"` - // WiFi network operating channel ID. Set to 0 if unknown or unidentified. - ChannelId uint8 - // WiFi network signal quality. - SignalQuality uint8 - // WiFi network data rate. Set to UINT16_MAX if data_rate information is not supplied. - DataRate uint16 - // WiFi network security type. - Security WIFI_NETWORK_SECURITY `mavenum:"uint8"` -} - -// GetID implements the message.Message interface. -func (*MessageWifiNetworkInfo) GetID() uint32 { - return 298 -} diff --git a/pkg/dialects/matrixpilot/dialect.go b/pkg/dialects/matrixpilot/dialect.go index 6b2ccf192..f9d34280a 100644 --- a/pkg/dialects/matrixpilot/dialect.go +++ b/pkg/dialects/matrixpilot/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/matrixpilot/enum_mav_fuel_type.go b/pkg/dialects/matrixpilot/enum_mav_fuel_type.go new file mode 100644 index 000000000..38e058a34 --- /dev/null +++ b/pkg/dialects/matrixpilot/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/matrixpilot/message_fuel_status.go b/pkg/dialects/matrixpilot/message_fuel_status.go new file mode 100644 index 000000000..6246a457e --- /dev/null +++ b/pkg/dialects/matrixpilot/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package matrixpilot + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/paparazzi/dialect.go b/pkg/dialects/paparazzi/dialect.go index 7b4d21393..5cbc72b7c 100644 --- a/pkg/dialects/paparazzi/dialect.go +++ b/pkg/dialects/paparazzi/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/paparazzi/enum_mav_fuel_type.go b/pkg/dialects/paparazzi/enum_mav_fuel_type.go new file mode 100644 index 000000000..ab2d4c8f7 --- /dev/null +++ b/pkg/dialects/paparazzi/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/paparazzi/message_fuel_status.go b/pkg/dialects/paparazzi/message_fuel_status.go new file mode 100644 index 000000000..4b3c93684 --- /dev/null +++ b/pkg/dialects/paparazzi/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package paparazzi + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/pythonarraytest/dialect.go b/pkg/dialects/pythonarraytest/dialect.go index 3ba85d325..e718fa1dd 100644 --- a/pkg/dialects/pythonarraytest/dialect.go +++ b/pkg/dialects/pythonarraytest/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/pythonarraytest/enum_mav_fuel_type.go b/pkg/dialects/pythonarraytest/enum_mav_fuel_type.go new file mode 100644 index 000000000..190021722 --- /dev/null +++ b/pkg/dialects/pythonarraytest/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/pythonarraytest/message_fuel_status.go b/pkg/dialects/pythonarraytest/message_fuel_status.go new file mode 100644 index 000000000..0ea4ec14a --- /dev/null +++ b/pkg/dialects/pythonarraytest/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package pythonarraytest + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/storm32/dialect.go b/pkg/dialects/storm32/dialect.go index 0ed32d116..cc0577c22 100644 --- a/pkg/dialects/storm32/dialect.go +++ b/pkg/dialects/storm32/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/storm32/enum_mav_fuel_type.go b/pkg/dialects/storm32/enum_mav_fuel_type.go new file mode 100644 index 000000000..4343d977b --- /dev/null +++ b/pkg/dialects/storm32/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/storm32/message_fuel_status.go b/pkg/dialects/storm32/message_fuel_status.go new file mode 100644 index 000000000..5ee10582b --- /dev/null +++ b/pkg/dialects/storm32/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package storm32 + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/ualberta/dialect.go b/pkg/dialects/ualberta/dialect.go index fb4396651..ea91ce441 100644 --- a/pkg/dialects/ualberta/dialect.go +++ b/pkg/dialects/ualberta/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/ualberta/enum_mav_fuel_type.go b/pkg/dialects/ualberta/enum_mav_fuel_type.go new file mode 100644 index 000000000..9bd82d502 --- /dev/null +++ b/pkg/dialects/ualberta/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/ualberta/message_fuel_status.go b/pkg/dialects/ualberta/message_fuel_status.go new file mode 100644 index 000000000..9bde5aa65 --- /dev/null +++ b/pkg/dialects/ualberta/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package ualberta + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus diff --git a/pkg/dialects/uavionix/dialect.go b/pkg/dialects/uavionix/dialect.go index 3c135d70f..996fa9817 100644 --- a/pkg/dialects/uavionix/dialect.go +++ b/pkg/dialects/uavionix/dialect.go @@ -212,6 +212,7 @@ var dial = &dialect.Dialect{ &MessageDebugFloatArray{}, &MessageOrbitExecutionStatus{}, &MessageSmartBatteryInfo{}, + &MessageFuelStatus{}, &MessageBatteryInfo{}, &MessageGeneratorStatus{}, &MessageActuatorOutputStatus{}, diff --git a/pkg/dialects/uavionix/enum_mav_fuel_type.go b/pkg/dialects/uavionix/enum_mav_fuel_type.go new file mode 100644 index 000000000..11b85294f --- /dev/null +++ b/pkg/dialects/uavionix/enum_mav_fuel_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" +) + +// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates. +type MAV_FUEL_TYPE = common.MAV_FUEL_TYPE + +const ( + // Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1). + MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_UNKNOWN + // A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second. + MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_LIQUID + // A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s). + MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = common.MAV_FUEL_TYPE_GAS +) diff --git a/pkg/dialects/uavionix/message_fuel_status.go b/pkg/dialects/uavionix/message_fuel_status.go new file mode 100644 index 000000000..dda3abd28 --- /dev/null +++ b/pkg/dialects/uavionix/message_fuel_status.go @@ -0,0 +1,19 @@ +//autogenerated:yes +//nolint:revive,misspell,govet,lll +package uavionix + +import ( + "github.com/bluenviron/gomavlib/v3/pkg/dialects/common" +) + +// Fuel status. +// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot. +// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. +// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. +// A recipient can assume that if these fields are supplied they are accurate. +// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). +// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). +// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. +// If both messages are sent for the same fuel system, the ids and corresponding information must match. +// This should be streamed (nominally at 0.1 Hz). +type MessageFuelStatus = common.MessageFuelStatus