frankaemika/libfranka

gripper.stop() does not work in 0.7.1

Closed this issue · 0 comments

The gripper.stop() function does not stop the movement of the gripper. It only waits for the movement to be done then returns true once it stopped. I'm using the latest libfranka version (0.7.1). In an answer to a previous question it was said that the in the 0.7.0 version the function was fixed but for some reason it still does not work.

Here is the code that I use:

void grippose(double width, double speed, franka::Gripper *gripper)
{
  try{

    gripper->move(width, speed);

  }catch(franka::Exception& e)
  {
    mutex.lock();
    std::cout<<"thread:"<<e.what()<<std::endl;
    mutex.unlock();
  }
}

int main()
{
      try{
        franka::Gripper gripper("panda-robot");

        boost::thread k{grippose,0.07, 0.02, &gripper};

        boost::this_thread::sleep_for(boost::chrono::milliseconds(500));

        std::cout<<gripper.stop()<<std::endl;

        if(k.joinable())
        {
            k.join();
        }

        return 0;
    }catch(franka::Exception& e){
        mutex.lock();
        std::cout<<"main:"<<e.what()<<std::endl;
        mutex.unlock();
        return -1;
    }
}

Once the the gripper has reached the 0.07 position (it takes more than 0.5sec) the program prints out 1 and then ends.