#include "extras/CGlobals.h"
#include "devices/CCallback.h"
#include <string>
#include <stdio.h>
Go to the source code of this file.
Classes | |
class | cGenericDevice |
cGenericDevice Provides an general interface to communicate with hardware devices. A number of constants define a set of generic commands supported by the cGenericDevice:command method. For each generic command, we describe the data type and information that must be passed by parameter for index and data. command contains of course the command number corresponding to the following list of command constants. More... | |
Variables | |
const int | CHAI_CMD_GET_DEVICE_STATE = 1010 |
const int | CHAI_CMD_GET_ENCODER_0 = 1020 |
Reference to encoder 0. | |
const int | CHAI_CMD_GET_ENCODER_1 = 1021 |
Reference to encoder 1. | |
const int | CHAI_CMD_GET_ENCODER_2 = 1022 |
Reference to encoder 2. | |
const int | CHAI_CMD_GET_ENCODER_3 = 1023 |
Reference to encoder 3. | |
const int | CHAI_CMD_GET_ENCODER_4 = 1024 |
Reference to encoder 4. | |
const int | CHAI_CMD_GET_ENCODER_5 = 1025 |
Reference to encoder 5. | |
const int | CHAI_CMD_GET_ENCODER_6 = 1026 |
Reference to encoder 6. | |
const int | CHAI_CMD_GET_ENCODER_7 = 1027 |
Reference to encoder 7. | |
const int | CHAI_CMD_RESET_ENCODER_0 = 1040 |
Reference to reset signal encoder 0. | |
const int | CHAI_CMD_RESET_ENCODER_1 = 1041 |
Reference to reset signal encoder 1. | |
const int | CHAI_CMD_RESET_ENCODER_2 = 1042 |
Reference to reset signal encoder 2. | |
const int | CHAI_CMD_RESET_ENCODER_3 = 1043 |
Reference to reset signal encoder 3. | |
const int | CHAI_CMD_RESET_ENCODER_4 = 1044 |
Reference to reset signal encoder 4. | |
const int | CHAI_CMD_RESET_ENCODER_5 = 1045 |
Reference to reset signal encoder 5. | |
const int | CHAI_CMD_RESET_ENCODER_6 = 1046 |
Reference to reset signal encoder 6. | |
const int | CHAI_CMD_RESET_ENCODER_7 = 1047 |
Reference to reset signal encoder 7. | |
const int | CHAI_CMD_SET_DAC_0 = 1030 |
Reference to DAC 0. | |
const int | CHAI_CMD_SET_DAC_1 = 1031 |
Reference to DAC 1. | |
const int | CHAI_CMD_SET_DAC_2 = 1032 |
Reference to DAC 2. | |
const int | CHAI_CMD_SET_DAC_3 = 1033 |
Reference to DAC 3. | |
const int | CHAI_CMD_SET_DAC_4 = 1034 |
Reference to DAC 4. | |
const int | CHAI_CMD_SET_DAC_5 = 1035 |
Reference to DAC 5. | |
const int | CHAI_CMD_SET_DAC_6 = 1036 |
Reference to DAC 6. | |
const int | CHAI_CMD_SET_DAC_7 = 1037 |
Reference to DAC 7. | |
const int | CHAI_CMD_GET_POS_3D = 2000 |
const int | CHAI_CMD_GET_POS_NORM_3D = 2001 |
const int | CHAI_CMD_GET_VEL_3D = 2002 |
const int | CHAI_CMD_SET_FORCE_3D = 2010 |
const int | CHAI_CMD_SET_FORCE_NORM_3D = 2011 |
const int | CHAI_CMD_SET_FORCE_TORQUE_3D = 2012 |
const int | CHAI_CMD_GET_ROT_ANGLES = 2020 |
const int | CHAI_CMD_GET_ROT_MATRIX = 2021 |
const int | CHAI_CMD_SET_TORQUE_3D = 2030 |
const int | CHAI_CMD_GET_SWITCH_0 = 2041 |
const int | CHAI_CMD_GET_SWITCH_1 = 2042 |
const int | CHAI_CMD_GET_SWITCH_2 = 2043 |
const int | CHAI_CMD_GET_SWITCH_MASK = 2044 |
const int | CHAI_CMD_GET_NORMALIZED_SCALE_FACTOR = 2045 |
const int | CHAI_MSG_OK = 0 |
The following constants define the possible return values of the method cGenericDevice:: command(). | |
const int | CHAI_MSG_ERROR = -1 |
Error message - and error has occurred. | |
const int | CHAI_MSG_NOT_IMPLEMENTED = -2 |
Error message - this command is not supported. | |
const int | CHAI_MSG_SYSTEM_NOT_READY = -3 |
Error message - system is not ready. |
const int CHAI_CMD_GET_DEVICE_STATE = 1010 |
Purpose: Query device to check if is operating correctly. iData: integer type value. 1 means device is ok 0 means device is not ready.
const int CHAI_CMD_GET_ENCODER_0 = 1020 |
Reference to encoder 0.
Purpose: Read the value of an encoder N. Data: Integer type value.
const int CHAI_CMD_GET_NORMALIZED_SCALE_FACTOR = 2045 |
Purpose: Get the scale factor from normalized coordinates to mm
Data: double scale factor... mm = scale * normalized_coords
const int CHAI_CMD_GET_POS_3D = 2000 |
Purpose: Read position (px, py, pz) in meters [m] of 3d point contact device.
Data: cVector3d type value.
const int CHAI_CMD_GET_POS_NORM_3D = 2001 |
Purpose: Read normalized position (px, py, pz) of 3d point contact device. typically the value of each component of the vector position will be included in the interval [-1,1], accounting for the maximum usable workspace of the device.
Data: cVector3d type value.
const int CHAI_CMD_GET_ROT_ANGLES = 2020 |
Purpose: Read orientation angles (ax, ay, az) of a 3d wrist or stylus.
Data: cVector3d type value.
const int CHAI_CMD_GET_ROT_MATRIX = 2021 |
Purpose: Read orientation matrix of a 3d wrist or stylus.
Data: cMatrix3d type value.
const int CHAI_CMD_GET_SWITCH_0 = 2041 |
Purpose: Read status of user switch 0.
Data: Integer type value.
const int CHAI_CMD_GET_SWITCH_1 = 2042 |
Purpose: Read status of user switch 1.
Data: Integer type value.
const int CHAI_CMD_GET_SWITCH_2 = 2043 |
Purpose: Read status of user switch 2.
Data: Integer type value.
const int CHAI_CMD_GET_SWITCH_MASK = 2044 |
Purpose: Reads all switches into a bit mask with bit 0 = button 0, etc.
Data: Integer type value.
const int CHAI_CMD_GET_VEL_3D = 2002 |
Purpose: Read velocity (vx, vy, vz) of 3d point contact device in [m/s].
Data: cVector3d type value.
const int CHAI_CMD_RESET_ENCODER_0 = 1040 |
Reference to reset signal encoder 0.
Purpose: Reset the value of an encoder N. Data: Integer type value.
const int CHAI_CMD_SET_DAC_0 = 1030 |
Reference to DAC 0.
Purpose: Set value to a DAC. Data: Integer type value.
const int CHAI_CMD_SET_FORCE_3D = 2010 |
Purpose: Set a force (fx, fy, fz) to a 3d point contact device (in Newtons [N]).
Data: cVector3d type value.
const int CHAI_CMD_SET_FORCE_NORM_3D = 2011 |
Purpose: Set a normalized force (fx, fy, fz) to a 3d point contact device. A normalized force has a maximum length of 1.0 corresponding to the highest force that the device can generate.
Data: cVector3d type value.
const int CHAI_CMD_SET_FORCE_TORQUE_3D = 2012 |
Purpose: Set a force (fx, fy, fz) and a torque (tx, ty, tz) to a 6d point contact device.
Data: array of 2 cVector3d type value. Units are [N] and [N*mm].
const int CHAI_CMD_SET_TORQUE_3D = 2030 |
Purpose: Set a torque (tx, ty, tz) to a 3d wrist or stylus.
Data: cVector3d type value. Units are N*mm.
const int CHAI_MSG_OK = 0 |
The following constants define the possible return values of the method cGenericDevice:: command().
Error message - no error occurred.