An example to compare with and without null space task in IK.

This commit is contained in:
yunfeibai
2016-09-30 00:43:15 -07:00
parent ee00696ae9
commit 1c1d3db26d
2 changed files with 7 additions and 5 deletions

View File

@@ -181,10 +181,12 @@ bool IKTrajectoryHelper::computeNullspaceVel(int numQ, const double* q_current,
double stayCloseToZeroGain = 0.1;
double stayAwayFromLimitsGain = 10.0;
double q_rest[7] = {0, 0, 0, SIMD_HALF_PI, 0, -SIMD_HALF_PI*0.66, 0};
// Stay close to zero
for (int i = 0; i < numQ; ++i)
{
m_data->m_nullSpaceVelocity[i] = -stayCloseToZeroGain * q_current[i];
m_data->m_nullSpaceVelocity[i] = stayCloseToZeroGain * (q_rest[i]-q_current[i]);
}
// Stay away from joint limits