1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00
LibrePilot/flight/OpenPilot/UAVObjects/inc/manualcontrolcommand.h
peabody124 ba3ecada1d Flight/ManualControl: Implemented settings to change what the Mode switch does
so it can also change parameters of Stabilization.  Please check your aircraft
behavior with this patch, but default behavior should be unchanged.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1878 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-04 19:48:09 +00:00

128 lines
5.9 KiB
C

/**
******************************************************************************
* @addtogroup UAVObjects OpenPilot UAVObjects
* @{
* @addtogroup ManualControlCommand ManualControlCommand
* @brief The output from the @ref ManualControlModule which descodes the receiver inputs. Overriden by GCS for fly-by-wire control.
*
* Autogenerated files and functions for ManualControlCommand Object
* @{
*
* @file manualcontrolcommand.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Implementation of the ManualControlCommand object. This file has been
* automatically generated by the UAVObjectGenerator.
*
* @note Object definition file: manualcontrolcommand.xml.
* This is an automatically generated file.
* DO NOT modify manually.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANUALCONTROLCOMMAND_H
#define MANUALCONTROLCOMMAND_H
// Object constants
#define MANUALCONTROLCOMMAND_OBJID 2841592332U
#define MANUALCONTROLCOMMAND_NAME "ManualControlCommand"
#define MANUALCONTROLCOMMAND_METANAME "ManualControlCommandMeta"
#define MANUALCONTROLCOMMAND_ISSINGLEINST 1
#define MANUALCONTROLCOMMAND_ISSETTINGS 0
#define MANUALCONTROLCOMMAND_NUMBYTES sizeof(ManualControlCommandData)
// Object access macros
/**
* @function ManualControlCommandGet(dataOut)
* @brief Populate a ManualControlCommandData object
* @param[out] dataOut
*/
#define ManualControlCommandGet(dataOut) UAVObjGetData(ManualControlCommandHandle(), dataOut)
#define ManualControlCommandSet(dataIn) UAVObjSetData(ManualControlCommandHandle(), dataIn)
#define ManualControlCommandInstGet(instId, dataOut) UAVObjGetInstanceData(ManualControlCommandHandle(), instId, dataOut)
#define ManualControlCommandInstSet(instId, dataIn) UAVObjSetInstanceData(ManualControlCommandHandle(), instId, dataIn)
#define ManualControlCommandConnectQueue(queue) UAVObjConnectQueue(ManualControlCommandHandle(), queue, EV_MASK_ALL_UPDATES)
#define ManualControlCommandConnectCallback(cb) UAVObjConnectCallback(ManualControlCommandHandle(), cb, EV_MASK_ALL_UPDATES)
#define ManualControlCommandCreateInstance() UAVObjCreateInstance(ManualControlCommandHandle())
#define ManualControlCommandRequestUpdate() UAVObjRequestUpdate(ManualControlCommandHandle())
#define ManualControlCommandRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(ManualControlCommandHandle(), instId)
#define ManualControlCommandUpdated() UAVObjUpdated(ManualControlCommandHandle())
#define ManualControlCommandInstUpdated(instId) UAVObjUpdated(ManualControlCommandHandle(), instId)
#define ManualControlCommandGetMetadata(dataOut) UAVObjGetMetadata(ManualControlCommandHandle(), dataOut)
#define ManualControlCommandSetMetadata(dataIn) UAVObjSetMetadata(ManualControlCommandHandle(), dataIn)
#define ManualControlCommandReadOnly(dataIn) UAVObjReadOnly(ManualControlCommandHandle())
// Object data
typedef struct {
uint8_t Connected;
uint8_t Armed;
float Roll;
float Pitch;
float Yaw;
float Throttle;
uint8_t FlightMode;
uint8_t StabilizationSettings[3];
float Accessory1;
float Accessory2;
float Accessory3;
int16_t Channel[8];
} __attribute__((packed)) ManualControlCommandData;
// Field information
// Field Connected information
/* Enumeration options for field Connected */
typedef enum { MANUALCONTROLCOMMAND_CONNECTED_FALSE=0, MANUALCONTROLCOMMAND_CONNECTED_TRUE=1 } ManualControlCommandConnectedOptions;
// Field Armed information
/* Enumeration options for field Armed */
typedef enum { MANUALCONTROLCOMMAND_ARMED_FALSE=0, MANUALCONTROLCOMMAND_ARMED_TRUE=1 } ManualControlCommandArmedOptions;
// Field Roll information
// Field Pitch information
// Field Yaw information
// Field Throttle information
// Field FlightMode information
/* Enumeration options for field FlightMode */
typedef enum { MANUALCONTROLCOMMAND_FLIGHTMODE_MANUAL=0, MANUALCONTROLCOMMAND_FLIGHTMODE_STABILIZED=1, MANUALCONTROLCOMMAND_FLIGHTMODE_AUTO=2 } ManualControlCommandFlightModeOptions;
// Field StabilizationSettings information
/* Enumeration options for field StabilizationSettings */
typedef enum { MANUALCONTROLCOMMAND_STABILIZATIONSETTINGS_NONE=0, MANUALCONTROLCOMMAND_STABILIZATIONSETTINGS_RATE=1, MANUALCONTROLCOMMAND_STABILIZATIONSETTINGS_POSITION=2 } ManualControlCommandStabilizationSettingsOptions;
/* Array element names for field StabilizationSettings */
typedef enum { MANUALCONTROLCOMMAND_STABILIZATIONSETTINGS_ROLL=0, MANUALCONTROLCOMMAND_STABILIZATIONSETTINGS_PITCH=1, MANUALCONTROLCOMMAND_STABILIZATIONSETTINGS_YAW=2 } ManualControlCommandStabilizationSettingsElem;
/* Number of elements for field StabilizationSettings */
#define MANUALCONTROLCOMMAND_STABILIZATIONSETTINGS_NUMELEM 3
// Field Accessory1 information
// Field Accessory2 information
// Field Accessory3 information
// Field Channel information
/* Number of elements for field Channel */
#define MANUALCONTROLCOMMAND_CHANNEL_NUMELEM 8
// Generic interface functions
int32_t ManualControlCommandInitialize();
UAVObjHandle ManualControlCommandHandle();
#endif // MANUALCONTROLCOMMAND_H
/**
* @}
* @}
*/