38 template <
int dimensions = Eigen::Dynamic>
68 stackAllocations.zeroVec = PIDVectorX::Zero(size);
69 stackAllocations.errorVec = stackAllocations.zeroVec;
70 stackAllocations.direction = stackAllocations.zeroVec;
71 stackAllocations.oldControlValue = stackAllocations.zeroVec;
77 ScopedRecursiveLockPtr lock = getLock();
78 if (stackAllocations.zeroVec.rows() == 0)
92 for (
size_t i = 0; i <
limitless.size(); i++)
102 double error = stackAllocations.errorVec.norm();
117 stackAllocations.direction = targetValue;
121 stackAllocations.direction = stackAllocations.errorVec.normalized();
125 stackAllocations.direction.setZero();
134 stackAllocations.oldControlValue = stackAllocations.zeroVec;
141 float maxNewJointAcc = accVec.maxCoeff();
142 float minNewJointAcc = accVec.minCoeff();
143 maxNewJointAcc = std::max<float>(fabs(minNewJointAcc), fabs(maxNewJointAcc));
146 auto newValue = stackAllocations.oldControlValue + accVec *
maxDerivation / maxNewJointAcc * deltaSec;
155 max = std::max<float>(fabs(
min), fabs(
max));
173 ScopedRecursiveLockPtr lock = getLock();
182 update(
dt, measuredValue, targetValue);
192 ScopedRecursiveLockPtr lock = getLock();
198 ScopedRecursiveLockPtr lock = getLock();
228 struct StackAllocationHelper
246 return ScopedRecursiveLockPtr();