30 using namespace ForceTorqueUtility;
37 ARMARX_CHECK_EXPRESSION(in.getTriggerOnDecreasingForceVectorLength() || in.getTriggerOnIncreasingForceVectorLength());
39 const float forceThreshold = in.getForceVectorLengthThreshold();
40 DatafieldRefPtr forceDf = DatafieldRefPtr::dynamicCast(getForceTorqueObserver()->getForceDatafield(in.getFTDatafieldName()));
41 const Eigen::Vector3f weights = in.getForceWeights()->toEigen();
42 const float initialForce = forceDf->getDataField()->get<
FramedDirection>()->
toEigen().cwiseProduct(weights).norm();
44 while (!isRunningTaskStopped())
47 const float force = forceDf->getDataField()->get<
FramedDirection>()->
toEigen().cwiseProduct(weights).norm();
51 in.getTriggerOnDecreasingForceVectorLength() &&
52 force < initialForce &&
53 initialForce - force >= forceThreshold
56 in.getTriggerOnIncreasingForceVectorLength() &&
57 force > initialForce &&
58 force - initialForce >= forceThreshold
65 std::this_thread::sleep_for(std::chrono::milliseconds{10});