// Pack returns a packed byte array which represents a RollPitchYawRatesThrustSetpoint payload
324145
func (m *RollPitchYawRatesThrustSetpoint) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	binary.Write(data, binary.LittleEndian, m.ROLL_RATE)
	binary.Write(data, binary.LittleEndian, m.PITCH_RATE)
	binary.Write(data, binary.LittleEndian, m.YAW_RATE)
	binary.Write(data, binary.LittleEndian, m.THRUST)
	return data.Bytes()
}
1007637
func (m *VisionPositionEstimate) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.USEC)
	binary.Write(data, binary.LittleEndian, m.X)
	binary.Write(data, binary.LittleEndian, m.Y)
	binary.Write(data, binary.LittleEndian, m.Z)
	binary.Write(data, binary.LittleEndian, m.ROLL)
	binary.Write(data, binary.LittleEndian, m.PITCH)
	binary.Write(data, binary.LittleEndian, m.YAW)
	return data.Bytes()
}
829758
func (m *ParamRequestRead) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.PARAM_INDEX)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	binary.Write(data, binary.LittleEndian, m.TARGET_COMPONENT)
	binary.Write(data, binary.LittleEndian, m.PARAM_ID)
	return data.Bytes()
}
208572
func (arguments Arguments) Pack(args ...interface{}) ([]byte, error) {
	// Make sure arguments match up and pack them
	abiArgs := arguments
	if len(args) != len(abiArgs) {
		return nil, fmt.Errorf("argument count mismatch: %d for %d", len(args), len(abiArgs))
	}
	// variable input is the output appended at the end of packed
	// output. This is used for strings and bytes types input.
	var variableInput []byte

	// input offset is the bytes offset for packed output
	inputOffset := 0
	for _, abiArg := range abiArgs {
		inputOffset += getTypeSize(abiArg.Type)
	}
	var ret []byte
	for i, a := range args {
		input := abiArgs[i]
		// pack the input
		packed, err := input.Type.pack(reflect.ValueOf(a))
		if err != nil {
			return nil, err
		}
		// check for dynamic types
		if isDynamicType(input.Type) {
			// set the offset
			ret = append(ret, packNum(reflect.ValueOf(inputOffset))...)
			// calculate next offset
			inputOffset += len(packed)
			// append to variable input
			variableInput = append(variableInput, packed...)
		} else {
			// append the packed value to the input
			ret = append(ret, packed...)
		}
	}
	// append the variable input at the end of the packed input
	ret = append(ret, variableInput...)

	return ret, nil
}
900357
func (m *CommandLong) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.PARAM1)
	binary.Write(data, binary.LittleEndian, m.PARAM2)
	binary.Write(data, binary.LittleEndian, m.PARAM3)
	binary.Write(data, binary.LittleEndian, m.PARAM4)
	binary.Write(data, binary.LittleEndian, m.PARAM5)
	binary.Write(data, binary.LittleEndian, m.PARAM6)
	binary.Write(data, binary.LittleEndian, m.PARAM7)
	binary.Write(data, binary.LittleEndian, m.COMMAND)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	binary.Write(data, binary.LittleEndian, m.TARGET_COMPONENT)
	binary.Write(data, binary.LittleEndian, m.CONFIRMATION)
	return data.Bytes()
}
1088774
func (m *SetQuadSwarmLedRollPitchYawThrust) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.ROLL)
	binary.Write(data, binary.LittleEndian, m.PITCH)
	binary.Write(data, binary.LittleEndian, m.YAW)
	binary.Write(data, binary.LittleEndian, m.THRUST)
	binary.Write(data, binary.LittleEndian, m.GROUP)
	binary.Write(data, binary.LittleEndian, m.MODE)
	binary.Write(data, binary.LittleEndian, m.LED_RED)
	binary.Write(data, binary.LittleEndian, m.LED_BLUE)
	binary.Write(data, binary.LittleEndian, m.LED_GREEN)
	return data.Bytes()
}
1331906
func (m *ChangeOperatorControl) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	binary.Write(data, binary.LittleEndian, m.CONTROL_REQUEST)
	binary.Write(data, binary.LittleEndian, m.VERSION)
	binary.Write(data, binary.LittleEndian, m.PASSKEY)
	return data.Bytes()
}
1079820
func (m *LogRequestList) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.START)
	binary.Write(data, binary.LittleEndian, m.END)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	binary.Write(data, binary.LittleEndian, m.TARGET_COMPONENT)
	return data.Bytes()
}
1244402
func (a *arrayHmnode) pack(idx int) hmnode {
	newArray := make([]interface{}, 2*(a.count-1))
	j := 1
	var bitmap uint32 = 0
	//TODO: change these to range iterations over subslices
	for i := 0; i < idx; i++ {
		if a.array[i] != nil {
			newArray[j] = a.array[i]
			bitmap = bitmap | 1<<uint32(i)
			j = j + 2
		}
	}
	for i := idx + 1; i < len(a.array); i++ {
		if a.array[i] != nil {
			newArray[j] = a.array[i]
			bitmap = bitmap | 1<<uint32(i)
			j = j + 2
		}
	}
	return &bitmapIndexedHmnode{bitmap, newArray}
}
770575
func (m *HilState) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.ROLL)
	binary.Write(data, binary.LittleEndian, m.PITCH)
	binary.Write(data, binary.LittleEndian, m.YAW)
	binary.Write(data, binary.LittleEndian, m.ROLLSPEED)
	binary.Write(data, binary.LittleEndian, m.PITCHSPEED)
	binary.Write(data, binary.LittleEndian, m.YAWSPEED)
	binary.Write(data, binary.LittleEndian, m.LAT)
	binary.Write(data, binary.LittleEndian, m.LON)
	binary.Write(data, binary.LittleEndian, m.ALT)
	binary.Write(data, binary.LittleEndian, m.VX)
	binary.Write(data, binary.LittleEndian, m.VY)
	binary.Write(data, binary.LittleEndian, m.VZ)
	binary.Write(data, binary.LittleEndian, m.XACC)
	binary.Write(data, binary.LittleEndian, m.YACC)
	binary.Write(data, binary.LittleEndian, m.ZACC)
	return data.Bytes()
}
419809
func (m *ManualSetpoint) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_BOOT_MS)
	binary.Write(data, binary.LittleEndian, m.ROLL)
	binary.Write(data, binary.LittleEndian, m.PITCH)
	binary.Write(data, binary.LittleEndian, m.YAW)
	binary.Write(data, binary.LittleEndian, m.THRUST)
	binary.Write(data, binary.LittleEndian, m.MODE_SWITCH)
	binary.Write(data, binary.LittleEndian, m.MANUAL_OVERRIDE_SWITCH)
	return data.Bytes()
}
1169805
func (m *HilOpticalFlow) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.FLOW_COMP_M_X)
	binary.Write(data, binary.LittleEndian, m.FLOW_COMP_M_Y)
	binary.Write(data, binary.LittleEndian, m.GROUND_DISTANCE)
	binary.Write(data, binary.LittleEndian, m.FLOW_X)
	binary.Write(data, binary.LittleEndian, m.FLOW_Y)
	binary.Write(data, binary.LittleEndian, m.SENSOR_ID)
	binary.Write(data, binary.LittleEndian, m.QUALITY)
	return data.Bytes()
}
1197991
func (m *SysStatus) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.ONBOARD_CONTROL_SENSORS_PRESENT)
	binary.Write(data, binary.LittleEndian, m.ONBOARD_CONTROL_SENSORS_ENABLED)
	binary.Write(data, binary.LittleEndian, m.ONBOARD_CONTROL_SENSORS_HEALTH)
	binary.Write(data, binary.LittleEndian, m.LOAD)
	binary.Write(data, binary.LittleEndian, m.VOLTAGE_BATTERY)
	binary.Write(data, binary.LittleEndian, m.CURRENT_BATTERY)
	binary.Write(data, binary.LittleEndian, m.DROP_RATE_COMM)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COMM)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT1)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT2)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT3)
	binary.Write(data, binary.LittleEndian, m.ERRORS_COUNT4)
	binary.Write(data, binary.LittleEndian, m.BATTERY_REMAINING)
	return data.Bytes()
}
196540
func (m *DebugVect) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.X)
	binary.Write(data, binary.LittleEndian, m.Y)
	binary.Write(data, binary.LittleEndian, m.Z)
	binary.Write(data, binary.LittleEndian, m.NAME)
	return data.Bytes()
}
794750
func (m *LocalPositionSetpoint) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.X)
	binary.Write(data, binary.LittleEndian, m.Y)
	binary.Write(data, binary.LittleEndian, m.Z)
	binary.Write(data, binary.LittleEndian, m.YAW)
	binary.Write(data, binary.LittleEndian, m.COORDINATE_FRAME)
	return data.Bytes()
}
981855
func (m *SetRollPitchYawThrust) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.ROLL)
	binary.Write(data, binary.LittleEndian, m.PITCH)
	binary.Write(data, binary.LittleEndian, m.YAW)
	binary.Write(data, binary.LittleEndian, m.THRUST)
	binary.Write(data, binary.LittleEndian, m.TARGET_SYSTEM)
	binary.Write(data, binary.LittleEndian, m.TARGET_COMPONENT)
	return data.Bytes()
}
836655
func (m *ServoOutputRaw) Pack() []byte {
	data := new(bytes.Buffer)
	binary.Write(data, binary.LittleEndian, m.TIME_USEC)
	binary.Write(data, binary.LittleEndian, m.SERVO1_RAW)
	binary.Write(data, binary.LittleEndian, m.SERVO2_RAW)
	binary.Write(data, binary.LittleEndian, m.SERVO3_RAW)
	binary.Write(data, binary.LittleEndian, m.SERVO4_RAW)
	binary.Write(data, binary.LittleEndian, m.SERVO5_RAW)
	binary.Write(data, binary.LittleEndian, m.SERVO6_RAW)
	binary.Write(data, binary.LittleEndian, m.SERVO7_RAW)
	binary.Write(data, binary.LittleEndian, m.SERVO8_RAW)
	binary.Write(data, binary.LittleEndian, m.PORT)
	return data.Bytes()
}