Moving a humanoid model with IMU's

This is my first post so please forgive me if i have posted in the wrong topic. If i did, I would really appreciate if someone pointed me to the correct topic. Now that I got that out the way…

I’m currently working on a project which involves controlling humanoid model with IMU sensors. I’m only moving the upper left arm, lower left arm, and left hand. I’m using madgwicks algorithms to create the quaternions that I pass into the setUserTransforms function for each bone. It works beautifully, when the positive Z- axis is facing North. Here are my issues…

  1. Once turn to face another direction, the model doesn’t move as expected.
  2. When I raise the upper arm, inherently the lower arms sensor also rotates, which causes the model’s lower arm to raise upward in the direction that the upper arm was raised.

Now my question(s),

  1. Is it because the model is locked that the sensors don’t visualize as expected? (Ex. Raising my arm up when sensor’s +z-axis is facing east/west/south doesn’t raise the arm of the model)
  2. Should I be using setUserTransforms? Or setUserTransformsInModelSpace?
  3. How can I make it so that the entire model rotates? Do I have to have everybone connected to a sensor as well?`
  4. Is there a way to move the upper parts of a limb without it affecting the lower half? Or do I need to write some sort of function that takes care of that?

Here’s a few things about the model.

  1. It is locked onto the center of the scene (0,0,0). So the model doesn’t turn if i turn the sensors.
  2. As stated before, I use setUserTransforms to update the bones position.
  3. Here is the structure of the model. (obtained by calling getRoots)
    [Root bone
    -pelvis bone
    –thigh_r bone
    —calf_r bone
    ----foot_r bone
    -----ball_r bone
    –thigh_l bone
    —calf_l bone
    ----foot_l bone
    -----ball_l bone
    –spine_01 bone
    —spine_02 bone
    ----spine_03 bone
    -----neck_01 bone
    ------head bone
    -----clavicle_r bone
    ------upperarm_r bone
    -------lowerarm_r bone
    --------hand_r bone
    ---------thumb_01_r bone
    ----------thumb_02_r bone
    -----------thumb_03_r bone
    ---------ring_01_r bone
    ----------ring_02_r bone
    -----------ring_03_r bone
    ---------pinky_01_r bone
    ----------pinky_02_r bone
    -----------pinky_03_r bone
    ---------middle_01_r bone
    ----------middle_02_r bone
    -----------middle_03_r bone
    ---------index_01_r bone
    ----------index_02_r bone
    -----------index_03_r bone
    -----clavicle_l bone
    ------upperarm_l bone
    -------lowerarm_l bone
    --------hand_l bone
    ---------thumb_01_l bone
    ----------thumb_02_l bone
    -----------thumb_03_l bone
    ---------ring_01_l bone
    ----------ring_02_l bone
    -----------ring_03_l bone
    ---------pinky_01_l bone
    ----------pinky_02_l bone
    -----------pinky_03_l bone
    ---------middle_01_l bone
    ----------middle_02_l bone
    -----------middle_03_l bone
    ---------index_01_l bone
    ----------index_02_l bone
    -----------index_03_l bone
    ]

Any help is appreciated, thanks in advanced.

2 Likes

i am going to do the same project, can i have source codes. it would be a great help to me