The base class to control the SCHUNK Dexterous Hand. More...
#include <sdhbase.h>
Public Member Functions | |
void | CheckIndex (int index, int maxindex, char const *name="") |
Check if index is in [0 .. maxindex-1] or All. Throw a cSDHErrorInvalidParameter exception if not. More... | |
void | CheckRange (double *values, double *minvalues, double *maxvalues, char const *name="") |
Check if any value[i] in array values is in [minvalue[i] .. maxvalue[i]]. Throw a cSDHErrorInvalidParameter exception if not. More... | |
void | CheckRange (double value, double minvalue, double maxvalue, char const *name="") |
Check if value is in [minvalue .. maxvalue]. Throw a cSDHErrorInvalidParameter exception if not. More... | |
cSDHBase (int debug_level) | |
double | GetEps (void) |
Return the eps value. More... | |
const cSimpleVector & | GetEpsVector (void) |
Return simple vector of number of axes epsilon values. More... | |
eErrorCode | GetFirmwareState (void) |
Return the last known state of the SDH firmware. More... | |
int | GetNumberOfAxes (void) |
Return the number of axes of the SDH. More... | |
int | GetNumberOfFingers (void) |
Return the number of fingers of the SDH. More... | |
int | GetNumberOfTemperatureSensors (void) |
Return the number of temperature sensors of the SDH. More... | |
virtual bool | IsOpen (void)=0 |
Return true if connection to SDH firmware/hardware is open. More... | |
virtual void | SetDebugOutput (std::ostream *debuglog) |
change the stream to use for debug messages More... | |
virtual | ~cSDHBase () |
Static Public Member Functions | |
static char const * | GetStringFromControllerType (eControllerType controller_type) |
Return a ptr to a (static) string describing controller type controller_Type. More... | |
static char const * | GetStringFromErrorCode (eErrorCode error_code) |
Return a ptr to a (static) string describing error code error_code. More... | |
static char const * | GetStringFromGraspId (eGraspId grasp_id) |
Return a ptr to a (static) string describing grasp id grasp_id. More... | |
Protected Attributes | |
int | all_axes_used |
Bit field with the bits for all axes set. More... | |
cDBG | cdbg |
debug stream to print colored debug messages More... | |
int | debug_level |
debug level of this object More... | |
double | eps |
epsilon value (max absolute deviation of reported values from actual hardware values) (needed since SDH firmware limits number of digits reported) More... | |
cSimpleVector | eps_v |
simple vector of 7 epsilon values More... | |
eErrorCode | firmware_state |
the last known state of the SDH firmware More... | |
cSimpleVector | max_angle_v |
Maximum allowed axis angles (in internal units (degrees)) More... | |
cSimpleVector | min_angle_v |
simple vector of 7 0 values ??? More... | |
int | NUMBER_OF_AXES |
The number of axes. More... | |
int | NUMBER_OF_FINGERS |
The number of fingers. More... | |
int | NUMBER_OF_TEMPERATURE_SENSORS |
The number of temperature sensors. More... | |
Static Protected Attributes | |
static char const * | controller_type_name [] |
A mapping from eControllerType controller type enums to strings with human readable controller type names. More... | |
static char const * | firmware_error_codes [] |
A mapping from eErrorCode error code enums to strings with human readable error messages. More... | |
static char const * | grasp_id_name [] |
A mapping from eGraspId grasp id enums to strings with human readable grasp id names. More... | |
The base class to control the SCHUNK Dexterous Hand.
End-Users should NOT use this class directly, as it only provides some common settings and no function interface. End users should use the class cSDH instead, as it provides the end-user functions to control the SDH.
anonymous enum |
An enum for all possible SDH internal controller types (order must match that in the SDH firmware in inc/sdh2.h)
Enumerator | |
---|---|
eCT_INVALID | invalid controller_type (needed for cSDHSerial::con() to indicate "read current controller type") |
eCT_POSE | coordinated position controller (position per axis => "pose controller"), all axes start and stop moving at the same time |
eCT_VELOCITY | velocity controller, velocities of axes are controlled independently (not implemented in SDH firmwares up to and including 0.0.2.5) |
eCT_VELOCITY_ACCELERATION | velocity controller with acceleration ramp, velocities and accelerations of axes are controlled independently (not implemented in SDH firmwares up to and including 0.0.2.5) |
eCT_DIMENSION | Endmarker and dimension. |
enum cSDHBase::eErrorCode |
The error codes of the SDH firmware
enum cSDHBase::eGraspId |
An enum for all possible SDH internal velocity profile types.
cSDHBase::cSDHBase | ( | int | debug_level | ) |
Constructor of cSDHBase class, initilize internal variables and settings
debug_level | : debug level of the created object. If the debug_level of an object is > 0 then it will output debug messages.
|
Definition at line 137 of file sdhbase.cpp.
|
inlinevirtual |
void cSDHBase::CheckIndex | ( | int | index, |
int | maxindex, | ||
char const * | name = "" |
||
) |
Check if index is in [0 .. maxindex-1] or All. Throw a cSDHErrorInvalidParameter exception if not.
Definition at line 169 of file sdhbase.cpp.
void cSDHBase::CheckRange | ( | double * | values, |
double * | minvalues, | ||
double * | maxvalues, | ||
char const * | name = "" |
||
) |
Check if any value[i] in array values is in [minvalue[i] .. maxvalue[i]]. Throw a cSDHErrorInvalidParameter exception if not.
Definition at line 185 of file sdhbase.cpp.
void cSDHBase::CheckRange | ( | double | value, |
double | minvalue, | ||
double | maxvalue, | ||
char const * | name = "" |
||
) |
Check if value is in [minvalue .. maxvalue]. Throw a cSDHErrorInvalidParameter exception if not.
Definition at line 177 of file sdhbase.cpp.
double cSDHBase::GetEps | ( | void | ) |
Return the eps value.
Definition at line 254 of file sdhbase.cpp.
const cSimpleVector & cSDHBase::GetEpsVector | ( | void | ) |
Return simple vector of number of axes epsilon values.
Definition at line 261 of file sdhbase.cpp.
cSDHBase::eErrorCode cSDHBase::GetFirmwareState | ( | void | ) |
Return the last known state of the SDH firmware.
Definition at line 247 of file sdhbase.cpp.
int cSDHBase::GetNumberOfAxes | ( | void | ) |
Return the number of axes of the SDH.
Definition at line 226 of file sdhbase.cpp.
int cSDHBase::GetNumberOfFingers | ( | void | ) |
Return the number of fingers of the SDH.
Definition at line 233 of file sdhbase.cpp.
int cSDHBase::GetNumberOfTemperatureSensors | ( | void | ) |
Return the number of temperature sensors of the SDH.
Definition at line 240 of file sdhbase.cpp.
|
static |
Return a ptr to a (static) string describing controller type controller_Type.
Definition at line 216 of file sdhbase.cpp.
|
static |
Return a ptr to a (static) string describing error code error_code.
Definition at line 196 of file sdhbase.cpp.
|
static |
Return a ptr to a (static) string describing grasp id grasp_id.
Definition at line 206 of file sdhbase.cpp.
|
pure virtual |
Return true if connection to SDH firmware/hardware is open.
Implemented in cSDH, and cSDHSerial.
|
inlinevirtual |
|
protected |
|
protected |
|
staticprotected |
A mapping from eControllerType controller type enums to strings with human readable controller type names.
|
protected |
|
protected |
|
protected |
|
staticprotected |
A mapping from eErrorCode error code enums to strings with human readable error messages.
|
protected |
|
staticprotected |
A mapping from eGraspId grasp id enums to strings with human readable grasp id names.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |