Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

FIT SDK java.com.garmin.fit.plugins question

Rank

Total Posts: 7

Joined 2017-03-15

PM

The plugin "ThreeDSensorAdjustmentPlugin.java" has a method "onBroadcast()" that calculates a calibrated value for each raw data value obtained from the sensors: Accelerometer, Gyroscope and Magnetometer. It pass the calibrated values to a function "processCalibratedFactor()" that I believe writes the results to a CSV file that is decoded from a FIT file. The resultant CSV file created using the "ThreeDSensorAdjustmentPluginExample.java", however, only contains data for the Accelerometer and Gyroscope even though valid calibrated values for the Magnetometer are passed to the "processCalibratedFactorI()" function. Is anyone aware of this being a known problem or why it happens? I think the problem must lie within the onMesg() function in MesgBroadcaster.java because I can "comment out" the call to "onBroadcast()" in BufferedMesgBroadcaster.java with the only side effect being that calibrated values are not written to the CSV file, but it still only contains messages for the Accelerometer and Gyroscope.      
RankRankRank

Total Posts: 68

Joined 0

PM

Looks like the ThreeDSensorAdjustmentExample class is incomplete.

In the ThreeDSensorAdjustmentExample class you need to implement the MagnetometerDataMesgListener interface and add the example as a Listener on the broadcaster.

     
Rank

Total Posts: 7

Joined 2017-03-15

PM

Caufield,

I also had to add "public void onMesg(MagnetometerDataMesg){mesgWriter.onMesg(mesg)}" and that along with your fixes did the trick. You really must know your way around these files, I find navigating them to be a daunting task!

Thanks again for your assistance.

Randy