polyvertex/fitdecode

"raw_value" instead of "value" with frame.get_value()

lilian-jc opened this issue · 0 comments

Hello,
I'd to work with .fit files. Until now, i' didn't know anything about this file format, so I've used your command line tool to decode one into a .json file.
It worked well, and i've got my .json file, which include among other things the wanted "value" field in each "data-message":
image

Then I've worked on its implementation in my python script, but then, as mentioned in the title, the only value that I can access is the "raw_value" field for two of the value I want to access (see below the code snippet).
I've tried with all the method provided by your lib: .get_value(), .get_values(), .get_filed() and .get_fields(), and the result still the same.
Btw, here is my code:

with fitdecode.FitReader("./test/data//received.fit") as fit_data:
            for frame in fit_data:
                if frame.frame_type == fitdecode.FIT_FRAME_DATA and frame.name == "record":
                        track_point = {}
                        track_point["TMSTP"] =  str(frame.get_value(field_name_or_num = "timestamp"))
                        track_point["LON"] = frame.get_value(field_name_or_num = "position_long")
                        track_point["LAT"] = frame.get_value(field_name_or_num = "position_lat")
                        print(track_point)

An important thing to notice is the returned value of the print:
{'TMSTP': '2023-10-31 08:12:46+00:00', 'LON': -13841606, 'LAT': 550477726}
As we can see, the timestamp value is the right one (not the "raw_value"), but that's not the case for the following "position_long" and "position_lat" value.

Any idea what's the issue?
Thanks,

PS: I've got each time the following warning message:
"UserWarning: 'field "native_field_num" (idx #0) not found in message "field_description"' (local_mesg_num: 0; chunk_offset: 86); adding dummy dev data...".
But according to your docs, it's not worth paying attention most of the time.