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_ACCELERATION_LIMIT__H 00041 #define __JAUS_MOBILITY_REPORT_ACCELERATION_LIMIT__H 00042 00043 #include "jaus/core/message.h" 00044 #include "jaus/mobility/mobilitycodes.h" 00045 00046 namespace JAUS 00047 { 00057 class JAUS_MOBILITY_DLL ReportAccelerationLimit : public Message 00058 { 00059 public: 00067 class JAUS_MOBILITY_DLL PresenceVector : public JAUS::PresenceVector 00068 { 00069 public: 00070 const static Byte AccelerationX = 0x01; 00071 const static Byte AccelerationY = 0x02; 00072 const static Byte AccelerationZ = 0x04; 00073 const static Byte RollAcceleration = 0x08; 00074 const static Byte PitchAcceleration = 0x10; 00075 const static Byte YawAcceleration = 0x20; 00076 }; 00083 class JAUS_MOBILITY_DLL Limits : public JAUS::Limits 00084 { 00085 public: 00086 const static double MinLinearAcceleration; 00087 const static double MaxLinearAcceleration; 00088 const static double MinRotationalAcceleration; 00089 const static double MaxRotationalAcceleration; 00090 }; 00091 00092 // Command types when issuing commands. 00093 enum Command 00094 { 00095 SetMaximumAllowedValues = 0, 00096 SetMinimumAllowedValues 00097 }; 00098 ReportAccelerationLimit(const Address& dest = Address(), const Address& src = Address()); 00099 ReportAccelerationLimit(const ReportAccelerationLimit& message); 00100 ~ReportAccelerationLimit(); 00101 inline Byte SetCommandType(const Command type) { return mCommandType = type; } 00102 bool SetAccelerationX(const double value); 00103 bool SetAccelerationY(const double value); 00104 bool SetAccelerationZ(const double value); 00105 bool SetRollAcceleration(const double value); 00106 bool SetPitchAcceleration(const double value); 00107 bool SetYawAcceleration(const double value); 00108 inline Byte GetCommandType() const { return mCommandType; } 00109 inline double GetAccelerationX() const { return mAccelerationX; } 00110 inline double GetAccelerationY() const { return mAccelerationY; } 00111 inline double GetAccelerationZ() const { return mAccelerationZ; } 00112 inline double GetRollAcceleration() const { return mRollAcceleration; } 00113 inline double GetPitchAcceleration() const { return mPitchAcceleration; } 00114 inline double GetYawAcceleration() const { return mYawAcceleration; } 00115 virtual bool IsCommand() const { return false; } 00116 virtual int WriteMessageBody(Packet& packet) const; 00117 virtual int ReadMessageBody(const Packet& packet); 00118 virtual Message* Clone() const { return new ReportAccelerationLimit(*this); } 00119 virtual UInt GetPresenceVector() const { return mPresenceVector; } 00120 virtual UInt GetPresenceVectorSize() const { return BYTE_SIZE; } 00121 virtual UInt GetPresenceVectorMask() const { return 0x3F; } 00122 virtual UShort GetMessageCodeOfResponse() const { return 0; } 00123 virtual std::string GetMessageName() const { return "Report Acceleration Limit"; } 00124 virtual void ClearMessageBody(); 00125 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize = 1437) const { return false; } 00126 virtual int RunTestCase() const; 00127 ReportAccelerationLimit& operator=(const ReportAccelerationLimit& message); 00128 protected: 00129 Byte mPresenceVector; 00130 Command mCommandType; 00131 double mAccelerationX; 00132 double mAccelerationY; 00133 double mAccelerationZ; 00134 double mRollAcceleration; 00135 double mPitchAcceleration; 00136 double mYawAcceleration; 00137 }; 00138 } 00139 00140 #endif 00141 /* End of File */