INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
stallsensor.h00001 #ifndef SEGWAYRMPDRIVERTHREAD_STALLSENSOR_H 00002 #define SEGWAYRMPDRIVERTHREAD_STALLSENSOR_H 00003 00004 #include <gbxsickacfr/gbxiceutilacfr/timer.h> 00005 #include <hydrointerfaces/segwayrmp.h> 00006 #include <iostream> 00007 00008 namespace hydrormputil { 00009 00010 // Tells us what kind of stall-situation we have 00011 enum StallType { 00012 NoStall, 00013 BothMotorsStall, 00014 LeftMotorStall, 00015 RightMotorStall, 00016 }; 00017 std::string toString( StallType t ); 00018 inline std::ostream &operator<<( std::ostream &s, StallType t ) 00019 { return s << toString(t); } 00020 00021 // 00022 // @brief Looks for high motor torques with no motion 00023 // 00024 // @author Alex Brooks 00025 // 00026 class StallSensor 00027 { 00028 public: 00029 00030 class Config { 00031 public: 00032 // Trigger an alert when the torque is higher than ... 00033 double torqueThreshold; 00034 // ... but the speed is less than ... 00035 double speedThreshold; 00036 // ... for a period of more than ... 00037 double timeThreshold; 00038 }; 00039 00040 StallSensor( const Config &config ) 00041 : timerIsRunning_(false), 00042 config_(config) 00043 {} 00044 00045 StallType isStalled( const hydrointerfaces::SegwayRmp::Data &data ); 00046 00047 private: 00048 00049 gbxiceutilacfr::Timer stalledTimer_; 00050 bool timerIsRunning_; 00051 00052 const Config config_; 00053 00054 }; 00055 00056 } 00057 00058 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)