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 #ifndef __JAUS_MOBILITY_SET_GLOBAL_POSE__H 00041 #define __JAUS_MOBILITY_SET_GLOBAL_POSE__H 00042 00043 #include <cxutils/math/coordinates.h> 00044 #include "jaus/core/message.h" 00045 #include "jaus/mobility/mobilitycodes.h" 00046 00047 namespace JAUS 00048 { 00055 class JAUS_MOBILITY_DLL SetGlobalPose : public Message 00056 { 00057 public: 00065 class JAUS_MOBILITY_DLL PresenceVector : public JAUS::PresenceVector 00066 { 00067 public: 00068 const static UShort Latitude = 0x0001; 00069 const static UShort Longitude = 0x0002; 00070 const static UShort Altitude = 0x0004; 00071 const static UShort PositionRMS = 0x0008; 00072 const static UShort Roll = 0x0010; 00073 const static UShort Pitch = 0x0020; 00074 const static UShort Yaw = 0x0040; 00075 const static UShort AttitudeRMS = 0x0080; 00076 const static UShort TimeStamp = 0x0100; 00077 }; 00084 class JAUS_MOBILITY_DLL Limits : public JAUS::Limits 00085 { 00086 public: 00087 const static double MinLatitude; 00088 const static double MaxLatitude; 00089 const static double MinLongitude; 00090 const static double MaxLongitude; 00091 const static double MinElevation; 00092 const static double MaxElevation; 00093 const static double MinPositionRMS; 00094 const static double MaxPositionRMS; 00095 const static double MinAngle; 00096 const static double MaxAngle; 00097 const static double MinAttitudeRMS; 00098 const static double MaxAttitudeRMS; 00099 }; 00100 SetGlobalPose(const Address& dest = Address(), const Address& src = Address()); 00101 SetGlobalPose(const SetGlobalPose& message); 00102 ~SetGlobalPose(); 00103 bool SetLatitude(const double degrees); 00104 bool SetLongitude(const double degrees); 00105 bool SetAltitude(const double value); 00106 bool SetPositionRMS(const double value); 00107 bool SetRoll(const double radians); 00108 bool SetPitch(const double radians); 00109 bool SetYaw(const double radians); 00110 bool SetAttitudeRMS(const double radians); 00111 bool SetTimeStamp(const Time& time); 00112 bool SetPose(const Wgs& position, 00113 const Point3D& orientation, 00114 const Time& time = Time(true)); 00115 bool SetPosition(const Wgs& position, const Time& time = Time(true)); 00116 bool SetOrientation(const Point3D& orientation, const Time& time = Time(true)); 00117 inline double GetLatitude() const { return mLatitude; } 00118 inline double GetLongitude() const { return mLongitude; } 00119 inline double GetAltitude() const { return mAltitude; } 00120 inline double GetPositionRMS() const { return mPositionRMS; } 00121 inline double GetRoll() const { return mRoll; } 00122 inline double GetPitch() const { return mPitch; } 00123 inline double GetYaw() const { return mYaw; } 00124 inline double GetAttitudeRMS() const { return mAttitudeRMS; } 00125 inline Time GetTimeStamp() const { return mTimeStamp; } 00126 Wgs GetPosition() const; 00127 Point3D GetOrientation() const; 00128 virtual bool IsCommand() const { return true; } 00129 virtual int WriteMessageBody(Packet& packet) const; 00130 virtual int ReadMessageBody(const Packet& packet); 00131 virtual Message* Clone() const { return new SetGlobalPose(*this); } 00132 virtual UInt GetPresenceVector() const { return mPresenceVector; } 00133 virtual UInt GetPresenceVectorSize() const { return USHORT_SIZE; } 00134 virtual UInt GetPresenceVectorMask() const { return 0x01FF; } 00135 virtual UShort GetMessageCodeOfResponse() const { return 0; } 00136 virtual std::string GetMessageName() const { return "Set Global Pose"; } 00137 virtual void ClearMessageBody(); 00138 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize = 1437) const { return false; } 00139 virtual int RunTestCase() const; 00140 SetGlobalPose& operator=(const SetGlobalPose& message); 00141 protected: 00142 UShort mPresenceVector; 00143 double mLatitude; 00144 double mLongitude; 00145 double mAltitude; 00146 double mPositionRMS; 00147 double mRoll; 00148 double mPitch; 00149 double mYaw; 00150 double mAttitudeRMS; 00151 Time mTimeStamp; 00152 00153 }; 00154 } 00155 00156 #endif 00157 /* End of File */