Page 1 of 1

obtaining imuplacer outputs via matlab API

Posted: Wed Jan 26, 2022 7:52 am
by erikwilmes
Hi All,

I would like to know if it is possible to obtain the outputs of the IMUplacer (e.g. heading correction) in matlab. I am using OpenSim 4.3 via the matlab API on a mac. When a colleague runs the exact same matlab scripts to run the IMUplacer the outputs are printed to the matlab command window. However, they are not when I try it on my mac. The IMUplacer does work since I am able to use the calibrated model generated via the IMUplacer tool in the opensim GUI.

Thanks!

Kind regards,
Erik

Re: obtaining imuplacer outputs via matlab API

Posted: Wed Jan 26, 2022 4:52 pm
by aymanh
Hello,

You can use the logging functionality introduced in version 4.2 and described below to customize/direct messages on all platforms:
https://simtk-confluence.stanford.edu/d ... gginglevel

Hope this helps,
-Ayman

Re: obtaining imuplacer outputs via matlab API

Posted: Thu Jan 27, 2022 3:05 am
by erikwilmes
Hi Ayman,

Thanks for the quick reply. Unfortunately this did not work. I got the following error when running the following code:

clear all; close all; clc;
import org.opensim.modeling.*

Logger.setLevel("Info");

Error:
No method 'org.opensim.modeling.Logger.setLevel' with matching signature found.

Error in calibrateOpenSimModelIMUs (line 22)
Logger.setLevel("Info");

Kind regards,
Erik

Re: obtaining imuplacer outputs via matlab API

Posted: Thu Jan 27, 2022 5:55 am
by tkuchida
Please see the API documentation for the "Logger" class here: https://simtk.org/api_docs/opensim/api_ ... ogger.html. The argument to the setLevel() method is of type "Level" which is an enum (not a string). It looks like Level::Info is mapped to 2 (see the "enum Level" entry under "Public Types"), so the Matlab equivalent should be Logger.setLevel(2).

Re: obtaining imuplacer outputs via matlab API

Posted: Thu Jan 27, 2022 10:08 am
by aymanh
Thanks Tom,

I'd also add that there's a setLevelString method that takes a "String" input directly.

Best regards,
-Ayman

Re: obtaining imuplacer outputs via matlab API

Posted: Fri Jan 28, 2022 5:15 am
by erikwilmes
Thanks! This worked