github.com/bluenviron/gomavlib/v2@v2.2.1-0.20240308101627-2c07e3da629c/pkg/dialects/development/message_radio_rc_channels.go (about)

     1  //autogenerated:yes
     2  //nolint:revive,misspell,govet,lll
     3  package development
     4  
     5  // RC channel outputs from a MAVLink RC receiver for input to a flight controller or other components (allows an RC receiver to connect via MAVLink instead of some other protocol such as PPM-Sum or S.BUS).
     6  // Note that this is not intended to be an over-the-air format, and does not replace RC_CHANNELS and similar messages reported by the flight controller.
     7  // The target_system field should normally be set to the system id of the system to control, typically the flight controller.
     8  // The target_component field can normally be set to 0, so that all components of the system can receive the message.
     9  // The channels array field can publish up to 32 channels; the number of channel items used in the array is specified in the count field.
    10  // The time_last_update_ms field contains the timestamp of the last received valid channels data in the receiver's time domain.
    11  // The count field indicates the first index of the channel array that is not used for channel data (this and later indexes are zero-filled).
    12  // The RADIO_RC_CHANNELS_FLAGS_OUTDATED flag is set by the receiver if the channels data is not up-to-date (for example, if new data from the transmitter could not be validated so the last valid data is resent).
    13  // The RADIO_RC_CHANNELS_FLAGS_FAILSAFE failsafe flag is set by the receiver if the receiver's failsafe condition is met (implementation dependent, e.g., connection to the RC radio is lost).
    14  // In this case time_last_update_ms still contains the timestamp of the last valid channels data, but the content of the channels data is not defined by the protocol (it is up to the implementation of the receiver).
    15  // For instance, the channels data could contain failsafe values configured in the receiver; the default is to carry the last valid data.
    16  // Note: The RC channels fields are extensions to ensure that they are located at the end of the serialized payload and subject to MAVLink's trailing-zero trimming.
    17  type MessageRadioRcChannels struct {
    18  	// System ID (ID of target system, normally flight controller).
    19  	TargetSystem uint8
    20  	// Component ID (normally 0 for broadcast).
    21  	TargetComponent uint8
    22  	// Time when the data in the channels field were last updated (time since boot in the receiver's time domain).
    23  	TimeLastUpdateMs uint32
    24  	// Radio RC channels status flags.
    25  	Flags RADIO_RC_CHANNELS_FLAGS `mavenum:"uint16"`
    26  	// Total number of RC channels being received. This can be larger than 32, indicating that more channels are available but not given in this message.
    27  	Count uint8
    28  	// RC channels.
    29  	// Channel values are in centered 13 bit format. Range is -4096 to 4096, center is 0. Conversion to PWM is x * 5/32 + 1500.
    30  	// Channels with indexes equal or above count should be set to 0, to benefit from MAVLink's trailing-zero trimming.
    31  	Channels [32]int16 `mavext:"true"`
    32  }
    33  
    34  // GetID implements the message.Message interface.
    35  func (*MessageRadioRcChannels) GetID() uint32 {
    36  	return 420
    37  }