QuadroCopter  0.1.4
quadro::quadroCopter Class Reference

#include <quadroCopter.h>

Classes

struct  target
 

Public Types

enum  STATE { NORMAL = 1, MOVING = 2, URGENT = 5, PANIC = 10 }
 

Public Member Functions

 quadroCopter ()
 
void setStartupTargets ()
 
void monitorSensorData ()
 

Public Attributes

struct quadro::quadroCopter::target height
 
struct quadro::quadroCopter::target roll
 
struct quadro::quadroCopter::target pitch
 
struct quadro::quadroCopter::target heading
 
enum quadro::quadroCopter::STATE state
 
orientationmyOrientation
 
aeronauticsmyAeronautics
 

Member Enumeration Documentation

What is the quadcopters current state

Enumerator
NORMAL 
MOVING 
URGENT 
PANIC 
60  {
61  NORMAL = 1,
62  MOVING = 2,
63  URGENT = 5,
64  PANIC = 10
65  } state;
Definition: quadroCopter.h:64
Definition: quadroCopter.h:62
enum quadro::quadroCopter::STATE state
Definition: quadroCopter.h:61
Definition: quadroCopter.h:63

Constructor & Destructor Documentation

quadroCopter::quadroCopter ( )

quadroCopter constructor Initialises motors Sets up a new orientation object which contains all sensor data related to orientation. Also sets up the PID controllers. none

< myOrientation sets up a new orientation object

< myMovement sets up a new orientation object

25 {
26 
27  try{
28  myOrientation = new orientation();
29  myAeronautics = new aeronautics();
30  }
31  catch( setupException& e ) {
32  //If a setup error occurred, we need to exit before we start flying otherwise catastrophic consequences undoubtedly will follow...
33  //Re throw an exception here for the main thread to catch for a proper exit.
34  throw new fatalException( e.what() );
35  }
36 
38 
39  sleep( 1 ); //wait 1 second for readings to be updated.
40 
41 }
Definition: setupException.h:34
orientation * myOrientation
Definition: quadroCopter.h:70
Definition: orientation.h:38
const char * what() const
Definition: setupException.h:42
Definition: fatalException.h:34
Definition: aeronautics.h:27
aeronautics * myAeronautics
Definition: quadroCopter.h:75
void setStartupTargets()
Definition: quadroCopter.cpp:43

Member Function Documentation

void quadroCopter::monitorSensorData ( )

Compare sensor data against targets and send data to Aeronautic library.

52 {
55 }
double calculate(double setpoint, double pv)
Definition: PID.cpp:35
float pitch
Filtered pitch value stored as a float.
Definition: orientation.h:75
struct quadro::quadroCopter::target pitch
struct quadro::quadroCopter::target roll
orientation * myOrientation
Definition: quadroCopter.h:70
double targetVal
Definition: quadroCopter.h:54
float roll
Filtered roll value stored as a float.
Definition: orientation.h:74
aeronautics * myAeronautics
Definition: quadroCopter.h:75
PID * rollPID
Definition: orientation.h:100
PID * pitchPID
Definition: orientation.h:95
void maintainRoll(double _duty_increment, float _roll)
Definition: aeronautics.cpp:55
void maintainPitch(double _duty_increment, float _pitch)
Definition: aeronautics.cpp:76
void quadroCopter::setStartupTargets ( )

setStartupTargets() This method is only called once - it determines what the quadcopter will do on startup.

Parameters
none
Returns
none
44 {
45  height.targetVal = 25.00;
46  pitch.targetVal = 0.00;
47  roll.targetVal = 0.00;
48  //heading.targetVal = myOrientation->heading;
49 }
struct quadro::quadroCopter::target pitch
struct quadro::quadroCopter::target roll
double targetVal
Definition: quadroCopter.h:54
struct quadro::quadroCopter::target height

Member Data Documentation

struct quadro::quadroCopter::target quadro::quadroCopter::heading
struct quadro::quadroCopter::target quadro::quadroCopter::height
aeronautics* quadro::quadroCopter::myAeronautics

Pointer for a new aeronautics object

orientation* quadro::quadroCopter::myOrientation

Pointer for a new orientation object

struct quadro::quadroCopter::target quadro::quadroCopter::pitch
struct quadro::quadroCopter::target quadro::quadroCopter::roll
enum quadro::quadroCopter::STATE quadro::quadroCopter::state

The documentation for this class was generated from the following files: