Kinova API Documentation
KINOVAAPIUSBCOMMANDLAYER_API int SetCartesianInertiaDamping ( CartesianInfo  inertia,
CartesianInfo  damping 
)

This function set the Cartesian inertia and damping value.

Parameters:
inertiaA struct that contains all Cartesian inertia values. (Translation unit: Kg Orientation unit: Kg * m^2)
dampingA struct that contains all Cartesian damping values. (Translation unit: (N * s) / m Orientation unit: (N * s) / RAD)
#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 << "SetCartesianForceMinMax 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 (*MySetCartesianForceMinMax)(CartesianInfo, CartesianInfo);

        //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");
        MySetCartesianForceMinMax = (int (*)(CartesianInfo, CartesianInfo)) dlsym(commandLayer_handle,"SetCartesianForceMinMax");

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

                CartesianInfo commandMin;
                CartesianInfo commandMax;
                commandMin.InitStruct();
                commandMax.InitStruct();

                commandMin.X = 1.0f;
                commandMin.Y = 1.0f;
                commandMin.Z = 1.0f;
                commandMin.ThetaX = 0.1f;
                commandMin.ThetaY = 0.1f;
                commandMin.ThetaZ = 0.1f;

                commandMax.X = 200.0f;
                commandMax.Y = 200.0f;
                commandMax.Z = 200.0f;
                commandMax.ThetaX = 200.0f;
                commandMax.ThetaY = 200.0f;
                commandMax.ThetaZ = 200.0f;

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

                cout << "Cartesian force min and max 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