Dear OpenSim Community,
I have modeled a double inverse pendulum with ankle and hip joint and designed a PD controller for it similar to the Cpp ControllerExample_Solution.cpp for the TugOfWar model in Matlab. It all works so far, but I'm facing an issue - when I compare the angle of my hip joint from motionData (of the IntegrateOpenSimPlant-function) to the data measured in Matlab (I saved angle and angular velocity at each time step in an array), I'm getting different plots. This is strange, as the data and plot of OP and Matlab match up perfectly for the ankle joint. I've included the model and plot in the attached images. Additionally, I noticed that the initial angle for the hip in motionData was 0 degrees, even though I set it to 15 degrees. This is visible in the Matlab plot.
Can anyone provide me with a hint as to why this is happening? Could it be related to my sampling time (1E-3 s)?
I would be extremely appreciative if someone could offer any advice.
Thank you,
Endale
OpenSim vs. Matlab -> different simulation results
- Endale Schilling
- Posts: 2
- Joined: Thu Sep 29, 2022 12:09 pm
OpenSim vs. Matlab -> different simulation results
- Attachments
-
- doubleInvPendulum.JPG (92.2 KiB) Viewed 257 times
-
- differentPlots.JPG (95.35 KiB) Viewed 257 times
Tags:
- Nicholas Bianco
- Posts: 1050
- Joined: Thu Oct 04, 2012 8:09 pm
Re: OpenSim vs. Matlab -> different simulation results
Hi Endale,
I'm a little confused by the following:
Best,
Nick
I'm a little confused by the following:
Are you running two different simulations in Matlab/OpenSim that you can't get to line up, or are you recording results from the same simulation that are not consistent? Is "motionData" just the output of IntegrateOpenSimPlant? How are you "measuring" the data in Matlab (i.e., are you calculating angles from the model directly)?when I compare the angle of my hip joint from motionData (of the IntegrateOpenSimPlant-function) to the data measured in Matlab (I saved angle and angular velocity at each time step in an array)
Best,
Nick