Test qb device from qbrobotics.
#include <iostream>
#include <visp3/robot/vpQbSoftHand.h>
#include <visp3/core/vpTime.h>
int main()
{
#ifdef VISP_HAVE_QBDEVICE
std::cout << "Test qbSoftHand device" << std::endl;
try {
{
double speed_factor = 0.5;
double stiffness = 0.7;
std::cout << "** Close the hand with blocking positioning function" << std::endl;
q[0] = 1;
std::cout << "** Open the hand with blocking positioning function" << std::endl;
q[0] = 0;
}
{
int i_max = 0;
std::cout << "** Close the hand with non-blocking positioning function" << std::endl;
for(int i=1; i <= 10; i++) {
if (std::fabs(current[0]) > max_current/2) {
std::cout << "Stop closure, current > " << max_current/2 << std::endl;
i_max = i;
break;
}
q[0] = i/10.0;
}
std::cout << "** Open the hand with non-blocking positioning function" << std::endl;
for(int i=i_max; i >= 0; i--) {
q[0] = i/10.0;
}
}
std::cout << "The end" << std::endl;
}
}
#else
std::cout << "ViSP is not build with qbdevice 3rd party" << std::endl;
#endif
return EXIT_SUCCESS;
}