iSpike
2.1
Spike conversion library for robotics
|
00001 #ifndef YARPANGLEWRITER_HPP_ 00002 #define YARPANGLEWRITER_HPP_ 00003 00004 //iSpike includes 00005 #include <iSpike/Writer/AngleWriter.hpp> 00006 #include <iSpike/YarpConnection.hpp> 00007 00008 //Other includes 00009 #include <string> 00010 #include <map> 00011 00012 namespace ispike { 00013 00015 class YarpAngleWriter : public AngleWriter { 00016 public: 00017 YarpAngleWriter(string nameserverIP, unsigned nameserverPort); 00018 virtual ~YarpAngleWriter(); 00019 void initialize(map<string,Property>& properties); 00020 void setAngle(double newAngle); 00021 void setDegreeOfFreedom(int dof); 00022 void setProperties(map<string,Property>& properties); 00023 void start(); 00024 00025 private: 00026 //=========================== VARIABLES ========================= 00028 YarpConnection* yarpConnection; 00029 00031 bool angleChanged; 00032 00034 string portName; 00035 00037 unsigned sleepDuration_ms; 00038 00039 00040 //=========================== METHODS =========================== 00041 void updateProperties(map<string, Property>& properties); 00042 void workerFunction(); 00043 }; 00044 00045 } 00046 00047 #endif /* YARPANGLEWRITER_HPP_ */