00001
00038 #ifndef SAWYER_MESSAGE_CMD_H
00039 #define SAWYER_MESSAGE_CMD_H
00040
00041 #include "roch_base/core/Message.h"
00042
00043 namespace sawyer
00044 {
00045
00046 class CmdMessage : public Message
00047 {
00048 private:
00049 static long total_destroyed;
00050 static long total_sent;
00051
00052 public:
00053 CmdMessage() : Message()
00054 {
00055 }
00056
00057 CmdMessage(const CmdMessage &other) : Message(other)
00058 {
00059 }
00060
00061 virtual ~CmdMessage();
00062 };
00063
00064 class CmdProcessorReset : public CmdMessage
00065 {
00066 public:
00067 CmdProcessorReset();
00068
00069 CmdProcessorReset(const CmdProcessorReset &other);
00070 };
00071
00072 class CmdRestoreSettings : public CmdMessage
00073 {
00074 public:
00075 enum restoreFlags
00076 {
00077 USER_SETTINGS = 0x1,
00078 FACTORY_SETTINGS = 0x2
00079 };
00080 public:
00081 CmdRestoreSettings(enum restoreFlags flags);
00082
00083 CmdRestoreSettings(const CmdRestoreSettings &other);
00084 };
00085
00086 class CmdStoreSettings : public CmdMessage
00087 {
00088 public:
00089 CmdStoreSettings();
00090
00091 CmdStoreSettings(const CmdStoreSettings &other);
00092 };
00093
00094 class SetAckermannOutput : public CmdMessage
00095 {
00096 public:
00097 enum payloadOffsets
00098 {
00099 STEERING = 0,
00100 THROTTLE = 2,
00101 BRAKE = 4,
00102 PAYLOAD_LEN = 6
00103 };
00104
00105 public:
00106 SetAckermannOutput(double steering, double throt, double brake);
00107
00108 SetAckermannOutput(const SetAckermannOutput &other);
00109 };
00110
00111 class SetDifferentialControl : public CmdMessage
00112 {
00113 public:
00114 enum payloadOffsets
00115 {
00116 LEFT_P = 0,
00117 LEFT_I = 2,
00118 LEFT_D = 4,
00119 RIGHT_P = 6,
00120 RIGHT_I = 8,
00121 RIGHT_D = 10,
00122 PAYLOAD_LEN = 12
00123 };
00124
00125 public:
00126 SetDifferentialControl(double p,
00127 double i,
00128 double d);
00129
00130 SetDifferentialControl(double left_p,
00131 double left_i,
00132 double left_d,
00133 double right_p,
00134 double right_i,
00135 double right_d);
00136
00137 SetDifferentialControl(const SetDifferentialControl &other);
00138 };
00139
00140 class SetDifferentialOutput : public CmdMessage
00141 {
00142 public:
00143 enum payloadOffsets
00144 {
00145 LEFT = 0,
00146 RIGHT = 2,
00147 PAYLOAD_LEN = 4
00148 };
00149
00150 public:
00151 SetDifferentialOutput(double left, double right);
00152
00153 SetDifferentialOutput(const SetDifferentialOutput &other);
00154 };
00155
00156 class SetDifferentialSpeed : public CmdMessage
00157 {
00158 public:
00159 enum payloadOffsets
00160 {
00161 LEFT_SPEED = 0,
00162 RIGHT_SPEED = 2,
00163 LEFT_ACCEL = 4,
00164 RIGHT_ACCEL = 6,
00165 PAYLOAD_LEN = 8
00166 };
00167
00168 public:
00169 SetDifferentialSpeed(double left_spd, double right_speed, double left_accel, double right_accel);
00170
00171 SetDifferentialSpeed(const SetDifferentialSpeed &other);
00172 };
00173
00174 class SetGear : public CmdMessage
00175 {
00176 public:
00177 SetGear(uint8_t gear);
00178
00179 SetGear(const SetGear &other);
00180 };
00181
00182 class SetMaxAccel : public CmdMessage
00183 {
00184 public:
00185 enum payloadOffsets
00186 {
00187 MAX_FWD = 0,
00188 MAX_REV = 2,
00189 PAYLOAD_LEN = 4
00190 };
00191
00192 public:
00193 SetMaxAccel(double max_fwd, double max_rev);
00194
00195 SetMaxAccel(const SetMaxAccel &other);
00196 };
00197
00198 class SetMaxSpeed : public CmdMessage
00199 {
00200 public:
00201 enum payloadOffsets
00202 {
00203 MAX_FWD = 0,
00204 MAX_REV = 2,
00205 PAYLOAD_LEN = 4
00206 };
00207
00208 public:
00209 SetMaxSpeed(double max_fwd, double max_rev);
00210
00211 SetMaxSpeed(const SetMaxSpeed &other);
00212 };
00213
00214 class SetPlatformName : public CmdMessage
00215 {
00216 public:
00217 SetPlatformName(const char *name);
00218
00219 SetPlatformName(const SetPlatformName &other);
00220 };
00221
00222 class SetPlatformTime : public CmdMessage
00223 {
00224 public:
00225 SetPlatformTime(uint32_t time);
00226
00227 SetPlatformTime(const SetPlatformTime &other);
00228 };
00229
00230 class SetSafetySystem : public CmdMessage
00231 {
00232 public:
00233 SetSafetySystem(uint16_t flags);
00234
00235 SetSafetySystem(const SetSafetySystem &other);
00236 };
00237
00238 class SetTurn : public CmdMessage
00239 {
00240 public:
00241 enum payloadOffsets
00242 {
00243 TRANSLATIONAL = 0,
00244 TURN_RADIUS = 2,
00245 TRANS_ACCEL = 4,
00246 PAYLOAD_LEN = 6
00247 };
00248
00249 public:
00250 SetTurn(double trans, double rad, double accel);
00251
00252 SetTurn(const SetTurn &other);
00253 };
00254
00255 class SetWheelInfo : public CmdMessage
00256 {
00257 public:
00258 enum payloadOffsets
00259 {
00260 WHEEL_GAUGE = 0,
00261 WHEEL_DIAMETER = 2,
00262 PAYLOAD_LEN = 4
00263 };
00264
00265 public:
00266 SetWheelInfo(double wheel_gauge, double Wheel_diameter);
00267
00268 SetWheelInfo(const SetWheelInfo &other);
00269
00270 };
00271
00272 class SetVelocity : public CmdMessage
00273 {
00274 public:
00275 enum payloadOffsets
00276 {
00277 TRANSLATIONAL = 0,
00278 ROTATIONAL = 2,
00279 TRANS_ACCEL = 4,
00280 PAYLOAD_LEN = 6
00281 };
00282
00283 public:
00284 SetVelocity(double trans, double rot, double accel);
00285
00286 SetVelocity(const SetVelocity &other);
00287 };
00288
00289 };
00290
00291 #endif // sawyer_MESSAGE_CMD_H
00292