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
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #include "youbot/YouBotJointParameterPasswordProtected.hpp"
00052 namespace youbot {
00053
00054 YouBotJointParameterPasswordProtected::YouBotJointParameterPasswordProtected() {
00055
00056
00057 }
00058
00059 YouBotJointParameterPasswordProtected::~YouBotJointParameterPasswordProtected() {
00060
00061
00062 }
00063
00064 ActivateOvervoltageProtection::ActivateOvervoltageProtection() {
00065
00066 this->name = "ActivateOvervoltageProtection";
00067 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00068
00069 }
00070
00071 ActivateOvervoltageProtection::~ActivateOvervoltageProtection() {
00072
00073
00074 }
00075
00076 void ActivateOvervoltageProtection::getParameter(bool& parameter) const {
00077
00078 parameter = this->value;
00079
00080 }
00081
00082 void ActivateOvervoltageProtection::setParameter(const bool parameter) {
00083
00084 this->value = parameter;
00085
00086 }
00087
00088 void ActivateOvervoltageProtection::toString(std::string& value) {
00089
00090 std::stringstream ss;
00091 ss << this->name << ": " << this->value;
00092 value = ss.str();
00093
00094 }
00095
00096 void ActivateOvervoltageProtection::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00097
00098
00099 message.stctOutput.commandNumber = msgType;
00100 message.stctOutput.moduleAddress = DRIVE;
00101 message.stctOutput.typeNumber = 245;
00102 message.stctOutput.value = value;
00103
00104
00105 }
00106
00107 void ActivateOvervoltageProtection::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00108
00109 this->value = message.stctInput.value;
00110
00111 }
00112
00113 ActualCommutationOffset::ActualCommutationOffset() {
00114
00115 this->name = "ActualCommutationOffset";
00116 this->lowerLimit = INT_MIN;
00117 this->upperLimit = INT_MAX;
00118 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00119
00120 }
00121
00122 ActualCommutationOffset::~ActualCommutationOffset() {
00123
00124
00125 }
00126
00127 void ActualCommutationOffset::getParameter(int& parameter) const {
00128
00129 parameter = this->value;
00130
00131 }
00132
00133 void ActualCommutationOffset::setParameter(const int parameter) {
00134
00135 if (this->lowerLimit > parameter) {
00136 throw std::out_of_range("The parameter exceeds the lower limit");
00137 }
00138 if (this->upperLimit < parameter) {
00139 throw std::out_of_range("The parameter exceeds the upper limit");
00140 }
00141
00142 this->value = parameter;
00143
00144 }
00145
00146 void ActualCommutationOffset::toString(std::string& value) {
00147
00148 std::stringstream ss;
00149 ss << this->name << ": " << this->value;
00150 value = ss.str();
00151
00152 }
00153
00154 void ActualCommutationOffset::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00155
00156
00157 message.stctOutput.commandNumber = msgType;
00158 message.stctOutput.moduleAddress = DRIVE;
00159 message.stctOutput.typeNumber = 165;
00160 message.stctOutput.value = value;
00161
00162
00163 }
00164
00165 void ActualCommutationOffset::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00166
00167 this->value = (int32)message.stctInput.value;
00168
00169 }
00170
00171 ApproveProtectedParameters::ApproveProtectedParameters() {
00172
00173 this->name = "ApproveProtectedParameters";
00174 this->lowerLimit = INT_MIN;
00175 this->upperLimit = INT_MAX;
00176 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00177
00178 }
00179
00180 ApproveProtectedParameters::~ApproveProtectedParameters() {
00181
00182
00183 }
00184
00185 void ApproveProtectedParameters::getParameter(int& parameter) const {
00186
00187 parameter = this->value;
00188
00189 }
00190
00191 void ApproveProtectedParameters::setParameter(const int parameter) {
00192
00193 if (this->lowerLimit > parameter) {
00194 throw std::out_of_range("The parameter exceeds the lower limit");
00195 }
00196 if (this->upperLimit < parameter) {
00197 throw std::out_of_range("The parameter exceeds the upper limit");
00198 }
00199 this->value = parameter;
00200
00201 }
00202
00203 void ApproveProtectedParameters::toString(std::string& value) {
00204
00205 std::stringstream ss;
00206 ss << this->name << ": " << this->value;
00207 value = ss.str();
00208
00209 }
00210
00211 void ApproveProtectedParameters::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00212
00213 message.stctOutput.commandNumber = msgType;
00214 message.stctOutput.moduleAddress = DRIVE;
00215 message.stctOutput.typeNumber = 248;
00216 message.stctOutput.value = value;
00217
00218 }
00219
00220 void ApproveProtectedParameters::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00221
00222 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
00223 this->value = message.stctInput.value;
00224 }
00225
00226 }
00227
00228 BEMFConstant::BEMFConstant() {
00229
00230 this->name = "BEMFConstant";
00231 this->lowerLimit = INT_MIN;
00232 this->upperLimit = INT_MAX;
00233 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00234
00235 }
00236
00237 BEMFConstant::~BEMFConstant() {
00238
00239
00240 }
00241
00242 void BEMFConstant::getParameter(int& parameter) const {
00243
00244 parameter = this->value;
00245
00246 }
00247
00248 void BEMFConstant::setParameter(const int parameter) {
00249
00250 if (this->lowerLimit > parameter) {
00251 throw std::out_of_range("The parameter exceeds the lower limit");
00252 }
00253 if (this->upperLimit < parameter) {
00254 throw std::out_of_range("The parameter exceeds the upper limit");
00255 }
00256
00257 this->value = parameter;
00258
00259 }
00260
00261 void BEMFConstant::toString(std::string& value) {
00262
00263 std::stringstream ss;
00264 ss << this->name << ": " << this->value;
00265 value = ss.str();
00266
00267 }
00268
00269 void BEMFConstant::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00270
00271
00272 message.stctOutput.commandNumber = msgType;
00273 message.stctOutput.moduleAddress = DRIVE;
00274 message.stctOutput.typeNumber = 239;
00275 message.stctOutput.value = value;
00276
00277
00278 }
00279
00280 void BEMFConstant::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00281
00282 this->value = (int32)message.stctInput.value;
00283
00284 }
00285
00286 CommutationMode::CommutationMode() {
00287
00288 this->name = "CommutationMode";
00289 this->lowerLimit = 0;
00290 this->upperLimit = 5;
00291 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00292
00293 }
00294
00295 CommutationMode::~CommutationMode() {
00296
00297
00298 }
00299
00300 void CommutationMode::getParameter(unsigned int& parameter) const {
00301
00302 parameter = this->value;
00303
00304 }
00305
00306 void CommutationMode::setParameter(const unsigned int parameter) {
00307
00308 if (this->lowerLimit > parameter) {
00309 throw std::out_of_range("The parameter exceeds the lower limit");
00310 }
00311 if (this->upperLimit < parameter) {
00312 throw std::out_of_range("The parameter exceeds the upper limit");
00313 }
00314 this->value = parameter;
00315
00316 }
00317
00318 void CommutationMode::toString(std::string& value) {
00319
00320 std::stringstream ss;
00321 ss << this->name << ": " << this->value;
00322 value = ss.str();
00323
00324 }
00325
00326 void CommutationMode::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00327
00328 message.stctOutput.commandNumber = msgType;
00329 message.stctOutput.moduleAddress = DRIVE;
00330 message.stctOutput.typeNumber = 159;
00331 message.stctOutput.value = value;
00332
00333 }
00334
00335 void CommutationMode::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00336
00337 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
00338 this->value = message.stctInput.value;
00339 }
00340
00341 }
00342
00343 CommutationMotorCurrent::CommutationMotorCurrent() {
00344
00345 this->name = "CommutationMotorCurrent";
00346 this->lowerLimit = 0 * ampere;
00347 this->upperLimit = INT_MAX * ampere;
00348 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00349
00350 }
00351
00352 CommutationMotorCurrent::~CommutationMotorCurrent() {
00353
00354
00355 }
00356
00357 void CommutationMotorCurrent::getParameter(quantity<current>& parameter) const {
00358
00359 parameter = this->value;
00360
00361 }
00362
00363 void CommutationMotorCurrent::setParameter(const quantity<current>& parameter) {
00364
00365 if (this->lowerLimit > parameter) {
00366 throw std::out_of_range("The parameter exceeds the lower limit");
00367 }
00368 if (this->upperLimit < parameter) {
00369 throw std::out_of_range("The parameter exceeds the upper limit");
00370 }
00371
00372 this->value = parameter;
00373
00374 }
00375
00376 void CommutationMotorCurrent::toString(std::string& value) {
00377
00378 std::stringstream ss;
00379 ss << this->name << ": " << this->value;
00380 value = ss.str();
00381
00382 }
00383
00384 void CommutationMotorCurrent::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00385
00386
00387 message.stctOutput.commandNumber = msgType;
00388 message.stctOutput.moduleAddress = DRIVE;
00389 message.stctOutput.typeNumber = 177;
00390 message.stctOutput.value = (uint32)(value.value() * 1000.0);
00391
00392
00393 }
00394
00395 void CommutationMotorCurrent::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00396
00397 double temp = (uint32)message.stctInput.value;
00398 this->value = temp/1000.0 * ampere;
00399
00400 }
00401
00402 CurrentControlLoopDelay::CurrentControlLoopDelay() {
00403
00404 this->name = "CurrentControlLoopDelay";
00405 this->lowerLimit = 0;
00406 this->upperLimit = INT_MAX * seconds;
00407 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00408
00409 }
00410
00411 CurrentControlLoopDelay::~CurrentControlLoopDelay() {
00412
00413
00414 }
00415
00416 void CurrentControlLoopDelay::getParameter(quantity<si::time>& parameter) const {
00417
00418 parameter = this->value;
00419
00420 }
00421
00422 void CurrentControlLoopDelay::setParameter(const quantity<si::time>& parameter) {
00423
00424 if (this->lowerLimit > parameter) {
00425 throw std::out_of_range("The parameter exceeds the lower limit");
00426 }
00427 if (this->upperLimit < parameter) {
00428 throw std::out_of_range("The parameter exceeds the upper limit");
00429 }
00430
00431 this->value = parameter;
00432
00433 }
00434
00435 void CurrentControlLoopDelay::toString(std::string& value) {
00436
00437 std::stringstream ss;
00438 ss << this->name << ": " << this->value;
00439 value = ss.str();
00440
00441 }
00442
00443 void CurrentControlLoopDelay::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00444
00445
00446 message.stctOutput.commandNumber = msgType;
00447 message.stctOutput.moduleAddress = DRIVE;
00448 message.stctOutput.typeNumber = 134;
00449 message.stctOutput.value = (uint32)(value.value() * 1000 *1000 /50.0);
00450
00451
00452 }
00453
00454 void CurrentControlLoopDelay::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00455
00456 double temp = (uint32)message.stctInput.value;
00457 this->value = (temp/(1000.0 * 1000.0)) * 50 * seconds;
00458
00459 }
00460
00461 EncoderResolution::EncoderResolution() {
00462
00463 this->name = "EncoderResolution";
00464 this->lowerLimit = 0;
00465 this->upperLimit = INT_MAX;
00466 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00467
00468 }
00469
00470 EncoderResolution::~EncoderResolution() {
00471
00472
00473 }
00474
00475 void EncoderResolution::getParameter(unsigned int& parameter) const {
00476
00477 parameter = this->value;
00478
00479 }
00480
00481 void EncoderResolution::setParameter(const unsigned int parameter) {
00482
00483 if (this->lowerLimit > parameter) {
00484 throw std::out_of_range("The parameter exceeds the lower limit");
00485 }
00486 if (this->upperLimit < parameter) {
00487 throw std::out_of_range("The parameter exceeds the upper limit");
00488 }
00489 this->value = parameter;
00490
00491 }
00492
00493 void EncoderResolution::toString(std::string& value) {
00494
00495 std::stringstream ss;
00496 ss << this->name << ": " << this->value;
00497 value = ss.str();
00498
00499 }
00500
00501 void EncoderResolution::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00502
00503 message.stctOutput.commandNumber = msgType;
00504 message.stctOutput.moduleAddress = DRIVE;
00505 message.stctOutput.typeNumber = 250;
00506 message.stctOutput.value = (uint32)value;
00507
00508 }
00509
00510 void EncoderResolution::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00511
00512 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
00513 this->value = (uint32)message.stctInput.value;
00514 }
00515
00516 }
00517
00518 EncoderStopSwitch::EncoderStopSwitch() {
00519
00520 this->name = "EncoderStopSwitch";
00521 this->lowerLimit = 0;
00522 this->upperLimit = 3;
00523 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00524
00525 }
00526
00527 EncoderStopSwitch::~EncoderStopSwitch() {
00528
00529
00530 }
00531
00532 void EncoderStopSwitch::getParameter(unsigned int& parameter) const {
00533
00534 parameter = this->value;
00535
00536 }
00537
00538 void EncoderStopSwitch::setParameter(const unsigned int parameter) {
00539
00540 if (this->lowerLimit > parameter) {
00541 throw std::out_of_range("The parameter exceeds the lower limit");
00542 }
00543 if (this->upperLimit < parameter) {
00544 throw std::out_of_range("The parameter exceeds the upper limit");
00545 }
00546
00547 this->value = parameter;
00548
00549 }
00550
00551 void EncoderStopSwitch::toString(std::string& value) {
00552
00553 std::stringstream ss;
00554 ss << this->name << ": " << this->value;
00555 value = ss.str();
00556
00557 }
00558
00559 void EncoderStopSwitch::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00560
00561
00562 message.stctOutput.commandNumber = msgType;
00563 message.stctOutput.moduleAddress = DRIVE;
00564 message.stctOutput.typeNumber = 164;
00565 message.stctOutput.value = (uint32)value;
00566
00567
00568 }
00569
00570 void EncoderStopSwitch::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00571
00572 this->value = (uint32)message.stctInput.value;
00573
00574 }
00575
00576 HallSensorPolarityReversal::HallSensorPolarityReversal() {
00577
00578 this->name = "HallSensorPolarityReversal";
00579 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00580
00581 }
00582
00583 HallSensorPolarityReversal::~HallSensorPolarityReversal() {
00584
00585
00586 }
00587
00588 void HallSensorPolarityReversal::getParameter(bool& parameter) const {
00589
00590 parameter = this->value;
00591
00592 }
00593
00594 void HallSensorPolarityReversal::setParameter(const bool parameter) {
00595
00596 this->value = parameter;
00597
00598 }
00599
00600 void HallSensorPolarityReversal::toString(std::string& value) {
00601
00602 std::stringstream ss;
00603 ss << this->name << ": " << this->value;
00604 value = ss.str();
00605
00606 }
00607
00608 void HallSensorPolarityReversal::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00609
00610 message.stctOutput.commandNumber = msgType;
00611 message.stctOutput.moduleAddress = DRIVE;
00612 message.stctOutput.typeNumber = 254;
00613 message.stctOutput.value = (uint32)value;
00614
00615 }
00616
00617 void HallSensorPolarityReversal::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00618
00619 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
00620 this->value = (uint32)message.stctInput.value;
00621 }
00622
00623 }
00624
00625 I2tExceedCounter::I2tExceedCounter() {
00626
00627 this->name = "I2tExceedCounter";
00628 this->lowerLimit = 0;
00629 this->upperLimit = INT_MAX;
00630 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00631
00632 }
00633
00634 I2tExceedCounter::~I2tExceedCounter() {
00635
00636
00637 }
00638
00639 void I2tExceedCounter::getParameter(unsigned int& parameter) const {
00640
00641 parameter = this->value;
00642
00643 }
00644
00645 void I2tExceedCounter::setParameter(const unsigned int parameter) {
00646
00647 if (this->lowerLimit > parameter) {
00648 throw std::out_of_range("The parameter exceeds the lower limit");
00649 }
00650 if (this->upperLimit < parameter) {
00651 throw std::out_of_range("The parameter exceeds the upper limit");
00652 }
00653 this->value = parameter;
00654
00655 }
00656
00657 void I2tExceedCounter::toString(std::string& value) {
00658
00659 std::stringstream ss;
00660 ss << this->name << ": " << this->value;
00661 value = ss.str();
00662
00663 }
00664
00665 void I2tExceedCounter::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00666
00667 message.stctOutput.commandNumber = msgType;
00668 message.stctOutput.moduleAddress = DRIVE;
00669 message.stctOutput.typeNumber = 28;
00670 message.stctOutput.value = (uint32)value;
00671
00672 }
00673
00674 void I2tExceedCounter::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00675
00676 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
00677 this->value = (uint32)message.stctInput.value;
00678 }
00679
00680 }
00681
00682 I2tLimit::I2tLimit() {
00683
00684 this->name = "I2tLimit";
00685 this->lowerLimit = 0;
00686 this->upperLimit = INT_MAX;
00687 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00688
00689 }
00690
00691 I2tLimit::~I2tLimit() {
00692
00693
00694 }
00695
00696 void I2tLimit::getParameter(unsigned int& parameter) const {
00697
00698 parameter = this->value;
00699
00700 }
00701
00702 void I2tLimit::setParameter(const unsigned int parameter) {
00703
00704 if (this->lowerLimit > parameter) {
00705 throw std::out_of_range("The parameter exceeds the lower limit");
00706 }
00707 if (this->upperLimit < parameter) {
00708 throw std::out_of_range("The parameter exceeds the upper limit");
00709 }
00710 this->value = parameter;
00711
00712 }
00713
00714 void I2tLimit::toString(std::string& value) {
00715
00716 std::stringstream ss;
00717 ss << this->name << ": " << this->value;
00718 value = ss.str();
00719
00720 }
00721
00722 void I2tLimit::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00723
00724 message.stctOutput.commandNumber = msgType;
00725 message.stctOutput.moduleAddress = DRIVE;
00726 message.stctOutput.typeNumber = 26;
00727 message.stctOutput.value = (uint32)value;
00728
00729 }
00730
00731 void I2tLimit::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00732
00733 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
00734 this->value = (uint32)message.stctInput.value;
00735 }
00736
00737 }
00738
00739 InitializationMode::InitializationMode() {
00740
00741 this->name = "InitializationMode";
00742 this->lowerLimit = 0;
00743 this->upperLimit = 2;
00744 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00745
00746 }
00747
00748 InitializationMode::~InitializationMode() {
00749
00750
00751 }
00752
00753 void InitializationMode::getParameter(int& parameter) const {
00754
00755 parameter = this->value;
00756
00757 }
00758
00759 void InitializationMode::setParameter(const int parameter) {
00760
00761 if (this->lowerLimit > parameter) {
00762 throw std::out_of_range("The parameter exceeds the lower limit");
00763 }
00764 if (this->upperLimit < parameter) {
00765 throw std::out_of_range("The parameter exceeds the upper limit");
00766 }
00767 this->value = parameter;
00768
00769 }
00770
00771 void InitializationMode::toString(std::string& value) {
00772
00773 std::stringstream ss;
00774 ss << this->name << ": " << this->value;
00775 value = ss.str();
00776
00777 }
00778
00779 void InitializationMode::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00780
00781 message.stctOutput.commandNumber = msgType;
00782 message.stctOutput.moduleAddress = DRIVE;
00783 message.stctOutput.typeNumber = 249;
00784 message.stctOutput.value = value;
00785
00786 }
00787
00788 void InitializationMode::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00789
00790 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
00791 this->value = (int32)message.stctInput.value;
00792 }
00793
00794 }
00795
00796 InitSineDelay::InitSineDelay() {
00797
00798 this->name = "InitSineDelay";
00799 this->lowerLimit = -32.768 * seconds;
00800 this->upperLimit = +32.767 * seconds;
00801 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00802
00803 }
00804
00805 InitSineDelay::~InitSineDelay() {
00806
00807
00808 }
00809
00810 void InitSineDelay::getParameter(quantity<si::time>& parameter) const {
00811
00812 parameter = this->value;
00813
00814 }
00815
00816 void InitSineDelay::setParameter(const quantity<si::time>& parameter) {
00817
00818 if (this->lowerLimit > parameter) {
00819 throw std::out_of_range("The parameter exceeds the lower limit");
00820 }
00821 if (this->upperLimit < parameter) {
00822 throw std::out_of_range("The parameter exceeds the upper limit");
00823 }
00824
00825 this->value = parameter;
00826
00827 }
00828
00829 void InitSineDelay::toString(std::string& value) {
00830
00831 std::stringstream ss;
00832 ss << this->name << ": " << this->value;
00833 value = ss.str();
00834
00835 }
00836
00837 void InitSineDelay::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00838
00839
00840 message.stctOutput.commandNumber = msgType;
00841 message.stctOutput.moduleAddress = DRIVE;
00842 message.stctOutput.typeNumber = 244;
00843 message.stctOutput.value = (int32)(value.value() * 1000);
00844
00845
00846 }
00847
00848 void InitSineDelay::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00849
00850 double temp = (int32)message.stctInput.value;
00851 this->value = (temp/1000.0) * seconds;
00852
00853 }
00854
00855 MassInertiaConstant::MassInertiaConstant() {
00856
00857 this->name = "MassInertiaConstant";
00858 this->lowerLimit = INT_MIN;
00859 this->upperLimit = INT_MAX;
00860 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00861
00862 }
00863
00864 MassInertiaConstant::~MassInertiaConstant() {
00865
00866
00867 }
00868
00869 void MassInertiaConstant::getParameter(int& parameter) const {
00870
00871 parameter = this->value;
00872
00873 }
00874
00875 void MassInertiaConstant::setParameter(const int parameter) {
00876
00877 if (this->lowerLimit > parameter) {
00878 throw std::out_of_range("The parameter exceeds the lower limit");
00879 }
00880 if (this->upperLimit < parameter) {
00881 throw std::out_of_range("The parameter exceeds the upper limit");
00882 }
00883
00884 this->value = parameter;
00885
00886 }
00887
00888 void MassInertiaConstant::toString(std::string& value) {
00889
00890 std::stringstream ss;
00891 ss << this->name << ": " << this->value;
00892 value = ss.str();
00893
00894 }
00895
00896 void MassInertiaConstant::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00897
00898
00899 message.stctOutput.commandNumber = msgType;
00900 message.stctOutput.moduleAddress = DRIVE;
00901 message.stctOutput.typeNumber = 238;
00902 message.stctOutput.value = (int32)value;
00903
00904
00905 }
00906
00907 void MassInertiaConstant::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00908
00909 this->value = (int32)message.stctInput.value;
00910
00911 }
00912
00913 MaximumMotorCurrent::MaximumMotorCurrent() {
00914
00915 this->name = "MaximumMotorCurrent";
00916 this->lowerLimit = 0 * ampere;
00917 this->upperLimit = INT_MAX * ampere;
00918 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00919
00920 }
00921
00922 MaximumMotorCurrent::~MaximumMotorCurrent() {
00923
00924
00925 }
00926
00927 void MaximumMotorCurrent::getParameter(quantity<current>& parameter) const {
00928
00929 parameter = this->value;
00930
00931 }
00932
00933 void MaximumMotorCurrent::setParameter(const quantity<current>& parameter) {
00934
00935 if (this->lowerLimit > parameter) {
00936 throw std::out_of_range("The parameter exceeds the lower limit");
00937 }
00938 if (this->upperLimit < parameter) {
00939 throw std::out_of_range("The parameter exceeds the upper limit");
00940 }
00941
00942 this->value = parameter;
00943
00944 }
00945
00946 void MaximumMotorCurrent::toString(std::string& value) {
00947
00948 std::stringstream ss;
00949 ss << this->name << ": " << this->value;
00950 value = ss.str();
00951
00952 }
00953
00954 void MaximumMotorCurrent::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
00955
00956
00957 message.stctOutput.commandNumber = msgType;
00958 message.stctOutput.moduleAddress = DRIVE;
00959 message.stctOutput.typeNumber = 6;
00960 message.stctOutput.value = (uint32)(value.value() * 1000.0);
00961
00962
00963 }
00964
00965 void MaximumMotorCurrent::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
00966
00967 double temp = (uint32)message.stctInput.value;
00968 this->value = temp/1000.0 * ampere;
00969
00970 }
00971
00972 MotorCoilResistance::MotorCoilResistance() {
00973
00974 this->name = "MotorCoilResistance";
00975 this->lowerLimit = INT_MIN * ohm;
00976 this->upperLimit = INT_MAX * ohm;
00977 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
00978
00979 }
00980
00981 MotorCoilResistance::~MotorCoilResistance() {
00982
00983
00984 }
00985
00986 void MotorCoilResistance::getParameter(quantity<resistance>& parameter) const {
00987
00988 parameter = this->value;
00989
00990 }
00991
00992 void MotorCoilResistance::setParameter(const quantity<resistance>& parameter) {
00993
00994 if (this->lowerLimit > parameter) {
00995 throw std::out_of_range("The parameter exceeds the lower limit");
00996 }
00997 if (this->upperLimit < parameter) {
00998 throw std::out_of_range("The parameter exceeds the upper limit");
00999 }
01000 this->value = parameter;
01001
01002 }
01003
01004 void MotorCoilResistance::toString(std::string& value) {
01005
01006 std::stringstream ss;
01007 ss << this->name << ": " << this->value;
01008 value = ss.str();
01009
01010 }
01011
01012 void MotorCoilResistance::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01013
01014 message.stctOutput.commandNumber = msgType;
01015 message.stctOutput.moduleAddress = DRIVE;
01016 message.stctOutput.typeNumber = 240;
01017 message.stctOutput.value = (int32)(value.value() * 1000);
01018
01019 }
01020
01021 void MotorCoilResistance::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01022
01023 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
01024 double temp = (int32)message.stctInput.value;
01025 this->value = temp/1000.0 * ohm;
01026 }
01027
01028 }
01029
01030 MotorControllerTimeout::MotorControllerTimeout() {
01031
01032 this->name = "MotorControllerTimeout";
01033 this->lowerLimit = 0;
01034 this->upperLimit = INT_MAX * seconds;
01035 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01036
01037 }
01038
01039 MotorControllerTimeout::~MotorControllerTimeout() {
01040
01041
01042 }
01043
01044 void MotorControllerTimeout::getParameter(quantity<si::time>& parameter) const {
01045
01046 parameter = this->value;
01047
01048 }
01049
01050 void MotorControllerTimeout::setParameter(const quantity<si::time>& parameter) {
01051
01052 if (this->lowerLimit > parameter) {
01053 throw std::out_of_range("The parameter exceeds the lower limit");
01054 }
01055 if (this->upperLimit < parameter) {
01056 throw std::out_of_range("The parameter exceeds the upper limit");
01057 }
01058
01059 this->value = parameter;
01060
01061 }
01062
01063 void MotorControllerTimeout::toString(std::string& value) {
01064
01065 std::stringstream ss;
01066 ss << this->name << ": " << this->value;
01067 value = ss.str();
01068
01069 }
01070
01071 void MotorControllerTimeout::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01072
01073
01074
01075 if (msgType == SAP){
01076 message.stctOutput.commandNumber = SGP;
01077 }else if (msgType == GAP) {
01078 message.stctOutput.commandNumber = GGP;
01079 } else {
01080 message.stctOutput.commandNumber = msgType;
01081 }
01082 message.stctOutput.moduleAddress = DRIVE;
01083 message.stctOutput.typeNumber = 90;
01084 message.stctOutput.value = value.value() * 1000;
01085
01086
01087 }
01088
01089 void MotorControllerTimeout::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01090
01091 this->value = ((double)message.stctInput.value)/1000.0 * seconds;
01092
01093 }
01094
01095 MotorPoles::MotorPoles() {
01096
01097 this->name = "MotorPoles";
01098 this->lowerLimit = 2;
01099 this->upperLimit = 254;
01100 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01101
01102 }
01103
01104 MotorPoles::~MotorPoles() {
01105
01106
01107 }
01108
01109 void MotorPoles::getParameter(unsigned int& parameter) const {
01110
01111 parameter = this->value;
01112
01113 }
01114
01115 void MotorPoles::setParameter(const unsigned int parameter) {
01116
01117 if (this->lowerLimit > parameter) {
01118 throw std::out_of_range("The parameter exceeds the lower limit");
01119 }
01120 if (this->upperLimit < parameter) {
01121 throw std::out_of_range("The parameter exceeds the upper limit");
01122 }
01123 this->value = parameter;
01124
01125 }
01126
01127 void MotorPoles::toString(std::string& value) {
01128
01129 std::stringstream ss;
01130 ss << this->name << ": " << this->value;
01131 value = ss.str();
01132
01133 }
01134
01135 void MotorPoles::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01136
01137 message.stctOutput.commandNumber = msgType;
01138 message.stctOutput.moduleAddress = DRIVE;
01139 message.stctOutput.typeNumber = 253;
01140 message.stctOutput.value = (uint32)value;
01141
01142 }
01143
01144 void MotorPoles::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01145
01146 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
01147 this->value = (uint32)message.stctInput.value;
01148 }
01149
01150 }
01151
01152 OperationalTime::OperationalTime() {
01153
01154 this->name = "OperationalTime";
01155 this->lowerLimit = 0;
01156 this->upperLimit = INT_MAX * seconds;
01157 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01158
01159 }
01160
01161 OperationalTime::~OperationalTime() {
01162
01163
01164 }
01165
01166 void OperationalTime::getParameter(quantity<si::time>& parameter) const {
01167
01168 parameter = this->value;
01169
01170 }
01171
01172 void OperationalTime::setParameter(const quantity<si::time>& parameter) {
01173
01174 if (this->lowerLimit > parameter) {
01175 throw std::out_of_range("The parameter exceeds the lower limit");
01176 }
01177 if (this->upperLimit < parameter) {
01178 throw std::out_of_range("The parameter exceeds the upper limit");
01179 }
01180
01181 this->value = parameter;
01182
01183 }
01184
01185 void OperationalTime::toString(std::string& value) {
01186
01187 std::stringstream ss;
01188 ss << this->name << ": " << this->value;
01189 value = ss.str();
01190
01191 }
01192
01193 void OperationalTime::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01194
01195 message.stctOutput.commandNumber = msgType;
01196 message.stctOutput.moduleAddress = DRIVE;
01197 message.stctOutput.typeNumber = 30;
01198 message.stctOutput.value = value.value() / 60.0;
01199
01200
01201 }
01202
01203 void OperationalTime::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01204
01205 this->value = ((double)message.stctInput.value) * 60.0 * seconds;
01206
01207 }
01208
01209 PIDControlTime::PIDControlTime() {
01210
01211 this->name = "PIDControlTime";
01212 this->lowerLimit = 0;
01213 this->upperLimit = INT_MAX * seconds;
01214 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01215
01216 }
01217
01218 PIDControlTime::~PIDControlTime() {
01219
01220
01221 }
01222
01223 void PIDControlTime::getParameter(quantity<si::time>& parameter) const {
01224
01225 parameter = this->value;
01226
01227 }
01228
01229 void PIDControlTime::setParameter(const quantity<si::time>& parameter) {
01230
01231 if (this->lowerLimit > parameter) {
01232 throw std::out_of_range("The parameter exceeds the lower limit");
01233 }
01234 if (this->upperLimit < parameter) {
01235 throw std::out_of_range("The parameter exceeds the upper limit");
01236 }
01237
01238 this->value = parameter;
01239
01240 }
01241
01242 void PIDControlTime::toString(std::string& value) {
01243
01244 std::stringstream ss;
01245 ss << this->name << ": " << this->value;
01246 value = ss.str();
01247
01248 }
01249
01250 void PIDControlTime::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01251
01252
01253 message.stctOutput.commandNumber = msgType;
01254 message.stctOutput.moduleAddress = DRIVE;
01255 message.stctOutput.typeNumber = 133;
01256 message.stctOutput.value = value.value() * 1000;
01257
01258
01259 }
01260
01261 void PIDControlTime::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01262
01263 this->value = ((double)message.stctInput.value)/1000 * seconds;
01264
01265 }
01266
01267 ReversingEncoderDirection::ReversingEncoderDirection() {
01268
01269 this->name = "ReversingEncoderDirection";
01270 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01271
01272 }
01273
01274 ReversingEncoderDirection::~ReversingEncoderDirection() {
01275
01276
01277 }
01278
01279 bool ReversingEncoderDirection::getParameter(bool& parameter) const {
01280
01281 parameter = this->value;
01282 return this->value;
01283
01284 }
01285
01286 void ReversingEncoderDirection::setParameter(const bool parameter) {
01287
01288 this->value = parameter;
01289
01290 }
01291
01292 void ReversingEncoderDirection::toString(std::string& value) {
01293
01294 std::stringstream ss;
01295 ss << this->name << ": " << this->value;
01296 value = ss.str();
01297
01298 }
01299
01300 void ReversingEncoderDirection::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01301
01302 message.stctOutput.commandNumber = msgType;
01303 message.stctOutput.moduleAddress = DRIVE;
01304 message.stctOutput.typeNumber = 251;
01305 message.stctOutput.value = value;
01306
01307 }
01308
01309 void ReversingEncoderDirection::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01310
01311 if (message.stctOutput.commandNumber == message.stctInput.commandNumber && message.stctInput.status == NO_ERROR) {
01312 this->value = message.stctInput.value;
01313 }
01314
01315 }
01316
01317 SetEncoderCounterZeroAtNextNChannel::SetEncoderCounterZeroAtNextNChannel() {
01318
01319 this->name = "SetEncoderCounterZeroAtNextNChannel";
01320 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01321
01322 }
01323
01324 SetEncoderCounterZeroAtNextNChannel::~SetEncoderCounterZeroAtNextNChannel() {
01325
01326
01327 }
01328
01329 void SetEncoderCounterZeroAtNextNChannel::getParameter(bool& parameter) const {
01330
01331 parameter = this->value;
01332
01333 }
01334
01335 void SetEncoderCounterZeroAtNextNChannel::setParameter(const bool parameter) {
01336
01337 this->value = parameter;
01338
01339 }
01340
01341 void SetEncoderCounterZeroAtNextNChannel::toString(std::string& value) {
01342
01343 std::stringstream ss;
01344 ss << this->name << ": " << this->value;
01345 value = ss.str();
01346
01347 }
01348
01349 void SetEncoderCounterZeroAtNextNChannel::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01350
01351
01352 message.stctOutput.commandNumber = msgType;
01353 message.stctOutput.moduleAddress = DRIVE;
01354 message.stctOutput.typeNumber = 161;
01355 message.stctOutput.value = value;
01356
01357
01358 }
01359
01360 void SetEncoderCounterZeroAtNextNChannel::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01361
01362 this->value = message.stctInput.value;
01363
01364 }
01365
01366 SetEncoderCounterZeroAtNextSwitch::SetEncoderCounterZeroAtNextSwitch() {
01367
01368 this->name = "SetEncoderCounterZeroAtNextSwitch";
01369 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01370
01371 }
01372
01373 SetEncoderCounterZeroAtNextSwitch::~SetEncoderCounterZeroAtNextSwitch() {
01374
01375
01376 }
01377
01378 void SetEncoderCounterZeroAtNextSwitch::getParameter(bool& parameter) const {
01379
01380 parameter = this->value;
01381
01382 }
01383
01384 void SetEncoderCounterZeroAtNextSwitch::setParameter(const bool parameter) {
01385
01386 this->value = parameter;
01387
01388 }
01389
01390 void SetEncoderCounterZeroAtNextSwitch::toString(std::string& value) {
01391
01392 std::stringstream ss;
01393 ss << this->name << ": " << this->value;
01394 value = ss.str();
01395
01396 }
01397
01398 void SetEncoderCounterZeroAtNextSwitch::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01399
01400
01401 message.stctOutput.commandNumber = msgType;
01402 message.stctOutput.moduleAddress = DRIVE;
01403 message.stctOutput.typeNumber = 162;
01404 message.stctOutput.value = value;
01405
01406
01407 }
01408
01409 void SetEncoderCounterZeroAtNextSwitch::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01410
01411 this->value = message.stctInput.value;
01412
01413 }
01414
01415 SetEncoderCounterZeroOnlyOnce::SetEncoderCounterZeroOnlyOnce() {
01416
01417 this->name = "SetEncoderCounterZeroOnlyOnce";
01418 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01419
01420 }
01421
01422 SetEncoderCounterZeroOnlyOnce::~SetEncoderCounterZeroOnlyOnce() {
01423
01424
01425 }
01426
01427 void SetEncoderCounterZeroOnlyOnce::getParameter(bool& parameter) const {
01428
01429 parameter = this->value;
01430
01431 }
01432
01433 void SetEncoderCounterZeroOnlyOnce::setParameter(const bool parameter) {
01434
01435 this->value = parameter;
01436
01437 }
01438
01439 void SetEncoderCounterZeroOnlyOnce::toString(std::string& value) {
01440
01441 std::stringstream ss;
01442 ss << this->name << ": " << this->value;
01443 value = ss.str();
01444
01445 }
01446
01447 void SetEncoderCounterZeroOnlyOnce::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01448
01449
01450 message.stctOutput.commandNumber = msgType;
01451 message.stctOutput.moduleAddress = DRIVE;
01452 message.stctOutput.typeNumber = 163;
01453 message.stctOutput.value = value;
01454
01455
01456 }
01457
01458 void SetEncoderCounterZeroOnlyOnce::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01459
01460 this->value = message.stctInput.value;
01461
01462 }
01463
01464 SineInitializationVelocity::SineInitializationVelocity() {
01465
01466 this->name = "SineInitializationVelocity";
01467 this->lowerLimit = INT_MIN;
01468 this->upperLimit = INT_MAX;
01469 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01470
01471 }
01472
01473 SineInitializationVelocity::~SineInitializationVelocity() {
01474
01475
01476 }
01477
01478 void SineInitializationVelocity::getParameter(int& parameter) const {
01479
01480 parameter = this->value;
01481
01482 }
01483
01484 void SineInitializationVelocity::setParameter(const int parameter) {
01485
01486 if (this->lowerLimit > parameter) {
01487 throw std::out_of_range("The parameter exceeds the lower limit");
01488 }
01489 if (this->upperLimit < parameter) {
01490 throw std::out_of_range("The parameter exceeds the upper limit");
01491 }
01492
01493 this->value = parameter;
01494
01495 }
01496
01497 void SineInitializationVelocity::toString(std::string& value) {
01498
01499 std::stringstream ss;
01500 ss << this->name << ": " << this->value;
01501 value = ss.str();
01502
01503 }
01504
01505 void SineInitializationVelocity::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01506
01507
01508 message.stctOutput.commandNumber = msgType;
01509 message.stctOutput.moduleAddress = DRIVE;
01510 message.stctOutput.typeNumber = 241;
01511 message.stctOutput.value = (int32)value;
01512
01513 }
01514
01515 void SineInitializationVelocity::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01516
01517 this->value = (int32)message.stctInput.value;
01518
01519 }
01520
01521 StopSwitchPolarity::StopSwitchPolarity() {
01522
01523 this->name = "StopSwitchPolarity";
01524 this->lowerLimit = 0;
01525 this->upperLimit = 3;
01526 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01527
01528 }
01529
01530 StopSwitchPolarity::~StopSwitchPolarity() {
01531
01532
01533 }
01534
01535 void StopSwitchPolarity::getParameter(unsigned int& parameter) const {
01536
01537 parameter = this->value;
01538
01539 }
01540
01541 void StopSwitchPolarity::setParameter(const unsigned int parameter) {
01542
01543 if (this->lowerLimit > parameter) {
01544 throw std::out_of_range("The parameter exceeds the lower limit");
01545 }
01546 if (this->upperLimit < parameter) {
01547 throw std::out_of_range("The parameter exceeds the upper limit");
01548 }
01549
01550 this->value = parameter;
01551
01552 }
01553
01554 void StopSwitchPolarity::toString(std::string& value) {
01555
01556 std::stringstream ss;
01557 ss << this->name << ": " << this->value;
01558 value = ss.str();
01559
01560 }
01561
01562 void StopSwitchPolarity::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01563
01564
01565 message.stctOutput.commandNumber = msgType;
01566 message.stctOutput.moduleAddress = DRIVE;
01567 message.stctOutput.typeNumber = 166;
01568 message.stctOutput.value = value;
01569
01570
01571 }
01572
01573 void StopSwitchPolarity::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01574
01575 this->value = message.stctInput.value;
01576
01577 }
01578
01579 ThermalWindingTimeConstant::ThermalWindingTimeConstant() {
01580
01581 this->name = "ThermalWindingTimeConstant";
01582 this->lowerLimit = 0;
01583 this->upperLimit = INT_MAX * seconds;
01584 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01585
01586 }
01587
01588 ThermalWindingTimeConstant::~ThermalWindingTimeConstant() {
01589
01590
01591 }
01592
01593 void ThermalWindingTimeConstant::getParameter(quantity<si::time>& parameter) const {
01594
01595 parameter = this->value;
01596
01597 }
01598
01599 void ThermalWindingTimeConstant::setParameter(const quantity<si::time>& parameter) {
01600
01601 if (this->lowerLimit > parameter) {
01602 throw std::out_of_range("The parameter exceeds the lower limit");
01603 }
01604 if (this->upperLimit < parameter) {
01605 throw std::out_of_range("The parameter exceeds the upper limit");
01606 }
01607
01608 this->value = parameter;
01609
01610 }
01611
01612 void ThermalWindingTimeConstant::toString(std::string& value) {
01613
01614 std::stringstream ss;
01615 ss << this->name << ": " << this->value;
01616 value = ss.str();
01617
01618 }
01619
01620 void ThermalWindingTimeConstant::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01621
01622 message.stctOutput.commandNumber = msgType;
01623 message.stctOutput.moduleAddress = DRIVE;
01624 message.stctOutput.typeNumber = 25;
01625 message.stctOutput.value = value.value() * 1000;
01626
01627
01628 }
01629
01630 void ThermalWindingTimeConstant::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01631
01632 this->value = ((double)message.stctInput.value)/1000.0 * seconds;
01633
01634 }
01635
01636 MotorHaltedVelocity::MotorHaltedVelocity() {
01637
01638 this->name = "MotorHaltedVelocity";
01639 this->lowerLimit = INT_MIN;
01640 this->upperLimit = INT_MAX;
01641 this->parameterType = MOTOR_CONTOLLER_PARAMETER;
01642
01643 }
01644
01645 MotorHaltedVelocity::~MotorHaltedVelocity() {
01646
01647
01648 }
01649
01650 void MotorHaltedVelocity::getParameter(int& parameter) const {
01651
01652 parameter = this->value;
01653
01654 }
01655
01656 void MotorHaltedVelocity::setParameter(const int parameter) {
01657
01658 if (this->lowerLimit > parameter) {
01659 throw std::out_of_range("The parameter exceeds the lower limit");
01660 }
01661 if (this->upperLimit < parameter) {
01662 throw std::out_of_range("The parameter exceeds the upper limit");
01663 }
01664
01665 this->value = parameter;
01666
01667 }
01668
01669 void MotorHaltedVelocity::toString(std::string& value) {
01670
01671 std::stringstream ss;
01672 ss << this->name << ": " << this->value;
01673 value = ss.str();
01674
01675 }
01676
01677 void MotorHaltedVelocity::getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const {
01678
01679
01680 message.stctOutput.commandNumber = msgType;
01681 message.stctOutput.moduleAddress = DRIVE;
01682 message.stctOutput.typeNumber = 9;
01683 message.stctOutput.value = (int32)value;
01684
01685 }
01686
01687 void MotorHaltedVelocity::setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) {
01688
01689 this->value = (int32)message.stctInput.value;
01690
01691 }
01692
01693
01694 }