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_LOCAL_POSE_SENSOR__H
00042 #define __JAUS_MOBILITY_LOCAL_POSE_SENSOR__H
00043
00044 #include "jaus/mobility/sensors/globalposesensor.h"
00045 #include "jaus/mobility/sensors/querylocalpose.h"
00046 #include "jaus/mobility/sensors/reportlocalpose.h"
00047 #include "jaus/mobility/sensors/setlocalpose.h"
00048
00049
00050 namespace JAUS
00051 {
00052 typedef ReportLocalPose LocalPose;
00053
00069 class JAUS_MOBILITY_DLL LocalPoseSensor : public AccessControl::Child,
00070 public Sensor
00071 {
00072 public:
00073 const static std::string Name;
00074
00075 LocalPoseSensor(const double updateRate = 10);
00076
00077 virtual ~LocalPoseSensor();
00078
00079 void SetLocalPose(const JAUS::SetLocalPose& localPose);
00080
00081 void SetLocalPose(const JAUS::LocalPose& localPose);
00082
00083 bool SetLocalPose(const Point3D& position,
00084 const Point3D& orientation,
00085 const Time& time = Time(true));
00086
00087 bool SetLocalPose(const JAUS::GlobalPose& globalPose);
00088
00089 void SetLocalPoseReference(const GlobalPose& globalPose);
00090
00091 bool SetLocalPosition(const Point3D& position, const Time& time = Time(true));
00092
00093 bool SetLocalOrientation(const Point3D& orientation, const Time& time = Time(true));
00094
00095 bool AddToLocalPose(const Point3D& position,
00096 const Point3D& orientation,
00097 const Time& time = Time(true));
00098
00099 bool AddToLocalPosition(const Point3D& position, const Time& time = Time(true));
00100
00101 bool AddtoLocalOrientation(const Point3D& orientation, const Time& time = Time(true));
00102
00103 bool SetSensorUpdateRate(const double rate);
00104
00105 LocalPose GetLocalPose() const;
00106
00107 GlobalPose GetLocalPoseReference() const;
00108
00109 double GetSensorUpdateRate() const { return mMaxUpdateRate; }
00110
00111 virtual bool GenerateEvent(const Events::Subscription& info) const;
00112
00113 virtual bool IsEventSupported(const Events::Type type,
00114 const double requestedPeriodicRate,
00115 const Message* queryMessage,
00116 double& confirmedPeriodicRate,
00117 std::string& errorMessage) const;
00118
00119 virtual bool IsDiscoverable() const { return true; }
00120
00121 virtual void Receive(const Message* message);
00122
00123 virtual Message* CreateMessage(const UShort messageCode) const;
00124
00125 virtual void PrintStatus() const;
00126 private:
00127 void CreateReportFromQuery(const QueryLocalPose* query,
00128 ReportLocalPose& report) const;
00129 virtual void CheckServiceSynchronization(const unsigned int timeSinceLastCheckMs);
00130 double mMaxUpdateRate;
00131 ReportLocalPose mLocalPose;
00132 GlobalPose mGlobalPoseReference;
00133 CxUtils::Mutex mLocalPoseMutex;
00134 };
00135 }
00136
00137 #endif
00138