IK code details
Posted: Thu Apr 24, 2014 2:51 am
Hello,
I am tracing IK codes to know more about IK details. I know there are lots of comments in the codes, but too many professional terms. Could you help me realize something, thanks.
In InverseKinematics::run(), we create an IK solver, and the parameter markersReference comes from <IKMarkerTask>, coordinateReferences comes from <IKCoordinateTask>. After some setup, IK solver calls assemble(SimTK::State &s) and track(SimTK::State &s) in a for loop. I think these two are core functions in whole IK flow. According to my tracing, assemble(SimTK::State &s) should be AssemblySolver::assemble(SimTK::State &state) and track(SimTK::State &s) should be AssemblySolver::track(SimTK::State &s).
It says that assemble() is to assemble a model configuration that meets the assembly conditions (desired values and constraints). So, assemble() finds an solution for initial state, and track() tracks the small change between each frame, that is, the solution for t2 is based on the solution for t1, am I right? And why track() tracks from i = 0 not from i = 1. I see that the code Assembler::assemble() and Assembler::track(Real frameTime) are almost the same. track() indeed is a repeated assembly. It seems that the first frame is assembled twice, one in assemble() and one in track()?
Thank you very much.
Best regards,
Yu-Wei
I am tracing IK codes to know more about IK details. I know there are lots of comments in the codes, but too many professional terms. Could you help me realize something, thanks.
In InverseKinematics::run(), we create an IK solver, and the parameter markersReference comes from <IKMarkerTask>, coordinateReferences comes from <IKCoordinateTask>. After some setup, IK solver calls assemble(SimTK::State &s) and track(SimTK::State &s) in a for loop. I think these two are core functions in whole IK flow. According to my tracing, assemble(SimTK::State &s) should be AssemblySolver::assemble(SimTK::State &state) and track(SimTK::State &s) should be AssemblySolver::track(SimTK::State &s).
It says that assemble() is to assemble a model configuration that meets the assembly conditions (desired values and constraints). So, assemble() finds an solution for initial state, and track() tracks the small change between each frame, that is, the solution for t2 is based on the solution for t1, am I right? And why track() tracks from i = 0 not from i = 1. I see that the code Assembler::assemble() and Assembler::track(Real frameTime) are almost the same. track() indeed is a repeated assembly. It seems that the first frame is assembled twice, one in assemble() and one in track()?
Thank you very much.
Best regards,
Yu-Wei