Skip to content

Commit

Permalink
Started adding types for stabilizer bitcraze#102
Browse files Browse the repository at this point in the history
  • Loading branch information
ataffanel committed Mar 16, 2016
1 parent 547888e commit d177bde
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions src/modules/interface/stabilizer_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* || ____ _ __
* +------+ / __ )(_) /_______________ _____ ___
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
*
* Crazyflie control firmware
*
* Copyright (C) 2011-2012 Bitcraze AB
*
* 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, in version 3.
*
* 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, see <http://www.gnu.org/licenses/>.
*
* stabilizer.h: Stabilizer orchestrator
*/
#ifndef __STABILIZER_TYPES_H__
#define __STABILIZER_TYPES_H__

#include <stdint.h>

/* Data structure used by the stabilizer subsystem.
* All have a timestamp to be set when the data is calculated.
*/

/** Attitude in euler angle form */
typedef struct attitude_s {
uint32_t timestamp; // Timestamp when the data was computed

float roll;
float pitch;
float yaw;
} attitude_t;

/* x,y,z vector */
typedef struct point_s {
uint32_t timestamp; // Timestamp when the data was computed

float x;
float y;
float z;
} point_t;

/* Orientation as a quaternion */
typedef struct quaternion_s {
uint32_t timestamp;

union {
struct {
float q0;
float q1;
float q2;
float q3;
};
struct {
float x;
float y;
float z;
float w;
};
};
} quaternion_t;

#endif

0 comments on commit d177bde

Please sign in to comment.