system accelerations vector:

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Musa Audu
Posts: 52
Joined: Mon Nov 24, 2008 11:30 am

system accelerations vector:

Post by Musa Audu » Tue Jan 14, 2025 4:38 pm

We have a system with three degrees-of-freedom and we set out to solve for the accelerations
given the position, velocity and torque values. Our code looks like the following:

Code: Select all

	const ForceSet& fSet = model.getForceSet();
	for (i = 0; i < numActuators; i++)
	{
		ScalarActuator* act = dynamic_cast<ScalarActuator*>(&fSet.get(i));
		if (act) 
			act->setOverrideActuation(state, -jTorques[i]);
	}

	model.getMultibodySystem().realize(state, SimTK::Stage::Acceleration);
	SimTK::Vector udot = model.getMatterSubsystem().getUDot(state);

	for (i = 0; i < numActuators; i++)
		xDot[i] = udot[i];
With this code, however, we realize that the accelerations returned remain
insensitive to the applied joint torques. Can someone let us know what is
wrong with the code?

Tags:

User avatar
Nicos Haralabidis
Posts: 204
Joined: Tue Aug 16, 2016 1:46 am

Re: system accelerations vector:

Post by Nicos Haralabidis » Tue Jan 14, 2025 10:52 pm

Hey Musa,

I think before:

Code: Select all

act->setOverrideActuation(state, -jTorques[i]);
you need to include:

Code: Select all

act->overrideActuation(state,1);
Hopefully that works!

Nicos

User avatar
Musa Audu
Posts: 52
Joined: Mon Nov 24, 2008 11:30 am

Re: system accelerations vector:

Post by Musa Audu » Wed Jan 15, 2025 6:47 am

Hi Nicos,
That works perfectly. Thank you very much.

POST REPLY