This function gets the client confgurations of the robotical arm.
#include <iostream>
#include <dlfcn.h>
#include <vector>
#include "KinovaTypes.h"
using namespace std;
int main()
{
int result;
cout << "GetClientConfigurations function example" << endl;
void * commandLayer_handle;
int (*MyInitAPI)();
int (*MyCloseAPI)();
int (*MyGetClientConfigurations)(ClientConfigurations &command);
commandLayer_handle = dlopen("Kinova.API.USBCommandLayerUbuntu.so",RTLD_NOW|RTLD_GLOBAL);
MyInitAPI = (int (*)()) dlsym(commandLayer_handle,"InitAPI");
MyCloseAPI = (int (*)()) dlsym(commandLayer_handle,"CloseAPI");
MyGetClientConfigurations = (int (*)(ClientConfigurations &)) dlsym(commandLayer_handle,"GetClientConfigurations");
if((MyInitAPI == NULL) || (MyCloseAPI == NULL) || (MyGetClientConfigurations == NULL))
{
cout << "Unable to initialize the command layer." << endl;
}
else
{
cout << "The command has been initialized correctly." << endl << endl;
cout << "Calling the method InitAPI()" << endl;
result = (*MyInitAPI)();
cout << "result of InitAPI() = " << result << endl << endl;
ClientConfigurations data;
cout << "Getting the client configurations the robotic arm." << endl;
(*MyGetClientConfigurations)(data);
cout << " Client ID = " << data.ClientID << endl;
cout << " Client name = " << data.ClientName << endl;
cout << " retract mode is active = " << data.ComplexRetractActive << endl;
cout << "GOTO position are deleted at RETRACT position = " << data.DeletePreProgrammedPositionsAtRetract << endl;
cout << " Drinking distance = " << data.DrinkingDistance << endl;
cout << " Drinking height = " << data.DrinkingHeight << endl;
cout << " Drinking lenght = " << data.DrinkingLenght << endl;
cout << " EnableFlashErrorLog = " << data.EnableFlashErrorLog << endl;
cout << " EnableFlashPositionLog = " << data.EnableFlashPositionLog << endl;
cout << " Fingers2and3Inverted = " << data.Fingers2and3Inverted << endl;
cout << " Laterality = " << data.Laterality << endl;
cout << " MaxOrientationAcceleration = " << data.MaxOrientationAcceleration << endl;
cout << " MaxOrientationVelocity = " << data.MaxOrientationVelocity << endl;
cout << " MaxForce = " << data.MaxForce << endl;
cout << " MaxTranslationAcceleration = " << data.MaxTranslationAcceleration << endl;
cout << " MaxTranslationVelocity = " << data.MaxTranslationVelocity << endl;
cout << " Model = " << data.Model << endl;
cout << " Organization = " << data.Organization << endl;
cout << " RetractedPositionCount = " << data.RetractedPositionCount << endl;
cout << " RetractedPositionAngle = " << data.RetractedPositionAngle << endl;
cout << endl << "Calling the method CloseAPI()" << endl;
result = (*MyCloseAPI)();
cout << "result of CloseAPI() = " << result << endl;
}
return 0;
}