QuadroCopter  0.1.4
quadro::aeronautics Class Reference

#include <aeronautics.h>

Public Member Functions

 aeronautics ()
 
void maintainAltitude ()
 
void maintainHeading ()
 
void maintainRoll (double _duty_increment, float _roll)
 
void maintainPitch (double _duty_increment, float _pitch)
 

Public Attributes

dji_2212motor [4]
 

Constructor & Destructor Documentation

aeronautics::aeronautics ( )
23 {
24 
27 
30 
33 
36  //add additional motors here, specifying block and pin accordingly.
37 
38  motor[ 0 ]->init();
39  motor[ 1 ]->init();
40  motor[ 2 ]->init();
41  motor[ 3 ]->init();
42 
43 }
P8 on your BBB | USB facing you, P8 is the pin block on the right hand side.
Definition: overlayBase.h:45
GPIO PWM Pin Number 42.
Definition: overlayBase.h:52
GPIO PWM Pin Number 22.
Definition: overlayBase.h:53
GPIO PWM Pin Number 19.
Definition: overlayBase.h:54
GPIO PWM Pin Number 14.
Definition: overlayBase.h:55
Definition: dji_2212.h:32
void init()
Definition: dji_2212.cpp:37
P9 on your BBB | USB facing you, P9 is the pin block on the left hand side.
Definition: overlayBase.h:44
dji_2212 * motor[4]
Definition: aeronautics.h:35

Member Function Documentation

void aeronautics::maintainAltitude ( )

maintainAltitude() Allow the quadcopter to analyse current altitude related sensor readings against target settings and adjust motors accordingly

Parameters
none
Returns
none TODO: implement this method
46 {
47 //TODO: Plan here is to use Barometer, GPS and Sonic Sensor to maintain altitude
48 }
void aeronautics::maintainHeading ( )

maintainHeading() Allow the quadcopter to analyse current heading readings against target settings and adjust motors accordingly

Parameters
none
Returns
none TODO: implement this method
51 {
52 //TODO: Plan here is to use Magnetometer and GPS readings to maintain heading
53 }
void aeronautics::maintainPitch ( double  _duty_increment,
float  _pitch 
)

maintainPitch() - Analyse target settings and adjust motors accordingly

Parameters
none
_pitch
Returns
none TODO: handle potential errors.
77 {
78 
79  if( _pitch < 0 ) {
80  motor[ 0 ]->setTargetSpeed( long( motor[ 0 ]->currentDuty + _duty_increment ) ); //slow down
81  motor[ 1 ]->setTargetSpeed( long( motor[ 1 ]->currentDuty + _duty_increment ) ); //slow down
82  motor[ 2 ]->setTargetSpeed( long( motor[ 2 ]->currentDuty - _duty_increment ) ); //speed up
83  motor[ 3 ]->setTargetSpeed( long( motor[ 3 ]->currentDuty - _duty_increment ) ); //speed up
84  }
85  else {
86  motor[ 0 ]->setTargetSpeed( long( motor[ 0 ]->currentDuty - _duty_increment ) ); //speed up
87  motor[ 1 ]->setTargetSpeed( long( motor[ 1 ]->currentDuty - _duty_increment ) ); //speed up
88  motor[ 2 ]->setTargetSpeed( long( motor[ 2 ]->currentDuty + _duty_increment ) ); //slow down
89  motor[ 3 ]->setTargetSpeed( long( motor[ 3 ]->currentDuty + _duty_increment ) ); //slow down
90  }
91 
92 // printf( " Current Pitch : \033[22;36m%7.2f \033[0m \t Increase Value : \033[22;36m%7.2f \033[0m\n",
93 // myOrientation->pitch, dutyIncreaseValue );
94 
95 }
void setTargetSpeed(long _targetSpeed)
Definition: motors.cpp:31
dji_2212 * motor[4]
Definition: aeronautics.h:35
void aeronautics::maintainRoll ( double  _duty_increment,
float  _roll 
)

maintainRoll() - Analyse target settings and adjust motors accordingly

Parameters
_duty_increment
_roll
Returns
none TODO: handle potential errors.
56 {
57 
58  if( _roll < 0 ) {
59  motor[ 0 ]->setTargetSpeed( long( motor[ 0 ]->currentDuty + _duty_increment ) ); //slow down
60  motor[ 1 ]->setTargetSpeed( long( motor[ 3 ]->currentDuty + _duty_increment ) ); //slow down
61  motor[ 2 ]->setTargetSpeed( long( motor[ 1 ]->currentDuty - _duty_increment ) ); //speed up
62  motor[ 3 ]->setTargetSpeed( long( motor[ 2 ]->currentDuty - _duty_increment ) ); //speed up
63  }
64  else {
65  motor[ 0 ]->setTargetSpeed( long( motor[ 0 ]->currentDuty - _duty_increment ) ); //speed up
66  motor[ 1 ]->setTargetSpeed( long( motor[ 3 ]->currentDuty - _duty_increment ) ); //speed up
67  motor[ 2 ]->setTargetSpeed( long( motor[ 1 ]->currentDuty + _duty_increment ) ); //slow down
68  motor[ 3 ]->setTargetSpeed( long( motor[ 2 ]->currentDuty + _duty_increment ) ); //slow down
69  }
70 
71 // printf( " Current Roll : \033[22;36m%7.2f \033[0m \t Increase Value : \033[22;36m%7.2f \033[0m\n",
72 // myOrientation->roll, dutyIncreaseValue );
73 
74 }
void setTargetSpeed(long _targetSpeed)
Definition: motors.cpp:31
dji_2212 * motor[4]
Definition: aeronautics.h:35

Member Data Documentation

dji_2212* quadro::aeronautics::motor[4]

Four pointers for new DJI_2212 motors


The documentation for this class was generated from the following files:
  • /Users/michaelbrookes/ClionProjects/Quadro/lib/aeronautics/aeronautics.h
  • /Users/michaelbrookes/ClionProjects/Quadro/lib/aeronautics/aeronautics.cpp