00001 /*************************************************************** 00002 00003 Mini Grand Challenge 2010 00004 Pennsylvania State University - Robotics Club 00005 Learn more at www.psurobotics.org 00006 Protected by the GNU General Public License 00007 00008 This source file is developed and maintained by: 00009 + Marshall Conover marzhall.o@gmail.com 00010 00011 File: CrashDetector.cpp/h: A process that continually takes 00012 input from the LIDAR and looks for collisions. It uses a constant to 00013 decide the distance under which to mark as a collision. It then 00014 reports these collisions by putting them in a queue to be read. 00015 00016 ***************************************************************/ 00017 00018 // Inclusion guard 00019 #ifndef __COLLISIONINTERFACE_H__ 00020 #define __COLLISIONINTERFACE_H__ 00021 00022 // Includes 00023 #include "../Shared/Utilities.h" 00024 #include "../Shared/BaseComponent.h" 00025 #include "../Shared/Vector2.h" 00026 #include "../Shared/List.h" 00027 #include <cmath> 00028 00030 class CollisionInterface : public BaseComponent 00031 { 00032 00033 public: 00034 00035 //<! Constructor 00036 CollisionInterface(); 00037 00038 //<! Standard destructor 00039 ~CollisionInterface(); 00040 00041 private: 00042 00043 char* computeCol; 00044 00045 static const int MAX_QUEUE_SIZE = 32; 00046 00047 static const int HIT_DISTANCE = 10; 00048 00049 float (*CircularQueue)[MAX_QUEUE_SIZE]; 00050 00051 00052 int CircularQueueIndex; 00053 00054 double delta; 00055 int numInArray; 00056 int* distances; 00057 00058 bool* results; 00059 }; 00060 00061 // End of inclusion guard 00062 #endif
1.5.5