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