Visualizer API
Posted: Tue Jun 30, 2015 2:49 pm
Hi all,
I am trying to get the visualizer to simply show the initial position of a model
The g++ command I am using is the following:
g++ -o testmake -I./ -I/usr/local/sdk/include/ -I/usr/local/lib TugOfWar1_CreateModel.cpp -L/usr/local/sdk/include/ -l osimCommon -l osimSimulation -l osimActuators -l osimAnalyses -l osimTools
And the simple cpp file is:
The window shows up (blank) and closes immediately. I get the following in the terminal:
I then tried to call the API from python
but get the following error:
Any hints?
Thank you in advance
I am trying to get the visualizer to simply show the initial position of a model
The g++ command I am using is the following:
g++ -o testmake -I./ -I/usr/local/sdk/include/ -I/usr/local/lib TugOfWar1_CreateModel.cpp -L/usr/local/sdk/include/ -l osimCommon -l osimSimulation -l osimActuators -l osimAnalyses -l osimTools
And the simple cpp file is:
Code: Select all
//==============================================================================
# include <OpenSim/OpenSim.h>
# include </usr/local/sdk/include/Vendors/lepton/include/Lepton.h>
# include <OpenSim/Simulation/Model/ModelVisualizer.h>
using namespace OpenSim;
using namespace SimTK;
//______________________________________________________________________________
int main()
{
Model osimModel( "tugOfWar_model_ThelenOnly.osim" );
osimModel.setUseVisualizer(true);
osimModel.initSystem();
}
Code: Select all
Loaded model osimModel from file tugOfWar_model_ThelenOnly.osim
OpenSim example completed successfully.
VisualizerGUI: received Shutdown message. Goodbye.
I then tried to call the API from python
Code: Select all
from opensim import *
# import the model
osimModel = Model("tugOfWar_model_ThelenOnly.osim")
# Set the Visualizer
osimModel.setUseVisualizer(true);
# Initialize the system
si = osimModel.initSystem()
Code: Select all
osimModel.setUseVisualizer(true);
NameError: name 'true' is not defined
Thank you in advance