Kinova API Documentation
KINOVAAPIUSBCOMMANDLAYER_API int SetAngularTorqueMinMax ( AngularInfo  min,
AngularInfo  max 
)

This function set the angular torque's maximum and minimum values.

Parameters:
minA struct that contains all angular minimum values. (Unit: N * m)
maxA struct that contains all angular max values. (Unit: N * m)
#include <iostream>
#include <dlfcn.h> //Ubuntu
#include <vector>
#include "KinovaTypes.h"
//Note that under windows, you may/will have to perform other #include

using namespace std;

int main()
{
        int result;

        cout << "SetAngularTorqueMinMax function example" << endl;

        //Handle for the library's command layer.
        void * commandLayer_handle;

        //Function pointers to the functions we need
        int (*MyInitAPI)();
        int (*MyCloseAPI)();
        int (*MySetAngularTorqueMinMax)(AngularInfo, AngularInfo);

        //We load the library (Under Windows, use the function LoadLibrary)
        commandLayer_handle = dlopen("Kinova.API.USBCommandLayerUbuntu.so",RTLD_NOW|RTLD_GLOBAL);

        //We load the functions from the library (Under Windows, use GetProcAddress)
        MyInitAPI = (int (*)()) dlsym(commandLayer_handle,"InitAPI");
        MyCloseAPI = (int (*)()) dlsym(commandLayer_handle,"CloseAPI");
        MySetAngularTorqueMinMax = (int (*)(AngularInfo, AngularInfo)) dlsym(commandLayer_handle,"SetAngularTorqueMinMax");

        //If the was loaded correctly
        if((MyInitAPI == NULL) || (MyCloseAPI == NULL) || (MySetAngularTorqueMinMax == 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;

                AngularInfo commandMin;
                AngularInfo commandMax;
                commandMin.InitStruct();
                commandMax.InitStruct();

                commandMin.Actuator1 = 2.0f;
                commandMin.Actuator2 = 2.0f;
                commandMin.Actuator3 = 2.0f;
                commandMin.Actuator4 = 2.0f;
                commandMin.Actuator5 = 2.0f;
                commandMin.Actuator6 = 2.0f;

                commandMax.Actuator1 = 90.0f;
                commandMax.Actuator2 = 90.0f;
                commandMax.Actuator3 = 90.0f;
                commandMax.Actuator4 = 90.0f;
                commandMax.Actuator5 = 90.0f;
                commandMax.Actuator6 = 90.0f;

                result = (*MySetAngularTorqueMinMax)(commandMin, commandMax);

                cout << "Force max min has been set." << endl;

                cout << endl << "Calling the method CloseAPI()" << endl;
                result = (*MyCloseAPI)();
                cout << "result of CloseAPI() = " << result << endl;
        }

        return 0;
}
 All Classes Files Functions Variables Enumerations Enumerator Defines