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_REPORT_LOCAL_POSE__H 00041 #define __JAUS_MOBILITY_REPORT_LOCAL_POSE__H 00042 00043 #include <cxutils/math/point3d.h> 00044 #include "jaus/core/message.h" 00045 #include "jaus/mobility/mobilitycodes.h" 00046 00047 namespace JAUS 00048 { 00059 class JAUS_MOBILITY_DLL ReportLocalPose : public Message 00060 { 00061 public: 00069 class JAUS_MOBILITY_DLL PresenceVector : public JAUS::PresenceVector 00070 { 00071 public: 00072 const static UShort X = 0x0001; 00073 const static UShort Y = 0x0002; 00074 const static UShort Z = 0x0004; 00075 const static UShort PositionRMS = 0x0008; 00076 const static UShort Roll = 0x0010; 00077 const static UShort Pitch = 0x0020; 00078 const static UShort Yaw = 0x0040; 00079 const static UShort AttitudeRMS = 0x0080; 00080 const static UShort TimeStamp = 0x0100; 00081 }; 00088 class JAUS_MOBILITY_DLL Limits : public JAUS::Limits 00089 { 00090 public: 00091 const static double MinPoint; 00092 const static double MaxPoint; 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 ReportLocalPose(const Address& dest = Address(), const Address& src = Address()); 00101 ReportLocalPose(const ReportLocalPose& message); 00102 ~ReportLocalPose(); 00103 bool SetX(const double value); 00104 bool SetY(const double value); 00105 bool SetZ(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 Point3D& position, 00113 const Point3D& orientation, 00114 const Time& time = Time(true)); 00115 bool SetPosition(const Point3D& position, const Time& time = Time(true)); 00116 bool SetOrientation(const Point3D& orientation, const Time& time = Time(true)); 00117 bool AddToPose(const Point3D& position, 00118 const Point3D& orientation, 00119 const Time& time = Time(true)); 00120 bool AddToPosition(const Point3D& position, const Time& time = Time(true)); 00121 bool AddToOrientation(const Point3D& orientation, const Time& time = Time(true)); 00122 inline double GetX() const { return mX; } 00123 inline double GetY() const { return mY; } 00124 inline double GetZ() const { return mZ; } 00125 inline double GetPositionRMS() const { return mPositionRMS; } 00126 inline double GetRoll() const { return mRoll; } 00127 inline double GetPitch() const { return mPitch; } 00128 inline double GetYaw() const { return mYaw; } 00129 inline double GetAttitudeRMS() const { return mAttitudeRMS; } 00130 inline Time GetTimeStamp() const { return mTimeStamp; } 00131 virtual bool IsCommand() const { return false; } 00132 virtual int WriteMessageBody(Packet& packet) const; 00133 virtual int ReadMessageBody(const Packet& packet); 00134 virtual Message* Clone() const { return new ReportLocalPose(*this); } 00135 virtual UInt GetPresenceVector() const { return mPresenceVector; } 00136 virtual UInt GetPresenceVectorSize() const { return USHORT_SIZE; } 00137 virtual UInt GetPresenceVectorMask() const { return 0x01FF; } 00138 virtual UShort GetMessageCodeOfResponse() const { return 0; } 00139 virtual std::string GetMessageName() const { return "Report Local Pose"; } 00140 virtual void ClearMessageBody(); 00141 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize = 1437) const { return false; } 00142 virtual int RunTestCase() const; 00143 virtual void PrintMessageBody() const; 00144 ReportLocalPose& operator=(const ReportLocalPose& message); 00145 protected: 00146 UShort mPresenceVector; 00147 double mX; 00148 double mY; 00149 double mZ; 00150 double mPositionRMS; 00151 double mRoll; 00152 double mPitch; 00153 double mYaw; 00154 double mAttitudeRMS; 00155 Time mTimeStamp; 00156 00157 }; 00158 } 00159 00160 #endif 00161 /* End of File */