Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
hamed kouchebaghi
- Posts: 47
- Joined: Thu Nov 14, 2019 12:11 pm
Post
by hamed kouchebaghi » Sun Sep 20, 2020 6:40 am
Hello,
this is the code for the arm26 model running in MATLAB environment.
Code: Select all
import org.opensim.modeling.*
arm = Model('C:\OpenSim 4.1\Models\Arm26\arm26.osim');
arm.setUseVisualizer(true);
state = arm.initSystem();
viz = arm.updVisualizer().updSimbodyVisualizer();
viz.setBackgroundColor(Vec3(0)); % white
viz.setGroundHeight(-2)
% Simulate.
manager = Manager(arm);
state.setTime(0);
manager.initialize(state);
state = manager.integrate(10.0);
how can I load motion file to it ?
can anyone help me with this.
thank you, Best
Hamed
-
hamed kouchebaghi
- Posts: 47
- Joined: Thu Nov 14, 2019 12:11 pm
Post
by hamed kouchebaghi » Mon Sep 21, 2020 5:26 am
hamed1994 wrote: ↑Sun Sep 20, 2020 6:40 am
Hello,
this is the code for the arm26 model running in MATLAB environment.
Code: Select all
import org.opensim.modeling.*
arm = Model('C:\OpenSim 4.1\Models\Arm26\arm26.osim');
arm.setUseVisualizer(true);
state = arm.initSystem();
viz = arm.updVisualizer().updSimbodyVisualizer();
viz.setBackgroundColor(Vec3(0)); % white
viz.setGroundHeight(-2)
% Simulate.
manager = Manager(arm);
state.setTime(0);
manager.initialize(state);
state = manager.integrate(10.0);
how can I load motion file to it ?
can anyone help me with this.
thank you, Best
Hamed
hello,
can anyone help me with this please ?
thank you
-
Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Post
by Thomas Uchida » Mon Sep 21, 2020 7:17 pm
What do you mean "load motion file to it"? If you are trying to set the pose of the model, you can read a motion file and set each coordinate.
-
hamed kouchebaghi
- Posts: 47
- Joined: Thu Nov 14, 2019 12:11 pm
Post
by hamed kouchebaghi » Mon Sep 21, 2020 11:26 pm
tkuchida wrote: ↑Mon Sep 21, 2020 7:17 pm
What do you mean "load motion file to it"? If you are trying to set the pose of the model, you can read a motion file and set each coordinate.
yes, I mean reading the motion file.
how can I do it?
-
Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Post
by Thomas Uchida » Tue Sep 22, 2020 12:44 am
I mean reading the motion file. how can I do it?
Please see the "prescribeMotionInModel.m" example in your Resources\Code\Matlab directory. This file is mentioned on the "Scripting with Matlab" page in the documentation, which may also be helpful if you haven't seen it yet:
https://simtk-confluence.stanford.edu/d ... ith+Matlab.
-
hamed kouchebaghi
- Posts: 47
- Joined: Thu Nov 14, 2019 12:11 pm
Post
by hamed kouchebaghi » Mon Oct 05, 2020 5:41 am
tkuchida wrote: ↑Tue Sep 22, 2020 12:44 am
I mean reading the motion file. how can I do it?
Please see the "prescribeMotionInModel.m" example in your Resources\Code\Matlab directory. This file is mentioned on the "Scripting with Matlab" page in the documentation, which may also be helpful if you haven't seen it yet:
https://simtk-confluence.stanford.edu/d ... ith+Matlab.
hello
thank you for your help. I was able to build the model using the "prescribeMotionInModel.m" file.
Now I want to move the model to the desired coordinates. I mean when the model starts to move and lastly stops I want it to stop at the coordinates which I give to the model. What should I do ?
thanks,
Hamed
-
hamed kouchebaghi
- Posts: 47
- Joined: Thu Nov 14, 2019 12:11 pm
Post
by hamed kouchebaghi » Wed Oct 07, 2020 4:03 am
hamed1994 wrote: ↑Mon Oct 05, 2020 5:41 am
tkuchida wrote: ↑Tue Sep 22, 2020 12:44 am
I mean reading the motion file. how can I do it?
Please see the "prescribeMotionInModel.m" example in your Resources\Code\Matlab directory. This file is mentioned on the "Scripting with Matlab" page in the documentation, which may also be helpful if you haven't seen it yet:
https://simtk-confluence.stanford.edu/d ... ith+Matlab.
hello
thank you for your help. I was able to build the model using the "prescribeMotionInModel.m" file.
Now I want to move the model to the desired coordinates. I mean when the model starts to move and lastly stops I want it to stop at the coordinates which I give to the model. What should I do ?
thanks,
Hamed
hello,
could you please answer this Mr. Uchida?
thanks,
Hamed