Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimizing Acceleration in Predictive Cycling Motion #672

Open
ChrisD1993 opened this issue Oct 2, 2022 · 1 comment
Open

Minimizing Acceleration in Predictive Cycling Motion #672

ChrisD1993 opened this issue Oct 2, 2022 · 1 comment

Comments

@ChrisD1993
Copy link

Hello, I am trying to create a predictive model for steady state cycling. However, I am running into an issue with the acceleration of the crank. I am thinking that minimizing the crank acceleration is necessary to ensure steady state. I was attempting to use the MocoOutputGoal with the below lines of code. However, I am receiving a "bad dynamic cast" error in the solver line of the moco study.

CrankAccel = MocoOutputGoal('Crank_Acceleration',5);
CrankAccel.setOutputPath('bodyset/crank|acceleration');
CrankAccel.setDivideByDisplacement(false);
CrankAccel.setDivideByMass(false);
problem.addGoal(CrankAccel);

I do not have a lot of experience with the Opensim API so much of the above could be very wrong. Please let me know if there is a way to minimize acceleration of a particular bodyset of the model.

Error text:
Error using Cycle_Sandbox_File (line 216)
Java exception occurred:
java.lang.RuntimeException: Bad dynamic_cast!

at
org.opensim.modeling.opensimMocoJNI.MocoStudy_initCasADiSolver(Native
Method)

at
org.opensim.modeling.MocoStudy.initCasADiSolver(MocoStudy.java:229) 
@nickbianco
Copy link
Member

Hi @ChrisD1993, since you opened an issue here, I wanted first to make sure that you're using the correct version of OpenSim Moco. We've moved all development of the project to the OpenSim repo, and the latest versions of Moco can be found in the latest OpenSim downloads.

With that out of the way, I don't see anything in the code snippet you shared that would be causing a bad dynamic cast error. It looks like you have a custom model built in a sandbox file. Perhaps you could share some of that code to help debug.

If you are using the latest version of OpenSim (with Moco), then I would prefer moving this issue over to the main OpenSim repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants