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_WRENCH_EFFORT__H 00041 #define __JAUS_MOBILITY_SET_WRENCH_EFFORT__H 00042 00043 #include "jaus/core/message.h" 00044 #include "jaus/mobility/mobilitycodes.h" 00045 00046 namespace JAUS 00047 { 00060 class JAUS_MOBILITY_DLL SetWrenchEffort : public Message 00061 { 00062 public: 00070 class JAUS_MOBILITY_DLL PresenceVector : public JAUS::PresenceVector 00071 { 00072 public: 00073 const static UShort PropulsiveLinearEffortX = 0x0001; 00074 const static UShort PropulsiveLinearEffortY = 0x0002; 00075 const static UShort PropulsiveLinearEffortZ = 0x0004; 00076 const static UShort PropulsiveRotationalEffortX = 0x0008; 00077 const static UShort PropulsiveRotationalEffortY = 0x0010; 00078 const static UShort PropulsiveRotationalEffortZ = 0x0020; 00079 const static UShort ResistiveLinearEffortX = 0x0040; 00080 const static UShort ResistiveLinearEffortY = 0x0080; 00081 const static UShort ResistiveLinearEffortZ = 0x0100; 00082 const static UShort ResistiveRotationalEffortX = 0x0200; 00083 const static UShort ResistiveRotationalEffortY = 0x0400; 00084 const static UShort ResistiveRotationalEffortZ = 0x0800; 00085 }; 00086 SetWrenchEffort(const Address& dest = Address(), const Address& src = Address()); 00087 SetWrenchEffort(const SetWrenchEffort& message); 00088 ~SetWrenchEffort(); 00089 bool SetPropulsiveLinearEffortX(const double percent); 00090 bool SetPropulsiveLinearEffortY(const double percent); 00091 bool SetPropulsiveLinearEffortZ(const double percent); 00092 bool SetPropulsiveRotationalEffortX(const double percent); 00093 bool SetPropulsiveRotationalEffortY(const double percent); 00094 bool SetPropulsiveRotationalEffortZ(const double percent); 00095 bool SetResistiveLinearEffortX(const double percent); 00096 bool SetResistiveLinearEffortY(const double percent); 00097 bool SetResistiveLinearEffortZ(const double percent); 00098 bool SetResistiveRotationalEffortX(const double percent); 00099 bool SetResistiveRotationalEffortY(const double percent); 00100 bool SetResistiveRotationalEffortZ(const double percent); 00101 inline double GetPropulsiveLinearEffortX() const { return mPropulsiveLinearEffortX; } 00102 inline double GetPropulsiveLinearEffortY() const { return mPropulsiveLinearEffortY; } 00103 inline double GetPropulsiveLinearEffortZ() const { return mPropulsiveLinearEffortZ; } 00104 inline double GetPropulsiveRotationalEffortX() const { return mPropulsiveRotationalEffortX; } 00105 inline double GetPropulsiveRotationalEffortY() const { return mPropulsiveRotationalEffortY; } 00106 inline double GetPropulsiveRotationalEffortZ() const { return mPropulsiveRotationalEffortZ; } 00107 inline double GetResistiveLinearEffortX() const { return mResistiveLinearEffortX; } 00108 inline double GetResistiveLinearEffortY() const { return mResistiveLinearEffortY; } 00109 inline double GetResistiveLinearEffortZ() const { return mResistiveLinearEffortZ; } 00110 inline double GetResistiveRotationalEffortX() const { return mResistiveRotationalEffortX; } 00111 inline double GetResistiveRotationalEffortY() const { return mResistiveRotationalEffortY; } 00112 inline double GetResistiveRotationalEffortZ() const { return mResistiveRotationalEffortZ; } 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 SetWrenchEffort(*this); } 00117 virtual UInt GetPresenceVector() const { return mPresenceVector; } 00118 virtual UInt GetPresenceVectorSize() const { return USHORT_SIZE; } 00119 virtual UInt GetPresenceVectorMask() const { return 0x0FFF; } 00120 virtual UShort GetMessageCodeOfResponse() const { return 0; } 00121 virtual std::string GetMessageName() const { return "Set Wrench Effort"; } 00122 virtual void ClearMessageBody(); 00123 virtual bool IsLargeDataSet(const unsigned int maxPayloadSize = 1437) const { return false; } 00124 virtual int RunTestCase() const; 00125 virtual void PrintMessageBody() const; 00126 SetWrenchEffort& operator=(const SetWrenchEffort& message); 00127 protected: 00128 UShort mPresenceVector; 00129 double mPropulsiveLinearEffortX; 00130 double mPropulsiveLinearEffortY; 00131 double mPropulsiveLinearEffortZ; 00132 double mPropulsiveRotationalEffortX; 00133 double mPropulsiveRotationalEffortY; 00134 double mPropulsiveRotationalEffortZ; 00135 double mResistiveLinearEffortX; 00136 double mResistiveLinearEffortY; 00137 double mResistiveLinearEffortZ; 00138 double mResistiveRotationalEffortX; 00139 double mResistiveRotationalEffortY; 00140 double mResistiveRotationalEffortZ; 00141 }; 00142 } 00143 00144 #endif 00145 /* End of File */