Search found 210 matches

by Nicos Haralabidis
Thu Feb 27, 2025 7:54 pm
Forum: OpenSim
Topic: Set control and state and compute derivative
Replies: 2
Views: 361

Re: Set control and state and compute derivative

Hello again Aaron, I have a somewhat non-elegant solution to the controls problem I think. It involves adding a PrescribedController together with all the actuators you have in your model, then prior to computing the state derivatives you set the control values for each actuator. In the code below i...
by Nicos Haralabidis
Thu Feb 27, 2025 4:52 pm
Forum: OpenSim
Topic: Set control and state and compute derivative
Replies: 2
Views: 361

Re: Set control and state and compute derivative

Hello Aaron I think your problem line is related to: State.updQ()[j] = states[i,j] I don't think updQ lets you update/set the state variables I just tried (1.2 is arbitrary, but set it to the given state's value): model.setStateVariableValue(state, stateNames.get(j), 1.2) You can then compute the st...
by Nicos Haralabidis
Mon Feb 24, 2025 12:21 pm
Forum: OpenSim
Topic: Path Actuator Definition
Replies: 1
Views: 200

Re: Path Actuator Definition

Hello Josee!

Have you tried to take a look at the Path Actuator definition here: https://github.com/opensim-org/opensim- ... tuator.cpp

Perhaps you can share some code snippets too, that will help!

Thanks,

Nicos
by Nicos Haralabidis
Mon Feb 24, 2025 11:59 am
Forum: OpenSim
Topic: Inconsistent Static Optimization Results: API vs GUI
Replies: 2
Views: 611

Re: Inconsistent Static Optimization Results: API vs GUI

Hello Leon!

Could you share your files etc? I will try to reproduce.

Thanks,

Nicos
by Nicos Haralabidis
Sat Feb 22, 2025 6:38 pm
Forum: OpenSim
Topic: Angular momentum issue
Replies: 2
Views: 220

Re: Angular momentum issue

Hello Jintao! To get the angular velocity of a body you can use getAngularVelocity https://simtk.org/api_docs/opensim/api_docs/classOpenSim_1_1SimbodyEngine.html#a2146fdaf259440e2f8e2d893fa89daae or getVelocityInGround https://simtk.org/api_docs/opensim/api_docs/classOpenSim_1_1Frame.html#a74bf67886...
by Nicos Haralabidis
Wed Feb 19, 2025 12:08 pm
Forum: OpenSim
Topic: Unable to Visualise GRF data from the mot file
Replies: 2
Views: 307

Re: Unable to Visualise GRF data from the mot file

Hello Arjun,

I think the problem is that your COP values are still in millimeters, but the software expects the values in meters.

Hopefully that fixes things.

Thanks,

Nicos
by Nicos Haralabidis
Thu Jan 16, 2025 10:56 pm
Forum: OpenSim
Topic: Obtaining body rotation matrices in a loop
Replies: 3
Views: 2148

Re: Obtaining body rotation matrices in a loop

Hey Mohsen, Before realizing to the position stage you need to set the states (coordinates in this case) for each time frame, currently you are only extracting them from your *.mot file. Take a look at the following methods: https://simtk.org/api_docs/opensim/api_docs/classOpenSim_1_1Component.html#...
by Nicos Haralabidis
Wed Jan 15, 2025 4:26 pm
Forum: OpenSim
Topic: Linear Movement of a Ball
Replies: 4
Views: 247

Re: Linear Movement of a Ball

Hello Kardelen, To set the state variables for a coordinate you would do something as follows (roughly): model = Model(); state = model.initSystem(); X = [1 0]; % getting the 0th coordinate in the model, setting its value and speed model.getCoordinateSet.get(0).setValue(state,X(1)); model.getCoordin...
by Nicos Haralabidis
Tue Jan 14, 2025 10:52 pm
Forum: OpenSim
Topic: system accelerations vector:
Replies: 2
Views: 952

Re: system accelerations vector:

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
by Nicos Haralabidis
Tue Jan 14, 2025 12:18 pm
Forum: OpenSim
Topic: Inverse Dynamics top-down approach
Replies: 2
Views: 1058

Re: Inverse Dynamics top-down approach

Hello Alexander, Here are a couple of articles that fairly recently touched upon the points you raised in your post (hopefully they help!): [1] https://link.springer.com/article/10.1007/s11044-021-09808-7 [2] https://www.sciencedirect.com/science/article/abs/pii/S0021929024003087 [3] https://link.sp...