bio robot

Dependencies:   MPU6050-DMP QEI_hw mbed-rpc mbed

Fork of MPU6050_Example by Shundo Kishi

Controls/Gains.h

Committer:
amandaghassaei
Date:
2015-12-11
Revision:
17:8a0e647cf551
Parent:
14:d620415259b1
Child:
18:0cfe72d8a006

File content as of revision 17:8a0e647cf551:

#ifndef Gains_h
#define Gains_h

#include "mbed.h"

class Gains {
    
    public:
    
        Gains(){
            setSwingUpK(0.7);
            setSwingUpD(0.06);
            setDesiredThetaP(4);
            setTargetingK(0.7);
            setTargetingD(0.06);
        }
        
        void setPC(Serial *pc){
            _pc = pc;
        }
        
        void setSwingUpK(float k){
            _swingUpK = k;
        };
        void setSwingUpD(float d){
            _swingUpD = d;
        };
        void setDesiredThetaP(float p){
            _desiredThetaP = p;
        };
        void setTargetingK(float k){
            _targetingK = k;
        };
        void setTargetingD(float d){
            _targetingD = d;
        };
        
        float getSwingUpK(){
            return _swingUpK;
        };
        float getSwingUpD(){
            return _swingUpD;
        };
        float getDesiredThetaP(){
            return _desiredThetaP;
        };
        float getTargetingK(){
            return _targetingK;
        };
        float getTargetingD(){
            return _targetingD;
        };
    
    private:
    
        Serial *_pc;
    
        float _swingUpK;
        float _swingUpD;
        float _desiredThetaP;
        float _targetingK;
        float _targetingD;
    
};

#endif