29 const String _className;
36 void errorPrint(
const String& message){
if(_print._errorMessages){_print.
errorPrint(_className + message);}};
43 void warningPrint(
const String& message){
if(_print._errorMessages){_print.
warningPrint(_className + message);}};
50 void infoPrint(
const String& message){
if(_print._errorMessages){_print.
infoPrint(_className + message);}};
70 uint8_t setPolicies(uint8_t ID, uint8_t newAlarmLEDPolicy, uint8_t newTorquePolicy);
84 uint8_t setTemperatureVoltage(uint8_t ID, int16_t newMaxTemp, uint16_t newMinVoltage, uint16_t newMaxVoltage);
110 uint8_t setAcceleration(uint8_t ID, uint8_t newAccelerationRatio, uint16_t newMaxAccelerationTime);
142 uint8_t setLoadControl(uint8_t ID, uint16_t newDeadZone, uint8_t newSaturatorOffset,
const uint32_t& newSaturatorSlope, int8_t newPWMOffset, uint8_t newMinPWM, uint16_t newMaxPWM);
155 uint8_t setPWMPositionLimits(uint8_t ID, uint16_t newOverlaodPWMThreshold, int16_t newMinPosition, int16_t newMaxPosition);
170 uint8_t setControlSystem(uint8_t ID, uint16_t kProportionnal, uint16_t kDerivative, uint16_t kInteger, uint16_t feedforwardGain1, uint16_t feedforwardGain2);
185 uint8_t setErrorsCheckPeriod(uint8_t ID, uint16_t LEDBlink, uint16_t ADCFault, uint16_t packetGarbage, uint16_t stopDetection, uint16_t overloadDetection);
197 uint8_t setInPositionCriteria(uint8_t ID, uint16_t stopThreshold, uint16_t inPositionMargin);
230 uint8_t clearStatus(uint8_t ID);
242 uint8_t factoryReset(uint8_t ID,
boolean IDskip,
boolean baudrateSkip);
252 uint8_t reboot(uint8_t ID){
254 errorPrint(F(
"reboot > Input not correct"));
257 return _herkXCom.rebootRequest(ID);
281 uint8_t
getServoInfo(uint8_t ID, HkxMaybe<uint16_t> model, HkxMaybe<uint16_t> version);
324 uint8_t
setID(uint8_t ID, uint8_t newID);
338 uint8_t
getPolicies(uint8_t ID, HkxMaybe<uint8_t> newAlarmLEDPolicy, HkxMaybe<uint8_t> newTorquePolicy);
358 uint8_t
setOnePolicies(uint8_t ID, uint8_t newAlarmLEDPolicy, uint8_t newTorquePolicy){
360 errorPrint(F(
"setOnePolicies > Input not correct"));
363 return setPolicies(ID, newAlarmLEDPolicy, newTorquePolicy);
383 uint8_t
setAllPolicies(uint8_t newAlarmLEDPolicy, uint8_t newTorquePolicy){
return setPolicies(HKX_ID_ALL, newAlarmLEDPolicy, newTorquePolicy);};
398 uint8_t
getTemperatureVoltage(uint8_t ID, HkxMaybe<int16_t> maxTemp, HkxMaybe<uint16_t> minVoltage, HkxMaybe<uint16_t> maxVoltage);
413 errorPrint(F(
"setOneMaxTemperature > Input value not correct"));
416 return setTemperatureVoltage(ID, newMaxTemp, newMinVoltage, newMaxVoltage);
429 uint8_t
setAllTemperatureVoltage(int16_t newMaxTemp, int16_t newMinVoltage, int16_t newMaxVoltage){
return setTemperatureVoltage(HKX_ID_ALL, newMaxTemp, newMinVoltage, newMaxVoltage);};
457 uint8_t
getAcceleration(uint8_t ID, HkxMaybe<uint8_t> accelerationRatio, HkxMaybe<uint16_t> maxAccelerationTime);
485 uint8_t
setOneAcceleration(uint8_t ID, uint8_t newAccelerationRatio, uint16_t newMaxAccelerationTime){
487 errorPrint(F(
"setOneAcceleration > acceleration ratio value or max acceleration time not correct"));
490 return setAcceleration(ID, newAccelerationRatio, newMaxAccelerationTime);
516 uint8_t
setAllAcceleration(uint8_t newAccelerationRatio, uint16_t newMaxAccelerationTime){
return setAcceleration(HKX_ID_ALL, newAccelerationRatio, newMaxAccelerationTime);};
550 uint8_t
getLoadControl(uint8_t ID, HkxMaybe<uint16_t> deadZone, HkxMaybe<uint8_t> saturatorOffSet, HkxMaybe<uint32_t> saturatorSlope, HkxMaybe<int8_t> PWMoffset, HkxMaybe<uint8_t> minPWM, HkxMaybe<uint16_t> maxPWM);
582 uint8_t
setOneLoadControl(uint8_t ID, uint16_t newDeadZone, uint8_t newSaturatorOffset,
const uint32_t& newSaturatorSlope, int8_t newPWMOffset, uint8_t newMinPWM, uint16_t newMaxPWM){
584 errorPrint(F(
"setOneLoadControl > Input not correct"));
587 return setLoadControl(ID, newDeadZone, newSaturatorOffset, newSaturatorSlope, newPWMOffset, newMinPWM, newMaxPWM);
619 uint8_t
setAllLoadControl(uint16_t newDeadZone, uint8_t newSaturatorOffset,
const uint32_t& newSaturatorSlope, int8_t newPWMOffset, uint8_t newMinPWM, uint16_t newMaxPWM){
return setLoadControl(HKX_ID_ALL, newDeadZone, newSaturatorOffset, newSaturatorSlope, newPWMOffset, newMinPWM, newMaxPWM);};
634 uint8_t
getPWMPositionLimits(uint8_t ID, HkxMaybe<uint16_t> overlaodPWMThreshold, HkxMaybe<int16_t> minPosition, HkxMaybe<int16_t> maxPosition);
647 uint8_t
setOnePWMPositionLimits(uint8_t ID, uint16_t newOverlaodPWMThreshold, int16_t newMinPosition, int16_t newMaxPosition){
649 errorPrint(F(
"setOnePWMPositionLimits > Input not correct"));
652 return setPWMPositionLimits(ID, newOverlaodPWMThreshold, newMinPosition, newMaxPosition);
665 uint8_t
setAllPWMPositionLimits(uint16_t newOverlaodPWMThreshold, int16_t newMinPosition, int16_t newMaxPosition){
return setPWMPositionLimits(HKX_ID_ALL, newOverlaodPWMThreshold, newMinPosition, newMaxPosition);};
682 uint8_t
getControlSystem(uint8_t ID, HkxMaybe<uint16_t> kProportionnal, HkxMaybe<uint16_t> kDerivative, HkxMaybe<uint16_t> kInteger, HkxMaybe<uint16_t> feedforwardGain1, HkxMaybe<uint16_t> feedforwardGain2);
697 uint8_t
setOneControlSystem(uint8_t ID, uint16_t kProportionnal, uint16_t kDerivative, uint16_t kInteger, uint16_t feedforwardGain1, uint16_t feedforwardGain2){
699 errorPrint(F(
"setOneControlSystem > Input not correct"));
702 return setControlSystem(ID, kProportionnal, kDerivative, kInteger, feedforwardGain1, feedforwardGain2);
717 uint8_t
setAllControlSystem(uint16_t kProportionnal, uint16_t kDerivative, uint16_t kInteger, uint16_t feedforwardGain1, uint16_t feedforwardGain2){
return setControlSystem(HKX_ID_ALL, kProportionnal, kDerivative, kInteger, feedforwardGain1, feedforwardGain2);};
734 uint8_t
getErrorsCheckPeriod(uint8_t ID, HkxMaybe<uint16_t> LEDBlink, HkxMaybe<uint16_t> ADCFault, HkxMaybe<uint16_t> packetGarbage, HkxMaybe<uint16_t> stopDetection, HkxMaybe<uint16_t> overloadDetection);
749 uint8_t
setOneErrorsCheckPeriod(uint8_t ID, uint16_t LEDBlink, uint16_t ADCFault, uint16_t packetGarbage, uint16_t stopDetection, uint16_t overloadDetection){
751 errorPrint(F(
"setOneErrorsCheckPeriod > Input not correct"));
754 return setErrorsCheckPeriod(ID, LEDBlink, ADCFault, packetGarbage, stopDetection, overloadDetection);
769 uint8_t
setAllErrorsCheckPeriod(uint16_t LEDBlink, uint16_t ADCFault, uint16_t packetGarbage, uint16_t stopDetection, uint16_t overloadDetection){
return setErrorsCheckPeriod(HKX_ID_ALL, LEDBlink, ADCFault, packetGarbage, stopDetection, overloadDetection);};
783 uint8_t
getInPositionCriteria(uint8_t ID, HkxMaybe<uint16_t> stopThreshold, HkxMaybe<uint16_t> inPositionMargin);
797 errorPrint(F(
"setOneInPositionCriteria > Input not correct"));
800 return setInPositionCriteria(ID, stopThreshold, inPositionMargin);
812 uint8_t
setAllInPositionCriteria(uint16_t stopThreshold, uint16_t inPositionMargin){
return setInPositionCriteria(HKX_ID_ALL, stopThreshold, inPositionMargin);};
826 uint8_t
getTorqueLEDControl(uint8_t ID, HkxMaybe<hkxTorqueControl> torqueControl, HkxMaybe<hkxLEDControl> LEDControl);
851 errorPrint(F(
"setOneTorqueLEDControl > Input not correct"));
854 return setTorqueLEDControl(ID, newTorqueControl, newLEDControl);
899 uint8_t
getBehaviour(uint8_t ID, HkxMaybe<uint16_t> voltage, HkxMaybe<uint16_t> temperature, HkxMaybe<hkxControlMode> controlMode, HkxMaybe<uint16_t> tick, HkxMaybe<int16_t> absolutePosition, HkxMaybe<int16_t> velocity, HkxMaybe<int16_t> PWM, HkxMaybe<int16_t> absoluteGoalPosition, HkxMaybe<int16_t> absoluteDesiredTrajectoryPosition, HkxMaybe<int16_t> desiredVelocity);
924 errorPrint(F(
"clearOneStatus > Input not correct"));
927 return clearStatus(ID);
963 errorPrint(F(
"factoryResetOne > Input not correct"));
966 return factoryReset(ID, IDskip, baudrateSkip);
978 uint8_t
factoryResetAll(
boolean IDskip,
boolean baudrateSkip){
return factoryReset(HKX_ID_ALL, IDskip, baudrateSkip);};
990 errorPrint(F(
"rebootOne > Input not correct"));
1004 #endif // _HKXSETUP_H
uint8_t getTorqueLEDControl(uint8_t ID, HkxMaybe< hkxTorqueControl > torqueControl, HkxMaybe< hkxLEDControl > LEDControl)
Get torque actuation and LED colour.
Definition: HkxSetup.cpp:417
uint8_t getLoadControl(uint8_t ID, HkxMaybe< uint16_t > deadZone, HkxMaybe< uint8_t > saturatorOffSet, HkxMaybe< uint32_t > saturatorSlope, HkxMaybe< int8_t > PWMoffset, HkxMaybe< uint8_t > minPWM, HkxMaybe< uint16_t > maxPWM)
Get load control.
Definition: HkxSetup.cpp:202
uint8_t setOneTorqueLEDControl(uint8_t ID, hkxTorqueControl newTorqueControl, hkxLEDControl newLEDControl)
Set torque actuation and LED colour.
Definition: HkxSetup.h:849
uint8_t setAllLoadControl(uint16_t newDeadZone, uint8_t newSaturatorOffset, const uint32_t &newSaturatorSlope, int8_t newPWMOffset, uint8_t newMinPWM, uint16_t newMaxPWM)
Set load control parameters for all.
Definition: HkxSetup.h:619
void warningPrint(const String &message) const
Print warning.
Definition: HkxCommunication.h:394
uint8_t setOnePWMPositionLimits(uint8_t ID, uint16_t newOverlaodPWMThreshold, int16_t newMinPosition, int16_t newMaxPosition)
Set PWM and position limits.
Definition: HkxSetup.h:647
HkxCommunication & _herkXCom
Definition: HkxSetup.h:24
uint8_t setOneLoadControl(uint8_t ID, uint16_t newDeadZone, uint8_t newSaturatorOffset, const uint32_t &newSaturatorSlope, int8_t newPWMOffset, uint8_t newMinPWM, uint16_t newMaxPWM)
Set load control parameters.
Definition: HkxSetup.h:582
void scanIDs(boolean IDs[])
Scan IDs.
Definition: HkxSetup.cpp:524
uint8_t setOnePolicies(uint8_t ID, uint8_t newAlarmLEDPolicy, uint8_t newTorquePolicy)
Set policies.
Definition: HkxSetup.h:358
uint8_t setOneTemperatureVoltage(uint8_t ID, int16_t newMaxTemp, uint16_t newMinVoltage, uint16_t newMaxVoltage)
Set temperature and voltage.
Definition: HkxSetup.h:411
void errorPrint(const String &message) const
Print error.
Definition: HkxCommunication.h:381
uint8_t setID(uint8_t ID, uint8_t newID)
Set ID.
Definition: HkxSetup.cpp:75
uint8_t setAllInPositionCriteria(uint16_t stopThreshold, uint16_t inPositionMargin)
Set in position criteria for all.
Definition: HkxSetup.h:812
uint8_t getStatus(uint8_t ID, HkxStatus &statusED)
Get status.
Definition: HkxSetup.cpp:490
uint8_t clearAllStatus()
Clear status for all.
Definition: HkxSetup.h:937
uint8_t factoryResetAll(boolean IDskip, boolean baudrateSkip)
Factory reset for all.
Definition: HkxSetup.h:978
hkxBaudrate
Baud rate.
Definition: HkxCommunication.h:109
hkxTorqueControl
Torque control.
Definition: HkxCommunication.h:127
uint8_t clearOneStatus(uint8_t ID)
Clear status.
Definition: HkxSetup.h:922
Class to manage the communication.
Definition: HkxCommunication.h:636
Class to manage the status of the servos.
Definition: HkxStatus.h:55
uint8_t setOneAcceleration(uint8_t ID, uint8_t newAccelerationRatio, uint16_t newMaxAccelerationTime)
Set Acceleration.
Definition: HkxSetup.h:485
uint8_t getPolicies(uint8_t ID, HkxMaybe< uint8_t > newAlarmLEDPolicy, HkxMaybe< uint8_t > newTorquePolicy)
Get Policies.
Definition: HkxSetup.cpp:94
uint8_t setAllErrorsCheckPeriod(uint16_t LEDBlink, uint16_t ADCFault, uint16_t packetGarbage, uint16_t stopDetection, uint16_t overloadDetection)
Set check periods for all.
Definition: HkxSetup.h:769
uint8_t setAllAcceleration(uint8_t newAccelerationRatio, uint16_t newMaxAccelerationTime)
Set Acceleration for all.
Definition: HkxSetup.h:516
uint8_t getAcceleration(uint8_t ID, HkxMaybe< uint8_t > accelerationRatio, HkxMaybe< uint16_t > maxAccelerationTime)
Get Acceleration.
Definition: HkxSetup.cpp:164
uint8_t setAllTemperatureVoltage(int16_t newMaxTemp, int16_t newMinVoltage, int16_t newMaxVoltage)
Set temperature and voltage for all.
Definition: HkxSetup.h:429
uint8_t getPWMPositionLimits(uint8_t ID, HkxMaybe< uint16_t > overlaodPWMThreshold, HkxMaybe< int16_t > minPosition, HkxMaybe< int16_t > maxPosition)
Get PWM and position limits.
Definition: HkxSetup.cpp:251
uint8_t getBehaviour(uint8_t ID, HkxMaybe< uint16_t > voltage, HkxMaybe< uint16_t > temperature, HkxMaybe< hkxControlMode > controlMode, HkxMaybe< uint16_t > tick, HkxMaybe< int16_t > absolutePosition, HkxMaybe< int16_t > velocity, HkxMaybe< int16_t > PWM, HkxMaybe< int16_t > absoluteGoalPosition, HkxMaybe< int16_t > absoluteDesiredTrajectoryPosition, HkxMaybe< int16_t > desiredVelocity)
Get behaviour.
Definition: HkxSetup.cpp:451
uint8_t getBaudRate(uint8_t ID, hkxBaudrate *baudRate)
Get the baud rate.
Definition: HkxSetup.cpp:38
hkxLEDControl
LED control.
Definition: HkxCommunication.h:146
uint8_t getErrorsCheckPeriod(uint8_t ID, HkxMaybe< uint16_t > LEDBlink, HkxMaybe< uint16_t > ADCFault, HkxMaybe< uint16_t > packetGarbage, HkxMaybe< uint16_t > stopDetection, HkxMaybe< uint16_t > overloadDetection)
Get check periods.
Definition: HkxSetup.cpp:334
uint8_t setOneControlSystem(uint8_t ID, uint16_t kProportionnal, uint16_t kDerivative, uint16_t kInteger, uint16_t feedforwardGain1, uint16_t feedforwardGain2)
Set Control System.
Definition: HkxSetup.h:697
uint8_t rebootOne(uint8_t ID)
Reboot.
Definition: HkxSetup.h:988
uint8_t getControlSystem(uint8_t ID, HkxMaybe< uint16_t > kProportionnal, HkxMaybe< uint16_t > kDerivative, HkxMaybe< uint16_t > kInteger, HkxMaybe< uint16_t > feedforwardGain1, HkxMaybe< uint16_t > feedforwardGain2)
Get Control System.
Definition: HkxSetup.cpp:291
Class to manage the print of the messages.
Definition: HkxCommunication.h:278
uint8_t setOneErrorsCheckPeriod(uint8_t ID, uint16_t LEDBlink, uint16_t ADCFault, uint16_t packetGarbage, uint16_t stopDetection, uint16_t overloadDetection)
Set check periods.
Definition: HkxSetup.h:749
uint8_t setAllPWMPositionLimits(uint16_t newOverlaodPWMThreshold, int16_t newMinPosition, int16_t newMaxPosition)
Set PWM and position limits for all.
Definition: HkxSetup.h:665
void rebootAll()
Reboot.
Definition: HkxSetup.h:1000
HkxPrint & _print
Definition: HkxSetup.h:26
void infoPrint(const String &message) const
Print info.
Definition: HkxCommunication.h:407
uint8_t setAllPolicies(uint8_t newAlarmLEDPolicy, uint8_t newTorquePolicy)
Set policies for all.
Definition: HkxSetup.h:383
uint8_t setAllBaudRate(const hkxBaudrate &baudrate)
Set the baud rate for all.
Definition: HkxSetup.cpp:60
HkxSetup(HkxCommunication &herkXCom, HkxPrint &print)
Constructor.
Definition: HkxSetup.h:267
uint8_t getServoInfo(uint8_t ID, HkxMaybe< uint16_t > model, HkxMaybe< uint16_t > version)
Get model and firmware.
Definition: HkxSetup.cpp:13
uint8_t setOneInPositionCriteria(uint8_t ID, uint16_t stopThreshold, uint16_t inPositionMargin)
Set in position criteria.
Definition: HkxSetup.h:795
uint8_t getInPositionCriteria(uint8_t ID, HkxMaybe< uint16_t > stopThreshold, HkxMaybe< uint16_t > inPositionMargin)
Get in position criteria.
Definition: HkxSetup.cpp:380
uint8_t setAllControlSystem(uint16_t kProportionnal, uint16_t kDerivative, uint16_t kInteger, uint16_t feedforwardGain1, uint16_t feedforwardGain2)
Set Control System for all.
Definition: HkxSetup.h:717
Communication management of the Arduino library for HerkuleX servo (DRS-0101 and DRS-0201 models) ...
Class to setup the servos.
Definition: HkxSetup.h:21
uint8_t factoryResetOne(uint8_t ID, boolean IDskip, boolean baudrateSkip)
Factory reset.
Definition: HkxSetup.h:961
uint8_t getTemperatureVoltage(uint8_t ID, HkxMaybe< int16_t > maxTemp, HkxMaybe< uint16_t > minVoltage, HkxMaybe< uint16_t > maxVoltage)
Get temperature and voltage.
Definition: HkxSetup.cpp:128
uint8_t setAllTorqueLEDControl(hkxTorqueControl newTorqueControl, hkxLEDControl newLEDControl)
Set torque actuation and LED colour for all.
Definition: HkxSetup.h:877