00001 // File: HawkScanner.H 00002 // Author: Josh Villbrandt <josh.villbrandt@usc.edu> 00003 // Date: April 2010 00004 00005 #include <string> 00006 #include <vector> 00007 #include <Ice/Ice.h> 00008 #include <urg/UrgCtrl.h> 00009 #include "Util/Timer.H" 00010 #include "Robots/BeoHawk/core/HawkMessages.ice.H" 00011 #include "Robots/BeoHawk/computer/HawkAgent.H" 00012 00013 #define SCANNER_ADDRESS "/dev/ttyACM0" 00014 #define SCANNER_RESOLUTION (M_PI/512.) // URG-04LX-UG01, radians 00015 00016 class HawkScanner : public HawkAgent { 00017 public: 00018 // These functions must be defined in all HawkAgents 00019 HawkScanner(std::string myName, int argc, char* argv[]); 00020 bool scheduler(); 00021 void registerTopics(); 00022 void catchMessage(const HawkMessages::MessagePtr& msg, const Ice::Current&); 00023 00024 private: 00025 // These functions are specific to the individual agents 00026 int refreshPeriod; 00027 Timer timer; 00028 qrk::UrgCtrl urg; 00029 void sendScannerMessage(); 00030 };