Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trick Logging methods cause different values to be logged #920

Open
obei10 opened this issue Dec 13, 2019 · 6 comments
Open

Trick Logging methods cause different values to be logged #920

obei10 opened this issue Dec 13, 2019 · 6 comments

Comments

@obei10
Copy link

obei10 commented Dec 13, 2019

Not sure what is happening here, but different methods of logging in trick lead to different results:
Old Method:

global DR_GROUP_ID
global drg
try:
    if DR_GROUP_ID >= 0:
        DR_GROUP_ID += 1
except NameError:
    DR_GROUP_ID = 0
    drg = []

drg.append(trick.DRBinary("state_unit"))
drg[DR_GROUP_ID].set_freq(trick.DR_Always)
drg[DR_GROUP_ID].set_cycle(GROK_LOG_CYCLE)
drg[DR_GROUP_ID].set_single_prec_only(False)
drg[DR_GROUP_ID].add_variable(   "mslUnitTest.MslAlt_args.geodetic_altitude")
drg[DR_GROUP_ID].add_variable(   "mslUnitTest.MslAlt_args.geodetic_latitude")
drg[DR_GROUP_ID].add_variable(   "mslUnitTest.MslAlt_args.longitude")
drg[DR_GROUP_ID].add_variable(   "mslUnitTest.msl_alt.mslAltitude")

trick.add_data_record_group(drg[DR_GROUP_ID], trick.DR_Buffer)
drg[DR_GROUP_ID].enable()

New Method:

recording_group_name = "test_data"
dr_group = trick.DRAscii(recording_group_name)
dr_group.set_cycle(GROK_LOG_CYCLE)
dr_group.freq = trick.DR_Always
trick.add_data_record_group(dr_group, trick.DR_Buffer)

dr_group.add_variable("mslUnitTest.MslAlt_args.geodetic_altitude")
dr_group.add_variable("mslUnitTest.MslAlt_args.geodetic_latitude")
dr_group.add_variable("mslUnitTest.MslAlt_args.longitude")
dr_group.add_variable("mslUnitTest.msl_alt.mslAltitude")

Same simulation, different logging methods delta plotted:
Screen Shot 2019-12-13 at 3 04 43 PM

@obei10
Copy link
Author

obei10 commented Dec 13, 2019

The above doesn't seem large, but it is. Below shows a MUCH larger difference as it's in meters instead of a radian compare against latitude.

Screen Shot 2019-12-13 at 3 19 49 PM

@dbankieris
Copy link
Contributor

I don't know what's up with the Java plots. I logged SIM_Ball++L1 in ASCII and binary, and the Java diff shows differences that don't match the tabular data. Koviz showed the correct diff. I think you said you tried Koviz, right?

@obei10
Copy link
Author

obei10 commented Dec 16, 2019

I didn't do a diff in Koviz, just a co plot. However, the co-plot showed the values were different as well. It wasn't just the diff showing the issues, you could see the co-plots didn't line up either.

@dbankieris
Copy link
Contributor

Are you sure your sim is deterministic? 😅

@obei10
Copy link
Author

obei10 commented Dec 16, 2019

It's a look up table with an interpolator. It's deterministic. Very simple. The data I plotted here is just the data we piped into the model for our unit test. So, this data isn't being operated on at all, just read in from a file.

@ddj116
Copy link
Contributor

ddj116 commented Dec 16, 2019

Potentially related to #862...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants