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