YouBotJointParameterReadOnly.hpp
Go to the documentation of this file.00001 #ifndef YOUBOT_YOUBOTJOINTPARAMETERREADONLY_H
00002 #define YOUBOT_YOUBOTJOINTPARAMETERREADONLY_H
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
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #include <vector>
00055 #include <sstream>
00056 #include "generic/Logger.hpp"
00057 #include "generic/Units.hpp"
00058 #include "generic/Time.hpp"
00059 #include "generic/Exceptions.hpp"
00060 #include "generic-joint/JointParameter.hpp"
00061 #include "youbot/ProtocolDefinitions.hpp"
00062 #include "youbot/YouBotSlaveMsg.hpp"
00063 #include "youbot/YouBotSlaveMailboxMsg.hpp"
00064 #include "youbot/YouBotJointStorage.hpp"
00065 namespace youbot {
00066
00067
00068
00069
00070 class YouBotJointParameterReadOnly : public JointParameter {
00071 friend class YouBotJoint;
00072 protected:
00073 YouBotJointParameterReadOnly();
00074
00075
00076 public:
00077 virtual ~YouBotJointParameterReadOnly();
00078
00079 virtual void toString(std::string& value) = 0;
00080
00081
00082 protected:
00083 virtual void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const = 0;
00084
00085 virtual void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) = 0;
00086
00087 virtual std::string getName() const = 0;
00088
00089 virtual ParameterType getType() const = 0;
00090
00091 std::string name;
00092
00093 ParameterType parameterType;
00094
00095 };
00096
00097
00098
00099 class ActualMotorVoltage : public YouBotJointParameterReadOnly {
00100 friend class YouBotJoint;
00101 public:
00102 ActualMotorVoltage();
00103
00104 virtual ~ActualMotorVoltage();
00105
00106 void getParameter(quantity<electric_potential>& parameter) const;
00107
00108 void toString(std::string& value);
00109
00110
00111 private:
00112 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00113
00114 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00115
00116 std::string getName() const {return this->name;};
00117
00118
00119 ParameterType getType() const {return this->parameterType;};
00120
00121 quantity<electric_potential> value;
00122
00123 std::string name;
00124
00125 ParameterType parameterType;
00126
00127 };
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143 class ErrorAndStatus : public YouBotJointParameterReadOnly {
00144 friend class YouBotJoint;
00145 public:
00146 ErrorAndStatus();
00147
00148 virtual ~ErrorAndStatus();
00149
00150 void getParameter(unsigned int& parameter) const;
00151
00152 void toString(std::string& value);
00153
00154
00155 private:
00156 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00157
00158 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00159
00160 std::string getName() const {return this->name;};
00161
00162 ParameterType getType() const {return this->parameterType;};
00163
00164 void parseYouBotErrorFlags() const;
00165
00166 unsigned int value;
00167
00168 std::string name;
00169
00170 ParameterType parameterType;
00171
00172 };
00173
00174
00175
00176 class PositionError : public YouBotJointParameterReadOnly {
00177 friend class YouBotJoint;
00178 public:
00179 PositionError();
00180
00181 virtual ~PositionError();
00182
00183 void getParameter(quantity<plane_angle>& parameter) const;
00184
00185 void toString(std::string& value);
00186
00187
00188 private:
00189 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00190
00191 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00192
00193 std::string getName() const {return this->name;};
00194
00195 ParameterType getType() const {return this->parameterType;};
00196
00197 quantity<plane_angle> value;
00198
00199 std::string name;
00200
00201 ParameterType parameterType;
00202
00203 };
00204
00205
00206
00207 class PositionErrorSum : public YouBotJointParameterReadOnly {
00208 friend class YouBotJoint;
00209 public:
00210 PositionErrorSum();
00211
00212 virtual ~PositionErrorSum();
00213
00214 void getParameter(quantity<plane_angle>& parameter) const;
00215
00216 void toString(std::string& value);
00217
00218
00219 private:
00220 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00221
00222 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00223
00224 std::string getName() const {return this->name;};
00225
00226 ParameterType getType() const {return this->parameterType;};
00227
00228 quantity<plane_angle> value;
00229
00230 std::string name;
00231
00232 ParameterType parameterType;
00233
00234 };
00235
00236
00237
00238 class VelocityError : public YouBotJointParameterReadOnly {
00239 friend class YouBotJoint;
00240 public:
00241 VelocityError();
00242
00243 virtual ~VelocityError();
00244
00245 void getParameter(quantity<si::angular_velocity>& parameter) const;
00246
00247 void toString(std::string& value);
00248
00249
00250 private:
00251 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00252
00253 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00254
00255 std::string getName() const {return this->name;};
00256
00257 ParameterType getType() const {return this->parameterType;};
00258
00259 quantity<si::angular_velocity> value;
00260
00261 std::string name;
00262
00263 ParameterType parameterType;
00264
00265 };
00266
00267
00268
00269 class VelocityErrorSum : public YouBotJointParameterReadOnly {
00270 friend class YouBotJoint;
00271 public:
00272 VelocityErrorSum();
00273
00274 virtual ~VelocityErrorSum();
00275
00276 void getParameter(quantity<si::angular_velocity>& parameter) const;
00277
00278 void toString(std::string& value);
00279
00280
00281 private:
00282 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00283
00284 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00285
00286 std::string getName() const {return this->name;};
00287
00288 ParameterType getType() const {return this->parameterType;};
00289
00290 quantity<si::angular_velocity> value;
00291
00292 std::string name;
00293
00294 ParameterType parameterType;
00295
00296 };
00297
00298
00299
00300 class CurrentError : public YouBotJointParameterReadOnly {
00301 friend class YouBotJoint;
00302 public:
00303 CurrentError();
00304
00305 virtual ~CurrentError();
00306
00307 void getParameter(quantity<si::current>& parameter) const;
00308
00309 void toString(std::string& value);
00310
00311
00312 private:
00313 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00314
00315 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00316
00317 std::string getName() const {return this->name;};
00318
00319 ParameterType getType() const {return this->parameterType;};
00320
00321 quantity<si::current> value;
00322
00323 std::string name;
00324
00325 ParameterType parameterType;
00326
00327 };
00328
00329
00330
00331 class CurrentErrorSum : public YouBotJointParameterReadOnly {
00332 friend class YouBotJoint;
00333 public:
00334 CurrentErrorSum();
00335
00336 virtual ~CurrentErrorSum();
00337
00338 void getParameter(quantity<si::current>& parameter) const;
00339
00340 void toString(std::string& value);
00341
00342
00343 private:
00344 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00345
00346 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00347
00348 std::string getName() const {return this->name;};
00349
00350 ParameterType getType() const {return this->parameterType;};
00351
00352 quantity<si::current> value;
00353
00354 std::string name;
00355
00356 ParameterType parameterType;
00357
00358 };
00359
00360
00361
00362 class RampGeneratorSpeed : public YouBotJointParameterReadOnly {
00363 friend class YouBotJoint;
00364 public:
00365 RampGeneratorSpeed();
00366
00367 virtual ~RampGeneratorSpeed();
00368
00369 void getParameter(quantity<si::angular_velocity>& parameter) const;
00370
00371 void toString(std::string& value);
00372
00373
00374 private:
00375 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00376
00377 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00378
00379 std::string getName() const {return this->name;};
00380
00381 ParameterType getType() const {return this->parameterType;};
00382
00383 quantity<si::angular_velocity> value;
00384
00385 std::string name;
00386
00387 ParameterType parameterType;
00388
00389 };
00390
00391
00392
00393 class I2tSum : public YouBotJointParameterReadOnly {
00394 friend class YouBotJoint;
00395 public:
00396 I2tSum();
00397
00398 virtual ~I2tSum();
00399
00400 void getParameter(unsigned int& parameter) const;
00401
00402 void setParameter(const unsigned int parameter);
00403
00404 void toString(std::string& value);
00405
00406
00407 private:
00408 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00409
00410 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00411
00412 std::string getName() const {return this->name;};
00413
00414 ParameterType getType() const {return this->parameterType;};
00415
00416 unsigned int upperLimit;
00417
00418 unsigned int lowerLimit;
00419
00420 unsigned int value;
00421
00422 std::string name;
00423
00424 ParameterType parameterType;
00425
00426 };
00427
00428
00429
00430 class ActualMotorDriverTemperature : public YouBotJointParameterReadOnly {
00431 friend class YouBotJoint;
00432 public:
00433 ActualMotorDriverTemperature();
00434
00435 virtual ~ActualMotorDriverTemperature();
00436
00437 void getParameter(quantity<celsius::temperature>& parameter) const;
00438
00439 void toString(std::string& value);
00440
00441
00442 private:
00443 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00444
00445 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00446
00447 std::string getName() const {return this->name;};
00448
00449 ParameterType getType() const {return this->parameterType;};
00450
00451 quantity<celsius::temperature> value;
00452
00453 std::string name;
00454
00455 ParameterType parameterType;
00456
00457 };
00458
00459
00460
00461 class ActualModuleSupplyCurrent : public YouBotJointParameterReadOnly {
00462 friend class YouBotJoint;
00463 public:
00464 ActualModuleSupplyCurrent();
00465
00466 virtual ~ActualModuleSupplyCurrent();
00467
00468 void getParameter(quantity<si::current>& parameter) const;
00469
00470 void toString(std::string& value);
00471
00472
00473 private:
00474 void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00475
00476 void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00477
00478 std::string getName() const {return this->name;};
00479
00480 ParameterType getType() const {return this->parameterType;};
00481
00482 quantity<si::current> value;
00483
00484 std::string name;
00485
00486 ParameterType parameterType;
00487
00488 };
00489
00490 }
00491 #endif