MarilynKeller / SMPL2AddBiomechanics

Enable inputting a SMPL sequence into AddBiomechanics to fit an OpenSim skeleton model to the sequence.
Other
53 stars 2 forks source link

Error :: opening bsm.osim file #5

Closed hykong99 closed 1 day ago

hykong99 commented 1 month ago

Hello, I'm trying to run your GitHub files. I'm trying to apply SMPL2AddBiomechanics using the sample motion you provided. However, it seems there are errors when trying to open BSM provided by SKEL in OpenSim. I have a few questions:

  1. As shown in the picture below, blue spheres are covering it, there are no hands, and the shoulder placement is incorrect. My environment is as follows: OpenSim version = 4.5 Why does this error occur, and what environment did you use?

  2. Why do you provide 'SMPL2AddBiomechanics/smpl2ab/data/Geometry' in ply format? Ply cannot be opened in OpenSim.

error1 error2

MarilynKeller commented 1 month ago

Hi,

The BSM model was developped and tested using NimblePhysics (hence the Geometry in .ply format), and we identified afterwards differences of implementation with OpenSim, leading to what you observed.

This issue is being tracked here: https://github.com/keenon/AddBiomechanics/issues/222#issuecomment-1949196760 So for now, the BSM model is only supported in NimblePhysics.

hykong99 commented 1 month ago

Then, which .osim file can I use to test your GitHub code?

MarilynKeller commented 1 month ago

So this repo does not use OpenSim and the demos run with the BSM model by default. May I ask why do you need to load the BSM model inside OpenSim ? Then I can propose you options depending what your goal is.

hykong99 commented 1 month ago

I want to visualize .osim files. Also, I would like to run several analyzes with opensim on the obtained .osim file.

MarilynKeller commented 1 month ago

I see, so to load it in OpenSim, you'd need a .osim model that is supported by AddBiomechanics and does not use the scapulothoracic joint (shoulder) as its implementation differs between NimblePhysics and OpenSim.

AddBiomechanics do not support all the .osim models out of the box, but it by default proposes the Rajagopal gait model so I suggest you use that one.

The downside is that since it was developped for gait analysis, this model does not have an articulated spine nor moving shoulder blades, which complicates the fitting to a SMPL sequence. Here are some results I had with this gait model to give you an idea. If you use a model without torso, it does not have enought degrees of freedom to adjust the humerus position and the arms can't be fit properly either, which also hurts the leg fitting. Options are: 1) to only track the legs, ie only consider markers that are on the legs. 2) to set all the pose parameters of SMPL's torso to zero, to have a SMPL motion with straight torso.

image

I think this is a considerable limitation, but if you still want to use my code with this gait model let me know I can give you more details.

If you think you really need the torso degrees of freedoms, then we currently need support on this issue. Or you can use another .osim full body model out there and another tool than AddBiomechanics to fit the skeleton to marker trajectories generated from SMPL.

About the visualization of BSM.osim, note that you can use https://github.com/MarilynKeller/aitviewer-skel but it requires nimblephysics, which is only supported on Ubuntu for now.

hykong99 commented 4 weeks ago

I followed the steps you mentioned using NimblePhysics. However, why are the results positioned side by side instead of overlapping like in the image below? And why are some parts not showing the same pose? Also, why aren't the jumps landing on the ground?

err1 err2

MarilynKeller commented 2 weeks ago

Hi, Could you please specify the command you ran and share the data you used here? Then I can investigate this further.

hykong99 commented 2 days ago

Hello, I used your Github code and your data.

python3 smpl2ab/show_ab_results.py --osim_path=/home/hykong99/SKEL/SMPL2AddBiomechanics/addbio_res_folder/01/Models/match_markers_but_ignore_physics.osim --mot_path=/home/hykong99/SKEL/SMPL2AddBiomechanics/addbio_res_folder/01/IK/01_01_poses_segment_0_ik.mot --smpl_motion_path=/home/hykong99/SKEL/SMPL2AddBiomechanics/models/bsm/sample_motion/01/01_01_poses.npz

MarilynKeller commented 1 day ago

I opened a new dedicated issue (upper link), please let's continue the discussion there.