Read this through and my best guess is that there is something wrong here:
root->finalMatrix = root->animationMatrix * root->offsetMatrix; How is offsetMatrix calculated? And what is it supposed to do (I know somekind of offset).
Would also like to see these calculations:
//rotation glm::mat4 R = ... //calculate rotation matrix based on time //translation glm::mat4 T = ... //calculate translation matrix based on time From what you have showed my guess is that root->offsetMatrix translates the arm away from origo to somewhere (maybe the position where u would like it to be). And then root->animationMatrix first takes the inverse of root->offsetMatrix and thethen puts the rotation you want on that.
For a quick try, see if this works:
root->finalMatrix = root->offsetMatrix * root->animationMatrix * root->offsetMatrix; Although this has some extra calucation atm (if it is like I think it might be), but you will quickly find out if it works.