Test qb device from qbrobotics.
#include <iostream>
#include <visp3/core/vpTime.h>
#include <visp3/robot/vpQbSoftHand.h>
int main()
{
#ifdef ENABLE_VISP_NAMESPACE
#endif
#if defined(VISP_HAVE_QBDEVICE) && defined(VISP_HAVE_THREADS)
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;
}
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
const std::string & getStringMessage() const
double getCurrentMax() const
void getCurrent(vpColVector ¤t, const int &id=1)
void setPosition(const vpColVector &position, const int &id=1)
void getPosition(vpColVector &position, const int &id=1)
VISP_EXPORT void sleepMs(double t)