C++ API Visualizer
Posted: Tue Mar 20, 2018 3:03 am
Hello,
I was wondering if you could help me with the API visualizer. I have used it through the Matlab API before, but I now need it in C++ and I can't get it to work...
Here are the relevant steps in Matlab:
Then I have a loop where I update the coordinate values and muscle activations in the state (based on an external device), and I call
osim_viz.show(state);
at every iteration to display the new model position + colour of muscles. It works fine.
In C++, I've done:
If I run that, a visualizer window opens and closes very quickly, and I get a very polite message (not an error message) that says: "simbody-visualizer: received Shutdown message. Goodbye."
Any help would be greatly appreciated!
Best wishes,
Dimitra
I was wondering if you could help me with the API visualizer. I have used it through the Matlab API before, but I now need it in C++ and I can't get it to work...
Here are the relevant steps in Matlab:
Code: Select all
osimModel = Model('my_model.osim');
osimModel.setUseVisualizer(true);
state = osimModel.initSystem;
osim_viz = osimModel.updVisualizer;
osim_viz.show(state);
osim_viz.show(state);
at every iteration to display the new model position + colour of muscles. It works fine.
In C++, I've done:
Code: Select all
Model osimModel("my_model.osim");
osimModel.setUseVisualizer(true);
osimModel.buildSystem();
SimTK::State& state = osimModel.initializeState();
OpenSim::ModelVisualizer& osim_viz = osimModel.updVisualizer();
osim_viz.show(state);
Any help would be greatly appreciated!
Best wishes,
Dimitra