70 "eEC_SUCCESS: No error",
71 "eEC_NOT_AVAILABLE: Service or data is not available",
72 "eEC_NOT_INITIALIZED: The device is not initialized",
73 "eEC_ALREADY_RUNNING: Data acquisition: the acquisition loop is already running",
74 "eEC_FEATUReEC_NOT_SUPPORTED: The asked feature is not supported",
75 "eEC_INCONSISTENT_DATA: One or more dependent parameters mismatch",
76 "eEC_TIMEOUT: Timeout error",
77 "eEC_READ_ERROR: Error while reading from a device",
78 "eEC_WRITE_ERROR: Error while writing to a device",
79 "eEC_INSUFFICIENT_RESOURCES: No memory available",
80 "eEC_CHECKSUM_ERROR: Checksum error",
81 "eEC_NOT_ENOUGH_PARAMS: Not enough parameters",
82 "eEC_NO_PARAMS_EXPECTED: No parameters expected",
83 "eEC_CMD_UNKNOWN: Unknown command",
84 "eEC_CMD_FORMAT_ERROR: Command format error",
85 "eEC_ACCESS_DENIED: Access denied",
86 "eEC_ALREADY_OPEN: Interface already open",
87 "eEC_CMD_FAILED: Command failed",
88 "eEC_CMD_ABORTED: Command aborted",
89 "eEC_INVALID_HANDLE: Invalid handle",
90 "eEC_DEVICE_NOT_FOUND: Device not found",
91 "eEC_DEVICE_NOT_OPENED: Device not open",
92 "eEC_IO_ERROR: General I/O-Error",
93 "eEC_INVALID_PARAMETER: Invalid parameter",
94 "eEC_RANGE_ERROR: Range error",
95 "eEC_NO_DATAPIPE: No datapipe was found to open the specified device path",
96 "eEC_INDEX_OUT_OF_BOUNDS: The passed index is out of bounds",
97 "eEC_HOMING_ERROR: Error while homing",
98 "eEC_AXIS_DISABLED: The selected axis is disabled",
99 "eEC_OVER_TEMPERATURE: Over-temperature",
100 "eEC_MAX_COMMANDS_EXCEEDED: E_MAX_COMMANDS_EXCEEDED: cannot add more than CI_MAX_COMMANDS to interpreter / POSCON_MAX_OSCILLOSCOPE parameters to oscilloscope",
101 "eEC_INVALID_PASSWORD: E_INVALID_PASSWORD: invalid password given for change user command",
102 "eEC_MAX_COMMANDLINE_EXCEEDEDE_COMMANDLINE_EXCEEDED: the command line given is too long",
103 "eEC_CRC_ERROR: Cyclic Redundancy Code error",
104 "eEC_NO_COMMAND: No command available",
106 "eEC_INTERNAL: internal error",
107 "eEC_UNKNOWN_ERROR: unknown error",
109 "eEC_DIMENSION: Number of error codes" 115 "eGID_CENTRICAL: centrical grasp",
116 "eGID_PARALLEL: parallel grasp",
117 "eGID_CYLINDRICAL: cylindrical grasp",
118 "eGID_SPHERICAL: spherecial grasp",
120 "eGID_DIMENSION: number of predefined grasp ids" 127 "eCT_POSE: position/pose controller coordinated",
128 "eCT_VELOCITY: velocity controller",
129 "eCT_VELOCITY_ACCELERATION: velocity with acceleration ramp controller",
133 "eCT_DIMENSION: number of controller types" 141 debug_level(_debug_level),
143 NUMBER_OF_FINGERS( 3 ),
144 NUMBER_OF_TEMPERATURE_SENSORS( 9 )
146 cdbg <<
"Constructing cSDHBASE object\n";
171 if (index < 0 || maxindex <= index)
179 if (!
InRange(value, minvalue, maxvalue) )
189 if (!
InRange(values[i],minvalues[i],maxvalues[i]) )
190 throw new cSDHErrorInvalidParameter(
cMsg(
"Invalid %s value in vector (values[%d]=%f not in range [%f..%f])", name, i, values[i], minvalues[i], maxvalues[i] ) );
201 return "invalid error code";
211 return "invalid gasp id";
221 return "invalid controller type";
static char const * GetStringFromGraspId(eGraspId grasp_id)
Return a ptr to a (static) string describing grasp id grasp_id.
static char const * firmware_error_codes[]
A mapping from eErrorCode error code enums to strings with human readable error messages.
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...
eGraspId
The enum values of the known grasps.
A simple vector implementation.
int GetNumberOfFingers(void)
Return the number of fingers of the SDH.
UInt16 error_code
0000h, if successful, otherwise error code
cSDHBase(int debug_level)
int GetNumberOfAxes(void)
Return the number of axes of the SDH.
eErrorCode firmware_state
the last known state of the SDH firmware
cSimpleVector min_angle_v
simple vector of 7 0 values ???
bool InRange(double v, double min, double max)
#define NAMESPACE_SDH_START
int NUMBER_OF_AXES
The number of axes.
static char const * controller_type_name[]
A mapping from eControllerType controller type enums to strings with human readable controller type n...
int GetNumberOfTemperatureSensors(void)
Return the number of temperature sensors of the SDH.
double GetEps(void)
Return the eps value.
int NUMBER_OF_TEMPERATURE_SENSORS
The number of temperature sensors.
int NUMBER_OF_FINGERS
The number of fingers.
Interface of auxilliary utility functions for SDHLibrary-CPP.
invalid controller_type (needed for cSDHSerial::con() to indicate "read current controller type") ...
void CheckRange(double value, double minvalue, double maxvalue, char const *name="")
Check if value is in [minvalue .. maxvalue]. Throw a cSDHErrorInvalidParameter exception if not...
eControllerType
An enum for all possible SDH internal controller types (order must match that in the SDH firmware in ...
cDBG cdbg
debug stream to print colored debug messages
cSimpleVector eps_v
simple vector of 7 epsilon values
cSimpleVector const & GetEpsVector(void)
Return simple vector of number of axes epsilon values.
Interface of class #SDH::cSDHBase.
#define USING_NAMESPACE_SDH
int all_axes_used
Bit field with the bits for all axes set.
static char const * GetStringFromErrorCode(eErrorCode error_code)
Return a ptr to a (static) string describing error code error_code.
#define NAMESPACE_SDH_END
static char const * GetStringFromControllerType(eControllerType controller_type)
Return a ptr to a (static) string describing controller type controller_Type.
eErrorCode GetFirmwareState(void)
Return the last known state of the SDH firmware.
USING_NAMESPACE_SDH NAMESPACE_SDH_START std::ostream * g_sdh_debug_log
Class for short, fixed maximum length text messages.
Derived exception class for exceptions related to invalid parameters.
static char const * grasp_id_name[]
A mapping from eGraspId grasp id enums to strings with human readable grasp id names.
double eps
epsilon value (max absolute deviation of reported values from actual hardware values) (needed since S...
cSimpleVector max_angle_v
Maximum allowed axis angles (in internal units (degrees))