The base class to control the SCHUNK Dexterous Hand. More...
#include <sdhbase.h>
Public Types | |
enum | { All = -1 } |
Anonymous enum (instead of define like macros) More... | |
enum | eControllerType { eCT_INVALID = -1, eCT_POSE = 0, eCT_VELOCITY, eCT_VELOCITY_ACCELERATION, eCT_DIMENSION } |
An enum for all possible SDH internal controller types (order must match that in the SDH firmware in inc/sdh2.h) More... | |
enum | eErrorCode { eEC_SUCCESS = 0, eEC_NOT_AVAILABLE, eEC_NOT_INITIALIZED, eEC_ALREADY_RUNNING, eEC_FEATURE_NOT_SUPPORTED, eEC_INCONSISTENT_DATA, eEC_TIMEOUT, eEC_READ_ERROR, eEC_WRITE_ERROR, eEC_INSUFFICIENT_RESOURCES, eEC_CHECKSUM_ERROR, eEC_NOT_ENOUGH_PARAMS, eEC_NO_PARAMS_EXPECTED, eEC_CMD_UNKNOWN, eEC_CMD_FORMAT_ERROR, eEC_ACCESS_DENIED, eEC_ALREADY_OPEN, eEC_CMD_FAILED, eEC_CMD_ABORTED, eEC_INVALID_HANDLE, eEC_DEVICE_NOT_FOUND, eEC_DEVICE_NOT_OPENED, eEC_IO_ERROR, eEC_INVALID_PARAMETER, eEC_RANGE_ERROR, eEC_NO_DATAPIPE, eEC_INDEX_OUT_OF_BOUNDS, eEC_HOMING_ERROR, eEC_AXIS_DISABLED, eEC_OVER_TEMPERATURE, eEC_MAX_COMMANDS_EXCEEDED, eEC_INVALID_PASSWORD, eEC_MAX_COMMANDLINE_EXCEEDED, eEC_CRC_ERROR, eEC_NO_COMMAND, eEC_INTERNAL, eEC_UNKNOWN_ERROR, eEC_DIMENSION } |
enum | eGraspId { eGID_INVALID = -1, eGID_CENTRICAL = 0, eGID_PARALLEL = 1, eGID_CYLINDRICAL = 2, eGID_SPHERICAL = 3, eGID_DIMENSION } |
The enum values of the known grasps. More... | |
enum | eVelocityProfile { eVP_INVALID = -1, eVP_SIN_SQUARE, eVP_RAMP, eVP_DIMENSION } |
An enum for all possible SDH internal velocity profile types. More... | |
Public Member Functions | |
void | CheckIndex (int index, int maxindex, char const *name="") throw (cSDHErrorInvalidParameter*) |
Check if index is in [0 .. maxindex-1] or All. Throw a cSDHErrorInvalidParameter exception if not. | |
void | CheckRange (double value, double minvalue, double maxvalue, char const *name="") throw (cSDHErrorInvalidParameter*) |
Check if value is in [minvalue .. maxvalue]. Throw a cSDHErrorInvalidParameter exception if not. | |
void | CheckRange (double *values, double *minvalues, double *maxvalues, char const *name="") throw (cSDHErrorInvalidParameter*) |
Check if any value[i] in array values is in [minvalue[i] .. maxvalue[i]]. Throw a cSDHErrorInvalidParameter exception if not. | |
cSDHBase (int debug_level) | |
double | GetEps (void) |
Return the eps value. | |
cSimpleVector const & | GetEpsVector (void) |
Return simple vector of number of axes epsilon values. | |
eErrorCode | GetFirmwareState (void) |
Return the last known state of the SDH firmware. | |
int | GetNumberOfAxes (void) |
Return the number of axes of the SDH. | |
int | GetNumberOfFingers (void) |
Return the number of fingers of the SDH. | |
int | GetNumberOfTemperatureSensors (void) |
Return the number of temperature sensors of the SDH. | |
virtual bool | IsOpen (void)=0 |
Return true if connection to SDH firmware/hardware is open. | |
virtual void | SetDebugOutput (std::ostream *debuglog) |
change the stream to use for debug messages | |
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. | |
static char const * | GetStringFromErrorCode (eErrorCode error_code) |
Return a ptr to a (static) string describing error code error_code. | |
static char const * | GetStringFromGraspId (eGraspId grasp_id) |
Return a ptr to a (static) string describing grasp id grasp_id. | |
Protected Attributes | |
int | all_axes_used |
Bit field with the bits for all axes set. | |
cDBG | cdbg |
debug stream to print colored debug messages | |
int | debug_level |
debug level of this object | |
double | eps |
epsilon value (max absolute deviation of reported values from actual hardware values) (needed since SDH firmware limits number of digits reported) | |
cSimpleVector | eps_v |
simple vector of 7 epsilon values | |
eErrorCode | firmware_state |
the last known state of the SDH firmware | |
cSimpleVector | max_angle_v |
Maximum allowed axis angles (in internal units (degrees)) | |
cSimpleVector | min_angle_v |
simple vector of 7 0 values ??? | |
int | NUMBER_OF_AXES |
The number of axes. | |
int | NUMBER_OF_FINGERS |
The number of fingers. | |
int | NUMBER_OF_TEMPERATURE_SENSORS |
The number of temperature sensors. | |
Static Protected Attributes | |
static char const * | controller_type_name [] |
A mapping from eControllerType controller type enums to strings with human readable controller type names. | |
static char const * | firmware_error_codes [] |
A mapping from eErrorCode error code enums to strings with human readable error messages. | |
static char const * | grasp_id_name [] |
A mapping from eGraspId grasp id enums to strings with human readable grasp id names. |
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)
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.
|
virtual cSDHBase::~cSDHBase | ( | ) | [inline, virtual] |
void cSDHBase::CheckIndex | ( | int | index, |
int | maxindex, | ||
char const * | name = "" |
||
) | throw (cSDHErrorInvalidParameter*) |
Check if index is in [0 .. maxindex-1] or All. Throw a cSDHErrorInvalidParameter exception if not.
void cSDHBase::CheckRange | ( | double | value, |
double | minvalue, | ||
double | maxvalue, | ||
char const * | name = "" |
||
) | throw (cSDHErrorInvalidParameter*) |
Check if value is in [minvalue .. maxvalue]. Throw a cSDHErrorInvalidParameter exception if not.
void cSDHBase::CheckRange | ( | double * | values, |
double * | minvalues, | ||
double * | maxvalues, | ||
char const * | name = "" |
||
) | throw (cSDHErrorInvalidParameter*) |
Check if any value[i] in array values is in [minvalue[i] .. maxvalue[i]]. Throw a cSDHErrorInvalidParameter exception if not.
double cSDHBase::GetEps | ( | void | ) |
Return the eps value.
cSimpleVector const& cSDHBase::GetEpsVector | ( | void | ) |
Return simple vector of number of axes epsilon values.
eErrorCode cSDHBase::GetFirmwareState | ( | void | ) |
Return the last known state of the SDH firmware.
int cSDHBase::GetNumberOfAxes | ( | void | ) |
Return the number of axes of the SDH.
int cSDHBase::GetNumberOfFingers | ( | void | ) |
Return the number of fingers of the SDH.
int cSDHBase::GetNumberOfTemperatureSensors | ( | void | ) |
Return the number of temperature sensors of the SDH.
static char const* cSDHBase::GetStringFromControllerType | ( | eControllerType | controller_type | ) | [static] |
Return a ptr to a (static) string describing controller type controller_Type.
static char const* cSDHBase::GetStringFromErrorCode | ( | eErrorCode | error_code | ) | [static] |
Return a ptr to a (static) string describing error code error_code.
static char const* cSDHBase::GetStringFromGraspId | ( | eGraspId | grasp_id | ) | [static] |
Return a ptr to a (static) string describing grasp id grasp_id.
virtual bool cSDHBase::IsOpen | ( | void | ) | [pure virtual] |
Return true if connection to SDH firmware/hardware is open.
Implemented in cSDH, and cSDHSerial.
virtual void cSDHBase::SetDebugOutput | ( | std::ostream * | debuglog | ) | [inline, virtual] |
int cSDHBase::all_axes_used [protected] |
cDBG cSDHBase::cdbg [protected] |
char const* cSDHBase::controller_type_name[] [static, protected] |
A mapping from eControllerType controller type enums to strings with human readable controller type names.
int cSDHBase::debug_level [protected] |
double cSDHBase::eps [protected] |
cSimpleVector cSDHBase::eps_v [protected] |
char const* cSDHBase::firmware_error_codes[] [static, protected] |
A mapping from eErrorCode error code enums to strings with human readable error messages.
eErrorCode cSDHBase::firmware_state [protected] |
char const* cSDHBase::grasp_id_name[] [static, protected] |
cSimpleVector cSDHBase::max_angle_v [protected] |
cSimpleVector cSDHBase::min_angle_v [protected] |
int cSDHBase::NUMBER_OF_AXES [protected] |
int cSDHBase::NUMBER_OF_FINGERS [protected] |
int cSDHBase::NUMBER_OF_TEMPERATURE_SENSORS [protected] |