imuSensor loadparams unable to load NoiseType from json File
Show older comments
"Gyroscope": {
"MeasurementRange": 0,
"Resolution": 0.0,
"ConstantBias": [0, 0, 0],
"AxesMisalignment": [0, 0, 0],
"NoiseDensity": [0.0, 0.0, 0.0],
"BiasInstability": [0.0, 0.0, 0.0],
"RandomWalk": [0,0,0],
"NoiseType": "single-sided", (delete this line the code runs fine)
"TemperatureBias": [0.0, 0.0, 0.0],
"TemperatureScaleFactor": [0, 0, 0],
"AccelerationBias": [0, 0, 0]
},
(REAL VALUES HAVE BEEN CHANGED TO 0)
I have created a json file which I already verified is working correctly however if I try to add NoiseType: "single-sided", as a parameter it immediately throws an error saying:
>> load_IMU_JSON
Unexpected token single-sided in JSON file. All values should be numeric or 'Inf'.
Error in
pv = fusion.internal.SensorParamLoader.parseParams(...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
loadparams(s, fn, "IMU");
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Okay thats fine so lets assume then despite the documentation provided by matlab saying the parameter is "single-sided" | "double-sided" lets set it as 1 so maybe it will override the default.
This is the new error I get:
>> load_IMU_JSON
Error when constructing gyroparams. Error was : Expected NoiseType to match one of these values:
'double-sided', 'single-sided'
The input, '1', did not match any of the valid values.
Error in
gp = fusion.internal.SensorParamLoader.configureParams(gp, pv);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
loadparams(s, fn, "IMU");
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Now if I just remove NoiseType entirely the json file will load with all my other parameters correctly and I know I could simply just write the matlab code as follows:
loadparams(s, fn, "IMU");
disp(s);
s.Accelerometer.NoiseType = "single-sided";
disp(s.Accelerometer);
which would then override the double-sided however I really wanted to keep everything clean. Any tips would be greatly appreciated this is the most confusing error ever.
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!