Share 
Follow 
AboutDownloadsDocumentsForumsSource CodeIssuesNews
Date:
2011-10-21 10:32
Priority:
3
State:
Open
Submitted by:
yoonsang lee (yslee)
Assigned to:
Ajay Seth (aseth)
Summary:
Problems with Manager class initialization

Detailed description
It seems like that something is going wrong with Manager class setModel()/ setIntegrator().
Not all model files but model file with muscles causes a crash with commented initialization code below. (crash with chain_2_hinge_muscle.osim, no crash with chain_2_hinge.osim)
I'm using opensim v2.4 api for VC9 users.


Model osim(modelFileName);

SimTK::State& si = osim.initSystem();
osim.computeEquilibriumForAuxiliaryStates(si);

SimTK::RungeKutta3Integrator integrator(osim.getMultibodySystem());
integrator.setFixedStepSize(.001);

// works well
Manager manager(osim, integrator);

// crashes
// Manager manager;
// manager.setModel(osim);
// manager.setIntegrator(&integrator);

manager.setInitialTime(startTime);
manager.setFinalTime(finalTime);
manager.integrate(si); // -> crash occurs here when commented manager initialization code is executed.

Add A Comment: Notepad

Message  ↓
Date: 2012-11-12 21:57
Sender: Ayman Habib

This is because the constructor that takes model, initializes a pointer to a _controllerSet. If other methods are used for initialization then this pointer is null which causes a crash downstream.

Attachments:
Size Name Date By Download
13 KiBchain_2_hinge.osim2011-10-21 10:32ysleechain_2_hinge.osim
25 KiBchain_2_hinge_muscle.osim2011-10-21 10:33ysleechain_2_hinge_muscle.osim
Field Old Value Date By
category_id1002011-10-21 17:35aymanh
assigned_tonone2011-10-21 17:35aymanh
File Added426: chain_2_hinge_muscle.osim2011-10-21 10:33yslee
File Added425: chain_2_hinge.osim2011-10-21 10:32yslee
Feedback