Skip to content

Instantly share code, notes, and snippets.

@jokla
Last active September 14, 2016 12:42
Show Gist options
  • Save jokla/b2cb081e355fce52bb7bdf4463621696 to your computer and use it in GitHub Desktop.
Save jokla/b2cb081e355fce52bb7bdf4463621696 to your computer and use it in GitHub Desktop.
for (unsigned i = 0 ; i < jointVel.getSize() ; ++i)
{
float vel = jointVel[i];
AL::ALValue limits = m_motionProxy->getLimits(jointName[i]);
if (vel > 0.0f)
angles.arrayPush(limits[0][1]); //max
else if (vel < 0.0f)
angles.arrayPush(limits[0][0]); //min
float fraction = fabs( float (vel/float(limits[0][2])));
fractions.push_back(fraction);
}
m_motionProxy->setAngles(jointNames,angles,fractions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment