paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Paparazzi-devel] Warning possible bug in "ins_arduimu.c"


From: Chris
Subject: [Paparazzi-devel] Warning possible bug in "ins_arduimu.c"
Date: Fri, 18 Feb 2011 17:04:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

Hi.
Today i gad another flight but as i tried to tune in the ArduIMU i found that the
pitch and roll neutral default correction angles are in radians not degrees.

In the airframe file it says:
<section name="INS" prefix="INS_">
<define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
<define name="PITCH_NEUTRAL_DEFAULT" value="3" unit="deg"/>
</section>
The units i think are not degrees but radians because in "ins_arduimu.c:

void ardu_update_state_ins( void ) {

    estimator_phi  = ArduIMU_data[0]*0.01745329252 - ins_roll_neutral;
    estimator_theta  = ArduIMU_data[1]*0.01745329252 - ins_pitch_neutral;
    float psi = ArduIMU_data[2]*0.01745329252;

RunOnceEvery(50, DOWNLINK_SEND_AHRS_EULER(DefaultChannel, &estimator_phi, &estimator_theta, &psi));
}

Inside the "ins_arduimu.c" file the imu itself sends the pitch and roll angles in degrees,
then the code converts them to radians by multiplying them with 0.01745
and finally it adds the neutrals which looks like they must be radians.
I think the above code should read:
void ardu_update_state_ins( void ) {

estimator_phi = ArduIMU_data[0]*0.01745329252 - RadOfDeg(ins_roll_neutral); estimator_theta = ArduIMU_data[1]*0.01745329252 - RadOfDeg(ins_pitch_neutral);
    float psi = ArduIMU_data[2]*0.01745329252;

RunOnceEvery(50, DOWNLINK_SEND_AHRS_EULER(DefaultChannel, &estimator_phi, &estimator_theta, &psi));
}

Any ideas?
Chris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]