Hi,
I was wondering if there's a simple syntax for printing something to the 'messages' screen of the OpenSim GUI. I'm writing a plugin and just want to be able to see the function outputs (e.g. positions, rotations, etc) as I run things for error checking (without having to print them to an external .sto/.mot file).
Essentially, I'm just looking for something along the lines of:
computeMotion(const SimTK::State& s) const
{
stuffstuffstuff computationscomputationscomputations
--> print to the messages window what dq is before 'return dq;' <--
return dq;
}
It seems simple enough, but I don't know what appropriate syntax for it since I can't seem to find an example of a code snippet that does it.
Thanks!
adila
sample code for printing to Messages screen
- Nur Adila Faruk Senan
- Posts: 75
- Joined: Tue Apr 06, 2010 8:20 pm
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
RE: sample code for printing to Messages screen
Hi Adila,
The GUI takes over whatever is printed out to the stdout and/or stderr, so on the C++ side you just need to cout whatever message you want as in
cout << "My message" << endl;
Hope this helps,
-Ayman
The GUI takes over whatever is printed out to the stdout and/or stderr, so on the C++ side you just need to cout whatever message you want as in
cout << "My message" << endl;
Hope this helps,
-Ayman
- Nur Adila Faruk Senan
- Posts: 75
- Joined: Tue Apr 06, 2010 8:20 pm
RE: sample code for printing to Messages screen
hey Ayman,
Thanks for the quick reply. I tried what you said -- e.g. cout<< "X_FM is" << X_FM <<endl; -- rebuild, reinstall, rerun, but nothing is printing to screen. I'm seeing this message though which I don't think was there before:
WARNING: UNSUPPORTED Trying to load a file from a more recent version of OpenSim.
Extra attributes, if any, will be ignored.WARNING: UNSUPPORTED Trying to load a file from a more recent version of OpenSim.
All I added in though was the cout message.
Thanks,
adila
All I added in though was the cout message.
Thanks,
adila
Thanks for the quick reply. I tried what you said -- e.g. cout<< "X_FM is" << X_FM <<endl; -- rebuild, reinstall, rerun, but nothing is printing to screen. I'm seeing this message though which I don't think was there before:
WARNING: UNSUPPORTED Trying to load a file from a more recent version of OpenSim.
Extra attributes, if any, will be ignored.WARNING: UNSUPPORTED Trying to load a file from a more recent version of OpenSim.
All I added in though was the cout message.
Thanks,
adila
All I added in though was the cout message.
Thanks,
adila
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
Re: sample code for printing to Messages screen
Hi Guys,
This may be slightly different, but we are planning to batch process a bunch of trials and wanted to use the residuals from the IK process as a metric, i.e total error or marker specific errors above some threshold gets flagged.
Is it possible to access the message window results from various tools (static scale, IK, ID) from Matlab?
Many thanks for any help.
David
This may be slightly different, but we are planning to batch process a bunch of trials and wanted to use the residuals from the IK process as a metric, i.e total error or marker specific errors above some threshold gets flagged.
Is it possible to access the message window results from various tools (static scale, IK, ID) from Matlab?
Many thanks for any help.
David