Jump to content
 
JerOhm

FormatException: Input string was not in a correct format

Recommended Posts

Hi,

I'm trying to run the sample scenes for the SRWorks v9.3.0 but I keep getting this error message:

FormatException: Input string was not in a correct format.
System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Single.Parse (System.String s) (at <437ba245d8404784b9fbab9b439ac908>:0)
Vive.Plugin.SR.ViveSR_DualCameraCalibrationTool.LoadParamsValue (System.Int32 angle_index, System.Single default_value) (at Assets/ViveSR/Scripts/ViveSR_DualCameraCalibrationTool.cs:196)
Vive.Plugin.SR.ViveSR_DualCameraCalibrationTool.LoadDeviceParameter () (at Assets/ViveSR/Scripts/ViveSR_DualCameraCalibrationTool.cs:136)
Vive.Plugin.SR.ViveSR_DualCameraRig.Initial () (at Assets/ViveSR/Scripts/ViveSR_DualCameraRig.cs:179)
Vive.Plugin.SR.ViveSR.UpdateWhileWorking () (at Assets/ViveSR/Scripts/ViveSR.cs:328)
Vive.Plugin.SR.ViveSR.Update () (at Assets/ViveSR/Scripts/ViveSR.cs:175)

It looks like there is something wrong when trying to read the parameters in the calibration file.

@Daniel_Y, @reneeclchen

Share this post


Link to post
Share on other sites

Hi @JerOhm,

In SRWorks v0.9.3.0, we changed the format of this file: C:\Users\(USER NAME)\AppData\LocalLow\HTC Corporation\SR_Config\calibration_params.bin.

You may have an old .bin file, and therefore the old format, from an old version of SRWorks. Kindly delete the file. SRWorks will regenerate it in the format that can be correctly parsed.

  • Like 1

Share this post


Link to post
Share on other sites

Hi @reneeclchen,

I tried your solution and it works for the first execution after deleting the file because there is no calibration file to read. However, I still get the same error the following executions. For some reason, the format of the new calibration file still cannot be parsed. Any ideas why?

Share this post


Link to post
Share on other sites
Posted (edited)

@reneeclchen,

This is the string:

0.0,0.0,0.0,0.0,0.0,0.0

There is a weird symbol at the beginning of the string but I couldn't paste it.

Thank you!

Edited by JerOhm

Share this post


Link to post
Share on other sites

@JerOhm,

It's most likely just how Unity's binaryreader and -writer work in different machines or operation systems. 

Since the calibration tool is an old feature and will be removed in later versions, I suggest these two steps:

(1) Remove the .bin file, and

(2) In ViveSR_DualCameraCalibrationTool.cs, slash out line 159 like this:

//SaveParamValue(relative_angle, absolute_angle);

The .bin file will then not be saved or loaded. It's not used anyway.

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...