I have seen your code about fetching twist angles but have some questions about it.
In your code "gettwist", you calculate axis and angle of swing rotation first, then calculate R{tw} with equation "R = R{sw} * R{tw}". Finally, the angle can be fetched with the rotation matrix.
The question is that the final rotation matrix R_tw's direction may not be the same of u(direction from parent joint to children), so you judge the direction by comparing "pos" and "neg". But this is not a accurate solution of fetching twist angle and in my dataset including many large poses, it does not work in many cases.
I have seen your code about fetching twist angles but have some questions about it. In your code "gettwist", you calculate axis and angle of swing rotation first, then calculate R{tw} with equation "R = R{sw} * R{tw}". Finally, the angle can be fetched with the rotation matrix. The question is that the final rotation matrix R_tw's direction may not be the same of u(direction from parent joint to children), so you judge the direction by comparing "pos" and "neg". But this is not a accurate solution of fetching twist angle and in my dataset including many large poses, it does not work in many cases.
Hope for your reply.