nidas  v1.2-1520
Functions
TiltSensor.cc File Reference
#include "TiltSensor.h"
#include <sstream>
#include <nidas/util/Logger.h>

Functions

float decode_angle (const signed char *dp)
 The data packet will consist of. More...
 

Function Documentation

float decode_angle ( const signed char *  dp)
inline

The data packet will consist of.

a header byte (255); two bytes of pitch angle information, MSB first; two bytes of roll angle information, MSB first; and a checksum.

The checksum is calculated as: sum the bytes between the header and checksum byte (four bytes total); divide by 256; the remainder is the checksum.

The angle information is represented as a 2's complement signed 16 bit integers in the range +32,768 to -32,768.

If you refer to the data sheet for CXTILT02, you will notice that 32,768 represents 90 deg and hence the correct equation for conversion would be,

Pitch or Roll = (msb x 256 + lsb)*90/2^15


Case Reference #00002361

Type: Inertial Sub Type: Tilt Sensors Case Reason: Installation and Operation Date Created: 11/30/2006 Last Updated: 12/4/2006

Subject:

+/- sign in AccelView are opposite what the serial message seems to suggest from CXTILT

Question:

If I run the AccelView software with our CXTILT02 sensor, it reports in the Tilt window the pitch is about -1.22 and roll about 0.55. However, if I look at the serial data, it looks like the signs should be the opposite:

ff 01 bb ff 2e e9

In this message, 01 bb is the pitch, and that number is positive right? Likewise the roll is ff 2e, which is negative. Is there an explanation for this discrepancy? Thanks.

Response:

We have verified this behavior in house and it appears as though the data sheet is incorrect. You can simply multiply the end result values by -1 to obtain the correct values. Accel-View does appear to be providing correct roll and pitch values in conjunction with the orientation of theunit. We apologize for the error and will be making a correction shortly.

Sincerely,

Mike Smith Crossbow Technology, Inc www.xbow.com

Referenced by nidas::dynld::iss::TiltSensor::process().