Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef __JAUS_MOBILITY_GLOBAL_POSE_SENSOR__H
00042 #define __JAUS_MOBILITY_GLOBAL_POSE_SENSOR__H
00043
00044 #include "jaus/core/sensor.h"
00045 #include "jaus/mobility/sensors/querygeomagneticproperty.h"
00046 #include "jaus/mobility/sensors/queryglobalpose.h"
00047 #include "jaus/mobility/sensors/reportglobalpose.h"
00048 #include "jaus/mobility/sensors/reportgeomagneticproperty.h"
00049 #include "jaus/mobility/sensors/setglobalpose.h"
00050 #include "jaus/mobility/sensors/setgeomagneticproperty.h"
00051
00052 namespace JAUS
00053 {
00054 typedef ReportGlobalPose GlobalPose;
00055
00070 class JAUS_MOBILITY_DLL GlobalPoseSensor : public Sensor, public AccessControl::Child
00071 {
00072 public:
00073 const static std::string Name;
00074
00075 GlobalPoseSensor(const double updateRate = 10);
00076
00077 virtual ~GlobalPoseSensor();
00078
00079 virtual bool IsDiscoverable() const { return true; }
00080
00081 void SetGlobalPose(const JAUS::SetGlobalPose& globalPose);
00082
00083 void SetGlobalPose(const JAUS::GlobalPose& globalPose);
00084
00085 bool SetGlobalPose(const Wgs& position,
00086 const Point3D& orientation,
00087 const Time& time = Time(true));
00088
00089 bool SetGlobalPosition(const Wgs& position, const Time& time = Time(true));
00090
00091 bool SetGlobalOrientation(const Point3D& orientation, const Time& time = Time(true));
00092
00093 void SetGeomagneticVariation(const double magneticVariation);
00094
00095 bool SetSensorUpdateRate(const double rate);
00096
00097 GlobalPose GetGlobalPose() const;
00098
00099 double GetGeomagneticVariation() const;
00100
00101 double GetSensorUpdateRate() const { return mMaxUpdateRate; }
00102
00103 virtual bool GenerateEvent(const Events::Subscription& info) const;
00104
00105 virtual bool IsEventSupported(const Events::Type type,
00106 const double requestedPeriodicRate,
00107 const Message* queryMessage,
00108 double& confirmedPeriodicRate,
00109 std::string& errorMessage) const;
00110
00111 virtual void Receive(const Message* message);
00112
00113 virtual Message* CreateMessage(const UShort messageCode) const;
00114
00115 virtual void PrintStatus() const;
00116 private:
00117 void CreateReportFromQuery(const QueryGlobalPose* query,
00118 GlobalPose& report) const;
00119 virtual void CheckServiceSynchronization(const unsigned int timeSinceLastCheckMs);
00120 double mMaxUpdateRate;
00121 double mGeomagneticProperty;
00122 GlobalPose mGlobalPose;
00123 CxUtils::Mutex mGlobalPoseMutex;
00124 };
00125 }
00126
00127 #endif
00128