Go to the documentation of this file.00001 #ifdef KINOVAAPIUSBCOMMANDLAYER_EXPORTS
00002 #define KINOVAAPIUSBCOMMANDLAYER_API __attribute__ ((visibility ("default")))
00003 #else
00004 #define KINOVAAPIUSBCOMMANDLAYER_API __attribute__ ((visibility ("default")))
00005 #endif
00006
00012 #include <vector>
00013 #include "KinovaTypes.h"
00014 #include "Kinova.API.CommLayerUbuntu.h"
00015 #include <stdio.h>
00016
00017
00018 #define COMM_LAYER_PATH "Kinova.API.CommLayerUbuntu.so"
00019
00020
00021 #define SUCCESS 1
00022 #define KINOVA_ 1
00023
00024
00025 #define ERROR_INIT_API 2001 // Error while initializing the API
00026 #define ERROR_LOAD_COMM_DLL 2002 // Error while loading the communication layer
00027
00028
00029 #define JACO_NACK_FIRST 2003
00030 #define JACO_COMM_FAILED 2004
00031 #define JACO_NACK_NORMAL 2005
00032
00033
00034 #define ERROR_INIT_COMM_METHOD 2006
00035
00036
00037 #define ERROR_CLOSE_METHOD 2007
00038
00039
00040 #define ERROR_GET_DEVICE_COUNT_METHOD 2008
00041
00042
00043 #define ERROR_SEND_PACKET_METHOD 2009
00044
00045
00046 #define ERROR_SET_ACTIVE_DEVICE_METHOD 2010
00047
00048
00049 #define ERROR_GET_DEVICES_LIST_METHOD 2011
00050
00051
00052 #define ERROR_SEMAPHORE_FAILED 2012
00053
00054
00055 #define ERROR_INVALID_PARAM 2100
00056
00057
00058 #define ERROR_API_NOT_INITIALIZED 2101
00059
00060
00061
00062
00063 #define COMMAND_LAYER_VERSION 50101
00064
00065
00066
00067 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetDevices(std::vector<KinovaDevice> &devices, int &result);
00068
00069 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetActiveDevice(KinovaDevice device);
00070
00071 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int InitAPI(void);
00072
00073 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int CloseAPI(void);
00074
00075 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetCodeVersion(std::vector<int> &Response);
00076
00077 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAPIVersion(std::vector<int> &Response);
00078
00079 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetCartesianPosition(CartesianPosition &Response);
00080
00081 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAngularPosition(AngularPosition &Response);
00082
00083 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetCartesianForce(CartesianPosition &Response);
00084
00085 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAngularForce(AngularPosition &Response);
00086
00087 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAngularCurrent(AngularPosition &Response);
00088
00089 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetActualTrajectoryInfo(TrajectoryPoint &Response);
00090
00091 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetGlobalTrajectoryInfo(TrajectoryFIFO &Response);
00092
00093 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetSensorsInfo(SensorsInfo &Response);
00094
00095 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetSingularityVector(SingularityVector &Response);
00096
00097 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetAngularControl();
00098
00099 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetCartesianControl();
00100
00101 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int StartControlAPI();
00102
00103 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int StopControlAPI();
00104
00105 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int RestoreFactoryDefault();
00106
00107 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SendJoystickCommand(JoystickCommand joystickCommand);
00108
00109 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SendAdvanceTrajectory(TrajectoryPoint trajectory);
00110
00111 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SendBasicTrajectory(TrajectoryPoint trajectory);
00112
00113 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetClientConfigurations(ClientConfigurations &config);
00114
00115 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetClientConfigurations(ClientConfigurations config);
00116
00117 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int EraseAllTrajectories();
00118
00119 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetPositionCurrentActuators(std::vector<float> &Response);
00120
00121 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetActuatorPID(unsigned int address, float P, float I, float D);
00122
00123 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAngularCommand(AngularPosition &Response);
00124
00125 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetCartesianCommand(CartesianPosition &Response);
00126
00127 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAngularCurrentMotor(AngularPosition &Response);
00128
00129 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAngularVelocity(AngularPosition &Response);
00130
00131 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetControlType(int &Response);
00132
00133 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int StartForceControl();
00134
00135 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int StopForceControl();
00136
00137 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int StartCurrentLimitation();
00138
00139 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int StopCurrentLimitation();
00140
00141 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetSystemErrorCount(unsigned int &Response);
00142
00143 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetSystemError(unsigned int indexError, SystemError &Response);
00144
00145 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int ClearErrorLog();
00146
00147 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int EraseAllProtectionZones();
00148
00149
00150 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetSerialNumber(char Command[STRING_LENGTH], char temp[STRING_LENGTH]);
00151
00152 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetControlMapping(ControlMappingCharts &Response);
00153
00154 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetProtectionZone(ZoneList &Response);
00155
00156 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetProtectionZone(ZoneList Command);
00157
00158 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetGripperStatus(Gripper &Response);
00159
00160 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetQuickStatus(QuickStatus &Response);
00161
00162 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetForcesInfo(ForcesInfo &Response);
00163
00164 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetControlMapping(ControlMappingCharts Command);
00165
00166 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int ProgramFlash(char * filename);
00167
00168 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetJointZero(int ActuatorAdress);
00169
00170 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetTorqueZero(int ActuatorAdress);
00171
00172 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetTorqueGain(int ActuatorAdress, int Gain);
00173
00174 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetActuatorPIDFilter(int ActuatorAdress, float filterP, float filterI, float filterD);
00175
00176 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetActuatorAddress(int ActuatorAdress, int newAddress);
00177
00178 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetGeneralInformations(GeneralInformations &Response);
00179
00180 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetFrameType(int frameType);
00181
00182 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetCartesianForceMinMax(CartesianInfo min, CartesianInfo max);
00183
00184 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetCartesianInertiaDamping(CartesianInfo inertia, CartesianInfo damping);
00185
00186 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetAngularTorqueMinMax(AngularInfo min, AngularInfo max);
00187
00188 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetAngularInertiaDamping(AngularInfo inertia, AngularInfo damping);
00189
00190
00191 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetDevValue(std::vector<float> command);
00192
00193
00194 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetDevValue(std::vector<float> &Response);
00195
00196 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetSpasmFilterValues(std::vector<float> Response, int activationStatus);
00197
00198 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetSpasmFilterValues(std::vector<float> &Response, int &activationStatus);
00199
00200 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int MoveHome();
00201
00202 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetAngularForceGravityFree(AngularPosition &Response);
00203
00204 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetActuatorAcceleration(AngularAcceleration &Response);
00205
00206 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int InitFingers();
00207
00208 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int GetPeripheralInventory(std::vector<PeripheralInfo> &);
00209
00210
00211 extern "C" KINOVAAPIUSBCOMMANDLAYER_API int SetModel(char Command[STRING_LENGTH], char temp[STRING_LENGTH]);
00212