Search found 4 matches
- Tue Jun 04, 2024 3:13 am
- Forum: OpenSim
- Topic: BodyKinematics python
- Replies: 1
- Views: 509
Re: BodyKinematics python
I successfully obtained the COM by python just now. I am glad to share you my program. Hope it can help you. this is my code to calculate COM from motion file. import opensim as osim # model file and trc file model = osim.Model(r'D:\OpenSim 4.5\Kitaura.osim') state = model.initSystem() motion = osim...
- Tue Jun 04, 2024 3:06 am
- Forum: OpenSim
- Topic: BodyKinematics Tool in Python
- Replies: 2
- Views: 390
Re: BodyKinematics Tool in Python
I successfully obtianed the COM by python program. import opensim as osim # model file and trc file model = osim.Model(r'D:\OpenSim 4.5\Kitaura.osim') state = model.initSystem() motion = osim.Storage(r'D:\OpenSim 4.5\1.mot') #analyze set a_tool = osim.AnalyzeTool() a_tool.setModel(model) a_tool.setC...
- Sun Jun 02, 2024 10:17 pm
- Forum: OpenSim
- Topic: BodyKinematics Tool in Python
- Replies: 2
- Views: 390
Re: BodyKinematics Tool in Python
I used the function setStatesFromMotion, then I successfully set Analysis Tool. But I can't run analysis tool. import opensim as osim # model file and trc file model = osim.Model(r'I:\model\Kitaura.osim') state = model.initSystem() motion = osim.Storage(r'I:\model\1.mot') #analyze set a_tool = osim....
- Sun Jun 02, 2024 11:33 am
- Forum: OpenSim
- Topic: BodyKinematics Tool in Python
- Replies: 2
- Views: 390
BodyKinematics Tool in Python
Cause I have to analyze a lot of motion files, I am trying to use BodyKinematics to calculate the center of mass from mot files by Python. But I don't know how to use the Python script about BodyKinematics and Analyze Tool. Here is my test code. How can I finish it? I want to output the sto file lik...