HerkuleXLib  1.2
Arduino library to drive HerkuleX DRS-0101 and DRS-0201
/home/benoit/sketchbook/libraries/HerkuleXLib/HkxGroupPosControl.h
Go to the documentation of this file.
1 #ifndef _HKXGROUPPOSCONTROL_H
2 #define _HKXGROUPPOSCONTROL_H
3 
13 #include "HkxPosControl.h"
14 
21 private:
25  const uint8_t _length;
32  const String _className;
33 
34 
40  void errorPrint(const String& message){if(_print._errorMessages){_print.errorPrint(_className + message);}};
41 
47  void warningPrint(const String& message){if(_print._errorMessages){_print.warningPrint(_className + message);}};
48 
54  void infoPrint(const String& message){if(_print._errorMessages){_print.infoPrint(_className + message);}};
57 public:
68  HkxGroupPosControl(uint8_t length, HkxPosControl* arrayServos[], HkxPrint& print);
69 
77  HkxPosControl& getServo(uint8_t number){if(number < _length){return *_servos[number];}};
78 
84  uint8_t getNbServos(){return this->_length;};
85 
116  uint8_t setAllLoad(uint16_t newDeadZone, uint8_t newSaturatorOffset, const uint32_t& newSaturatorSlope, int8_t newPWMOffset, uint8_t newMinPWM, uint16_t newMaxPWM);
117 
118 
140  uint8_t setAllTorqueLEDControl(HkxMaybe<hkxTorqueControl> newTorqueControl, HkxMaybe<hkxLEDControl> newLEDControl);
141 
164  uint8_t moveSyncAllPosition(int16_t destinationAngle[], uint16_t playTime, HkxMaybe<hkxLEDControl> LEDControl[], bool waitStop);
165 
188  uint8_t moveAsyncAllPosition(int16_t destinationAngle[], uint16_t playTime[], HkxMaybe<hkxLEDControl> LEDControl[], bool waitStop);
189 
190 
195  void rebootAll(){
196  for(int i=0 ; i < this->_length ; i++){
197  this->_servos[i]->reboot();
198  }
199  };
200 };
201 
202 #endif // _HKXGROUPPOSCONTROL_H
203 
HkxPrint & _print
Definition: HkxGroupPosControl.h:29
uint8_t reboot()
Reboot servo.
Definition: HkxPosControl.cpp:361
void warningPrint(const String &message) const
Print warning.
Definition: HkxCommunication.h:394
void errorPrint(const String &message) const
Print error.
Definition: HkxCommunication.h:381
uint8_t getNbServos()
Get number of servos.
Definition: HkxGroupPosControl.h:84
Servo position control of the Arduino library for HerkuleX servo (DRS-0101 and DRS-0201 models) ...
uint8_t setAllTorqueLEDControl(HkxMaybe< hkxTorqueControl > newTorqueControl, HkxMaybe< hkxLEDControl > newLEDControl)
Set torque actuation and LED colour.
Definition: HkxGroupPosControl.cpp:87
HkxGroupPosControl(uint8_t length, HkxPosControl *arrayServos[], HkxPrint &print)
Constructor.
Definition: HkxGroupPosControl.cpp:13
Class to manage the communication.
Definition: HkxCommunication.h:636
uint8_t moveSyncAllPosition(int16_t destinationAngle[], uint16_t playTime, HkxMaybe< hkxLEDControl > LEDControl[], bool waitStop)
Synchronous move position.
Definition: HkxGroupPosControl.cpp:123
uint8_t moveAsyncAllPosition(int16_t destinationAngle[], uint16_t playTime[], HkxMaybe< hkxLEDControl > LEDControl[], bool waitStop)
Asynchronous move position.
Definition: HkxGroupPosControl.cpp:215
uint8_t setAllLoad(uint16_t newDeadZone, uint8_t newSaturatorOffset, const uint32_t &newSaturatorSlope, int8_t newPWMOffset, uint8_t newMinPWM, uint16_t newMaxPWM)
Set load control parameters.
Definition: HkxGroupPosControl.cpp:52
Class to drive one servo in position control mode.
Definition: HkxPosControl.h:22
HkxPosControl & getServo(uint8_t number)
Get the nth servo.
Definition: HkxGroupPosControl.h:77
HkxCommunication & _herkXCom
Definition: HkxGroupPosControl.h:27
Class to drive a group of servos in position control mode.
Definition: HkxGroupPosControl.h:20
HkxPosControl ** _servos
Definition: HkxGroupPosControl.h:23
Class to manage the print of the messages.
Definition: HkxCommunication.h:278
void infoPrint(const String &message) const
Print info.
Definition: HkxCommunication.h:407
const uint8_t _length
Definition: HkxGroupPosControl.h:25
void rebootAll()
Reboot.
Definition: HkxGroupPosControl.h:195