My modifications/additions to the code
Dependencies: ADXL345 ADXL345_I2C IMUfilter ITG3200 Servo fishgait mbed-rtos mbed pixy_cam
Fork of robotic_fish_ver_4_8 by
MainController.h
- Committer:
- rkk
- Date:
- 2014-05-30
- Revision:
- 20:6ae16da1492a
- Parent:
- 19:655db88b045c
- Child:
- 22:807d5467fbf6
File content as of revision 20:6ae16da1492a:
#ifndef MBED_MAINCONTROLLER_H #define MBED_MAINCONTROLLER_H #include "mbed.h" #include "PwmIn.h" #include "motor_controller.h" //#include "guardian.h" //#include "IMU.h" #include "Servo.h" #define MATH_PI 3.14159265359 /** MainController class to get control inputs and place them onto the system * * */ class MainController { public: /** Create a MainController * * @param */ MainController() ; /** Start the main controller * * @returns */ void start(); float getDutyCycle(); float getFrequency(); float getVolume(); float getAmplitude(); float getYaw(); float getPitch(); float getTimeAdd(); float getAdj(); /** Stop the main controller * * @returns */ void stop(); protected: void control(); float calculateFrequency(); float calculateAmplitude(); float calculateYaw(); float calculatePitch(); float calculateAdj(); float signum(float input); float saturate(float input); private: PwmIn ch1; PwmIn ch2; PwmIn ch3; PwmIn ch4; PwmIn ch6; PololuMController mcon; //Guardian ap; Servo leftservo; Servo rightservo; Timer timer1; Ticker ticker1; float amp; float ampNew; float frq; float dutyCycle; float curTime; float frqMin; float frqMax; float yaw; float pitch; float adj; bool fullCycle; float volume; float volChg; float volMax; float frqCmd; float timeAdd; float raiser; float pitAvg; float alPi; }; #endif