00001 #ifndef CRAPPY_COMPASS_H_DEFINED 00002 #define CRAPPY_COMPASS_H_DEFINED 00003 00004 #include <vector> 00005 #include "Devices/BeeStemTiny.H" 00006 00007 00008 //! The crappyCompass class can map crappy compass values to real headings as long as the crappy input is consistent. 00009 // It does this by running a calibration routined which reads in as many values as possible and stores them in a 00010 // vector. Then, when a user asks the crappyCompass class for a real heading, it passes it a crappy value, and 00011 //the class will map it to a point in its crappy vector, returning the index. 00012 class crappyCompass 00013 { 00014 public: 00015 crappyCompass(nub::soft_ref<BeeStemTiny> &b) : itsBeeStem(b){ 00016 00017 } 00018 00019 void calibrate(); 00020 00021 private: 00022 nub::soft_ref<BeeStemTiny> itsBeeStem; 00023 std::vector raw_readings; 00024 } 00025 00026 00027 #endif