melund / anybody-perception-neuron-model

A MoCap model based on data from the perception neuron inertial motion capture suit
Other
3 stars 0 forks source link

Different BVH data reference formats #1

Open iamsejin opened 2 years ago

iamsejin commented 2 years ago

Hi, First of all, thanks for pointing out your code. I tried to input my motion capture data by referring to your code. However, even though it is the same perception neuron data, the data used in the code seems to have a different structure from mine. If you don't mind, I'd like to ask you to take a look at my bvh file. Thank you.

melund commented 2 years ago

No problem. I can take a look. I don't have very much experience with Perception Neuron, but I have seen different structures. Maybe it is something that can be controlled when exporting to BVH.

iamsejin commented 2 years ago

bvhfiles.zip

I have attached my bvh files. I can export the 3 types of bvh files and data_v1,v2,v3 are 3 bvh files exported from the same raw data. The description file about that also included. I loaded all 3 versions to Anybody, but there are some difference between your data and mine.

iamsejin commented 2 years ago

And I attach MarkerProtocol.any file I changed. Thank you.

anyfiles.zip

melund commented 2 years ago

Hi. I tried to compare the Neuron Mocap BVH file I had with the ones you sent me. It mostly resemble the file "Data_v1_Char00.bvh" you had. But the file structure seems to have changed slightly:

Especially, my BVH file have the following: Spine->Spine1->Spine2->Neck->Neck1->Head

Whereas your file has this structure: Spine->Spine1->Spine2->Spine3->Neck->Head

Maybe Perception Neuron has changed their file structure over time? Are you using the newest perception neuron system? If so, I could easily change the example. It is easy to fix. Do a search/replace in the marker protocol file:

replace Spine1.Spine2.Neck.Neck1.Head with Spine1.Spine2.Spine3.Neck.Head replace Spine1.Spine2.Seg.Neck with Spine1.Spine2.Seg.Spine3 replace Spine1.Spine2.RightShoulder with Spine1.Spine2.Spine3.RightShoulder replace Spine1.Spine2.LeftShoulder with Spine1.Spine2.Spine3.LeftShoulder

If this is the new structure for Perception Neuron models I would be happy to update the example. You shouldn't happen to have a BVH file which I could be allowed to share as part the repository?

iamsejin commented 2 years ago

The software for perception neuron has been updated. So the format of the data may have changed. You may use my motion data for code updates if you want.

I replaced the codes as you said. But there are some problems.

  1. The inclination of the clavicle is steep. I mean, the shoulder position is too high.
  2. Markers of upper body(head, shoulders, spine) seem to be very far from each other. (red vs. blue). (When collecting data, sensors are located at the center of the forehead and shoulders.)

So, When I run the anybody model, these warning and error occur.

WARNING(OBJ.MCH.KIN6) : Interface.any(215) : GHRot : Close to singular position : Orientation close to Gimbal Lock, i.e., first and third axis of rotation being parallel

Progressing to solve kinematic optimality conditions and hard constraints.

WARNING(OBJ.MCH.KIN7) : Muscle.any(1254) : teres_major_3.SPLine : Penetration of surface : cyl : Via-point 'O_teres_major_3' on 'SPLine' is located below the wrapping surface'cyl ... WARNING(OBJ.MCH.KIN7) : Muscle.any(919) : pectoralis_major_clavicular_part_4.SPLine : Penetration of surface : CylSurf : Via-point 'O_pectoralis_major_clavicular_part_4' on 'SPLine' is located below the wrapping surface'CylSurf

ERROR(OBJ.MCH.MUS4) : AnyMocapModel.any(60) : InverseDynamicStudy.InverseDynamics : Muscle recruitment solver : solver aborted after maximum number of iterations

melund commented 2 years ago

Sorry. I only got around to check that it could load. It seems the whole stick figure changed in your BVH file.

You will need to change the virtuel marker protocol so the musculoskeletal model matches the stickfigure. I will see if I can do something quick but otherwise you are on your own.

I have just seen many changes to the stickfigure in different perception neuron files. It is really not ideal. Also keep in mind that perception neuron data is really bad for dynamic movements. And if your acceleration are wrong you can get the right forces. So I can only recommend this using perception neuron data for semi static analysis (i.e. not gait).

melund commented 2 years ago

@iamsejin I have pushed and update which enables you to switch between the two different perception neuron file structures I have seen. https://github.com/melund/anybody-perception-neuron-model/blob/master/LabSpecificData.any#L13-L24

Now, Subject 1 runs with the old file I had, and Subject 2 two uses your file. https://github.com/melund/anybody-perception-neuron-model/tree/master/Subjects

I still can't share any of the peception neuron file I have, so you need to rename one of your files to: "PerceptionNeuron2_Trial01.bvh" and put it in the BVH-files folder. Then you should be able to load Subjects/PerceptionNeuron2/PerceptionNeuron2_Trial01/Main.any example.

I have also ported the functionality from the official AnyBody model repository (based on xsens) which scales the model based on the BVH stick-figure. https://github.com/melund/anybody-perception-neuron-model/blob/master/CalculateSegmentDimensionsFromBVH_perception_neuron_2.any

It makes the model model fit the data much better, but you will need to tweak this further.

Let me know if you had any sample BVH files that could be shared as part of this example repository. I think that would help other users a lot.