I'd like to replace imu of ardupilot mega 2.5 by another rs232 imu. Can you help me?
Hello, everyone
I'm new here. I'm stay in Thailand (asia).
I'd like to replace imu of ardupilot mega 2.5 by another rs232 imu. Can you help me?
I've a questions. Where are variable -> roll, pitch, yaw that I can replace for my new imu.
I don't know where to replace or force the variable for my new imu.
-------------------------------------------------------------------------------------------------------------
At first i try to edit the value from AP_AHRS library.
in AP_AHRS_MPU6000.cpp
...
AP_AHRS_MPU6000::euler_angles(void)
{
//_dcm_matrix.to_euler(&roll, &pitch, &yaw);
--> force roll as 0.785 rad or 45 degree _dcm_matrix.to_euler(0.785, &pitch, &yaw);
// cannot use this because the quaternion is not correct for yaw drift
//quaternion.to_euler(&roll, &pitch, &yaw);
roll_sensor = degrees(roll) * 100;
--> force pitch as 45 degree pitch_sensor = 450;
yaw_sensor = degrees(yaw) * 100;
if (yaw_sensor < 0)
yaw_sensor += 36000;
}
...
and in another file
APM_AHRS_DCM.cpp
...
AP_AHRS_DCM::euler_angles(void)
{
//_dcm_matrix.to_euler(&roll, &pitch, &yaw);
--> force roll as 0.785 rad or 45 degree _dcm_matrix.to_euler(0.785, &pitch, &yaw);
roll_sensor = degrees(roll) * 100;
--> force pitchas 45 degree pitch_sensor = 450;
yaw_sensor = degrees(yaw) * 100;
if (yaw_sensor < 0)
yaw_sensor += 36000;
}
...
Then I burned code on arduipilot and test imu response via mission planner.
The imu response still normal, the value don't offset by my code.
Please help me.
Can everyone sugguest me where roll, pitch, yaw that I can replace my new imu value.
Thank you for your attention
UUasin
Replies