![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
BeaconAvoid code for AHRC competition.
Dependencies: MODSERIAL PiSlingers m3pi mbed
IRBehaviorController.h
- Committer:
- mpanetta
- Date:
- 2012-04-04
- Revision:
- 0:9ac4a91b71fa
- Child:
- 4:369caebdf5dc
File content as of revision 0:9ac4a91b71fa:
#ifndef __IRBEHAVIORCONTROLLER_H__ #define __IRBEHAVIORCONTROLLER_H__ #include "mbed.h" #include "IRObjDetector.h" #include "PID.h" class IRBehaviorController { public: IRBehaviorController(PID *pid) : pid(pid) { debug = NULL; activationThreshold = 0.0f; brightness = 0.0f; output = 0.0f; }; IRBehaviorController(PID * pid, Serial * debug) : debug(debug), ird(debug), pid(pid) //IRBehaviorController(PID * pid, Serial * debug) : debug(debug), pid(pid) { activationThreshold = 0.0f; brightness = 0.0f; output = 0.0f; }; void setAvoidanceBehavior(float threshold); void setSeekingBehavior(float threshold); void setActiveThreshold(float threshold); // Brightness level at which behavior is active. void runAvoidance(void); // Execute avoidance behavior void runSeeking(void); // Execute seeking behavior float getPower(void); // Returns the power value needed to execute the behavior. void dumpDebug(Serial *debug); private: void scanIR(void); Serial *debug; IRObjDetector ird; PID *pid; float activationThreshold; // Brightness threshold at which behavior is active. float brightness; float centeroid; float output; }; #endif