Human Model Interacting with My Model

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jessica Mayenburg
Posts: 8
Joined: Sun Oct 04, 2020 3:52 pm

Human Model Interacting with My Model

Post by Jessica Mayenburg » Sat Jan 09, 2021 12:18 pm

So I've created a multibody model in Matlab. It's sort of like a walker. I would like to try to simulate one of the OpenSim human models (like the one in tutorials 1 and 3) walking with the walker. Is there a way to add the human model in my .m file, and is there a way to get the human to "hold" onto the handles of the walker?

Image of walker attached, I'm still trying to fix the angle of the back joint, the wheel should be further back and the joint should be extended. This is for a project at Carleton University.

Thanks in advance :D
Attachments
Screenshot 2021-01-09 141543.png
Screenshot 2021-01-09 141543.png (50.94 KiB) Viewed 352 times

Tags:

User avatar
Rory Turnbull
Posts: 28
Joined: Mon Dec 16, 2019 1:57 am

Re: Human Model Interacting with My Model

Post by Rory Turnbull » Wed Mar 03, 2021 3:19 am

Hi,

Don't know if you worked this out already. But I did the following:
  • Add the intended model as a base (here Arnoldetal2010_2Legs_50pct_v2.1.osim)
  • Import bodies and joints from the model so you can access them
  • Create a joint between the model's body and your body or set up an interaction

Code: Select all

%% Instantiate an Leg OpenSim Model
model = Model('Arnoldetal2010_2Legs_50pct_v2.1.osim'); % https://simtk.org/projects/lowlimbmodel09
model.setName('model');
model.setUseVisualizer(true); % Initiate visualiser - not necessary for data output

% Get a reference to the ground object
ground = model.getGround();

% Define the acceleration of gravity
model.setGravity(Vec3(0, -9.80665, 0));

% https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+with+Matlab#ScriptingwithMatlab-Usingamodel's%22Lists%22throughiterators

%% Import Leg model Bodies
BodyList = osimList2MatlabCell(model,'Body');  % Get a cell array of references to all the bodies in a model
% Body list structure references
Pelvis = BodyList{1}; % 1
% 2 femur_r
% 3 femur_wlkr_r
% 4 tibia_wlkr_r
% 5 tibia_r
% 6 shaft_axis_r
% 7 patella_r
% 8 talus_r
% 9 calcn_r
% 10 toes_r
% 11 femur_l
% 12 femur_wlkr_l
% 13 tibia_wlkr_l
% 14 tibia_l
% 15 shaft_axis_l
% 16 patella_l
% 17 talus_l
% 18 calcn_l
% 19 toes_l
% 20 torso

%% List of joints from Leg model
JointList = osimList2MatlabCell(model,'Joint');  % Get a cell array of references to all the joints in a model
% 1 ground_pelvis
% 2 hip_r
% 3 femur_coord_r
% 4 walker_knee_r
% 5 tibia_coord_r
% 6 femoral_shaft_r
% 7 patellofemoral_r
% 8 ankle_r
% 9 subtalar_r
% 10 mtp_r
% 11 hip_l
% 12 femur_coord_l
% 13 walker_knee_l
% 14 tibia_coord_l
% 15 femoral_shaft_l
% 16 patellofemoral_l
% 17 ankle_l
% 18 subtalar_l
% 19 mtp_l
% 20 back

%% List of constraints from Leg model
% ConstraintList = osimList2MatlabCell(LowerExo,'Constraint');  % Get a cell array of references to all the constraints in a model

%% List of forces from Leg model
% ForceList = osimList2MatlabCell(LowerExo,'Force');  % Get a cell array of references to all the forces in a model

%% List of controllers from Leg model
% ControllerList = osimList2MatlabCell(LowerExo,'Controller');  % Get a cell array of references to all the controllers in a model

%% List of components from Leg model
%  ComponentList = osimList2MatlabCell(LowerExo,'Component');  % Get a cell array of references to all the components in a model

User avatar
Pia Henneken
Posts: 1
Joined: Thu Jan 14, 2021 2:44 am

Re: Human Model Interacting with My Model

Post by Pia Henneken » Sat May 22, 2021 3:20 am

Hi,
I have a similar problem.
When I try to create a joint between a body of the human model and a body of my model, I always get the Error that the components don't have the same root component. Can anybody help me?

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Human Model Interacting with My Model

Post by Thomas Uchida » Sat May 22, 2021 4:51 am

It sounds like you are attempting to define a joint between bodies in different models. This is not possible; the electrical analogy is connecting two circuits with different ground nodes. You need to create a single model that contains all components before defining connections between them.

POST REPLY