Replies: 7 comments 7 replies
-
Can you post a copy of how you're specifying your outputs? If you're outputting to a text file then it looks like by default the precision is set to 10. jsbsim/src/input_output/FGOutputTextFile.cpp Line 260 in dd97e99 However for certain categories of properties the precision is increased, e.g. jsbsim/src/input_output/FGOutputTextFile.cpp Lines 341 to 364 in dd97e99 If you specify individual properties as opposed to a category like jsbsim/src/input_output/FGOutputTextFile.cpp Lines 382 to 385 in dd97e99 |
Beta Was this translation helpful? Give feedback.
-
This topic has been moved to JSBSim Discussions as per the issue template statement: Support for this topic will therefore continue within this discussion. Thanks for your understanding. |
Beta Was this translation helpful? Give feedback.
-
@CarloBlanch1967 have you looked at the source code to confirm whether the precision is hard-coded for the UDP output option that you're using? I took a look at the source for the text output option in the comment above. |
Beta Was this translation helpful? Give feedback.
-
So for doubles the field width is hard-coded to 12 and the precision is hard-coded to 7. jsbsim/src/input_output/FGOutputSocket.cpp Lines 359 to 360 in 60041d7 jsbsim/src/input_output/FGfdmSocket.cpp Lines 338 to 350 in 60041d7 |
Beta Was this translation helpful? Give feedback.
-
Just to be clear, the only work I've done so far is to double check the existing code for the socket option to confirm if the precision is hard-coded and if so what it's currently set to. One option to allow users to set the precision used by the socket output is to add support for a new element, e.g. <output name="localhost" type="SOCKET" port="5138" protocol="UDP" rate="10" precision="8">
<property> velocities/vc-kts </property>
<property> position/h-sl-ft </property>
<property> attitude/theta-deg </property>
</output> |
Beta Was this translation helpful? Give feedback.
-
No, you've misunderstood what I was saying. I wasn't saying there is such an option currently. I was saying that one option we could implement/add "..is to add support for a new element..." is to write some code that would support this new element. So to be clear, nothing has been solved. |
Beta Was this translation helpful? Give feedback.
-
@CarloBlanch1967 I've just submitted a pull request - #579 to allow a user to optionally specify the output precision on output sockets. |
Beta Was this translation helpful? Give feedback.
-
Describe the issue
How do I increase the precision of JSBSim output directive properties?
What is the current behavior?
Precision of
position/lat-geod-deg
andposition/long-gc-deg
is very low, at around 4-5 significant figures.What is the expected behavior?
I want to increase precision to at least 16 significant figures.
Beta Was this translation helpful? Give feedback.
All reactions