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_LOCAL_POSE__H 00041 #define __JAUS_MOBILITY_SET_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 { 00058 class JAUS_MOBILITY_DLL SetLocalPose : public Message 00059 { 00060 public: 00068 class JAUS_MOBILITY_DLL PresenceVector : public JAUS::PresenceVector 00069 { 00070 public: 00071 const static UShort X = 0x0001; 00072 const static UShort Y = 0x0002; 00073 const static UShort Z = 0x0004; 00074 const static UShort PositionRMS = 0x0008; 00075 const static UShort Roll = 0x0010; 00076 const static UShort Pitch = 0x0020; 00077 const static UShort Yaw = 0x0040; 00078 const static UShort AttitudeRMS = 0x0080; 00079 const static UShort TimeStamp = 0x0100; 00080 }; 00087 class JAUS_MOBILITY_DLL Limits : public JAUS::Limits 00088 { 00089 public: 00090 const static double MinPoint; 00091 const static double MaxPoint; 00092 const static double MinPositionRMS; 00093 const static double MaxPositionRMS; 00094 const static double MinAngle; 00095 const static double MaxAngle; 00096 const static double MinAttitudeRMS; 00097 const static double MaxAttitudeRMS; 00098 }; 00099 SetLocalPose(const Address& dest = Address(), const Address& src = Address()); 00100 SetLocalPose(const SetLocalPose& message); 00101 ~SetLocalPose(); 00102 bool SetX(const double value); 00103 bool SetY(const double value); 00104 bool SetZ(const double value); 00105 bool SetPositionRMS(const double value); 00106 bool SetRoll(const double radians); 00107 bool SetPitch(const double radians); 00108 bool SetYaw(const double radians); 00109 bool SetAttitudeRMS(const double radians); 00110 bool SetTimeStamp(const Time& time); 00111 bool SetPose(const Point3D& position, 00112 const Point3D& orientation, 00113 const Time& time = Time(true)); 00114 bool SetPosition(const Point3D& position, const Time& time = Time(true)); 00115 bool SetOrientation(const Point3D& orientation, const Time& time = Time(true)); 00116 bool AddToPose(const Point3D& position, 00117 const Point3D& orientation, 00118 const Time& time = Time(true)); 00119 bool AddToPosition(const Point3D& position, const Time& time = Time(true)); 00120 bool AddToOrientation(const Point3D& orientation, const Time& time = Time(true)); 00121 inline double GetX() const { return mX; } 00122 inline double GetY() const { return mY; } 00123 inline double GetZ() const { return mZ; } 00124 inline double GetPositionRMS() const { return mPositionRMS; } 00125 inline double GetRoll() const { return mRoll; } 00126 inline double GetPitch() const { return mPitch; } 00127 inline double GetYaw() const { return mYaw; } 00128 inline double GetAttitudeRMS() const { return mAttitudeRMS; } 00129 inline Time GetTimeStamp() const { return mTimeStamp; } 00130 virtual bool IsCommand() const { return true; } 00131 virtual int WriteMessageBody(Packet& packet) const; 00132 virtual int ReadMessageBody(const Packet& packet); 00133 virtual Message* Clone() const { return new SetLocalPose(*this); } 00134 virtual UInt GetPresenceVector() const { return mPresenceVector; } 00135 virtual UInt GetPresenceVectorSize() const { return USHORT_SIZE; } 00136 virtual UInt GetPresenceVectorMask() const { return 0x01FF; } 00137 virtual UShort GetMessageCodeOfResponse() const { return 0; } 00138 virtual std::string GetMessageName() const { return "Set Local Pose"; } 00139 virtual void ClearMessageBody(); 00140 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize = 1437) const { return false; } 00141 virtual int RunTestCase() const; 00142 SetLocalPose& operator=(const SetLocalPose& message); 00143 protected: 00144 UShort mPresenceVector; 00145 double mX; 00146 double mY; 00147 double mZ; 00148 double mPositionRMS; 00149 double mRoll; 00150 double mPitch; 00151 double mYaw; 00152 double mAttitudeRMS; 00153 Time mTimeStamp; 00154 00155 }; 00156 } 00157 00158 #endif 00159 /* End of File */