Kinova API Documentation
KINOVAAPIUSBCOMMANDLAYER_API int SetActuatorPIDFilter ( int  ActuatorAdress,
float  commandFilter,
float  dFilter,
float  errorFilter 
)

This function sets a PID filter value on a specific actuator. Mainly used for calibration.

Warning:
Do not use this function if you don't know what you are doing!!!
Parameters:
ActuatorAdressAddress of the actuator you want to calibrate. Default address are: actuator 1 = 16, actuator 2 = 17, actuator 3 = 18, ...
commandFilterLow pass filter on the command. This is the cut-off frequency (RAD / s). (Suggested range [0, 1000])
dFilterLow pass filter on the error derivative. This is the cut-off frequency (RAD / s). (Suggested range [0, 1000])
errorFilterLow pass filter on the error. This is the cut-off frequency (RAD / s). (Suggested range [0, 1000])
#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 << "SetActuatorPIDFilter 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 (*MySetActuatorPIDFilter)(int ActuatorAdress, float filterP, float filterI, float filterD);

        //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");
        MySetActuatorPIDFilter = (int (*)(int, float, float, float)) dlsym(commandLayer_handle,"SetActuatorPIDFilter");

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

                result = (*MySetActuatorPIDFilter)(16, 200.0f, 200.0f, 200.0f);

                cout << "A specific filter has been set on the first actuator(address)" << 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