Welcome, Guest

precision loss in Jaus messages ?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: precision loss in Jaus messages ?
#126
precision loss in Jaus messages ? 8 Months, 1 Week ago  
We have been using JAUS messages to transmit messages between underwater vehicles and I have noticed that there is a loss in precision between double that goes into a JAUS message and the double that comes out.

An example is the ReportTravelSpeed message. I have a structure that stores the message data which is then parsed into a ReportTravelSpeedMessage. I then create a generic JAUS message using

RTSMsg->speedMps = 12.3456789012;
JAUSMsg = reportTravelSpeedMessageMessageToJausMessage(RTSMsg)

If you turn that back into an RTSMsg using something like

RTSMsg_new = reportTravelSpeedMessageMessageFromJausMessage(JAUSMsg)

I have found that the

RTSMsg_new->speedMps = 12.3598077363

I have found that this is the result of the conversion the double to an unsigned short and vice versa in the jausUnsignedShortToDouble and jausUnsignedShortFromDouble routines. Apparently, this is just a fact of life in converting a 4 byte double into a 2 byte short and vice versa. I found as a test that converting to unsigned longs improves the accuracy of the conversion.

We have noticed this precision loss in all of our Jaus messages, some worse than others. I guess my question is, is this reasonable or am I doing something wrong here. It is certainly a valid question to wonder how accurately we know any real quantity underwater in a moving vehicle, but I would like to know that I am using OpenJaus correctly.

Thanks for your help and sorry the post is long. -- John
johnbogle
OpenJAUS Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#127
Re: precision loss in Jaus messages ? 8 Months, 1 Week ago  
John,

Excellent question. It sounds to me like you are using JAUS and OpenJAUS as they are intended. Yes, there is an inherent loss of data when converting the double into a scaled unsigned short value. This was chosen by the JAUS standard in order to reduce message bandwidth requirements. Please feel free to ask anymore questions that you might have.

Thanks
Tom
tgalluzzo
Admin
Posts: 83
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Copyright © 2010 OpenJAUS. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.