Browse Source

MAVLink: fixed accel and gyro sensor offsets in MAVLink

master
Andrew Tridgell 12 years ago
parent
commit
69fbcc8683
  1. 13
      APMrover2/GCS_Mavlink.pde
  2. 10
      ArduCopter/GCS_Mavlink.pde
  3. 10
      ArduPlane/GCS_Mavlink.pde

13
APMrover2/GCS_Mavlink.pde

@ -378,16 +378,21 @@ static void NOINLINE send_raw_imu1(mavlink_channel_t chan) @@ -378,16 +378,21 @@ static void NOINLINE send_raw_imu1(mavlink_channel_t chan)
static void NOINLINE send_raw_imu3(mavlink_channel_t chan)
{
Vector3f mag_offsets = compass.get_offsets();
Vector3f accel_offsets = ins.get_accel_offsets();
Vector3f gyro_offsets = ins.get_gyro_offsets();
mavlink_msg_sensor_offsets_send(chan,
mag_offsets.x,
mag_offsets.y,
mag_offsets.z,
compass.get_declination(),
0,
0,
ins.gx(), ins.gy(), ins.gz(),
ins.ax(), ins.ay(), ins.az());
0, 0,
gyro_offsets.x,
gyro_offsets.y,
gyro_offsets.z,
accel_offsets.x,
accel_offsets.y,
accel_offsets.z);
}
static void NOINLINE send_ahrs(mavlink_channel_t chan)

10
ArduCopter/GCS_Mavlink.pde

@ -442,6 +442,8 @@ static void NOINLINE send_raw_imu2(mavlink_channel_t chan) @@ -442,6 +442,8 @@ static void NOINLINE send_raw_imu2(mavlink_channel_t chan)
static void NOINLINE send_raw_imu3(mavlink_channel_t chan)
{
Vector3f mag_offsets = compass.get_offsets();
Vector3f accel_offsets = ins.get_accel_offsets();
Vector3f gyro_offsets = ins.get_gyro_offsets();
mavlink_msg_sensor_offsets_send(chan,
mag_offsets.x,
@ -450,8 +452,12 @@ static void NOINLINE send_raw_imu3(mavlink_channel_t chan) @@ -450,8 +452,12 @@ static void NOINLINE send_raw_imu3(mavlink_channel_t chan)
compass.get_declination(),
barometer.get_raw_pressure(),
barometer.get_raw_temp(),
ins.gx(), ins.gy(), ins.gz(),
ins.ax(), ins.ay(), ins.az());
gyro_offsets.x,
gyro_offsets.y,
gyro_offsets.z,
accel_offsets.x,
accel_offsets.y,
accel_offsets.z);
}
static void NOINLINE send_gps_status(mavlink_channel_t chan)

10
ArduPlane/GCS_Mavlink.pde

@ -405,6 +405,8 @@ static void NOINLINE send_raw_imu2(mavlink_channel_t chan) @@ -405,6 +405,8 @@ static void NOINLINE send_raw_imu2(mavlink_channel_t chan)
static void NOINLINE send_raw_imu3(mavlink_channel_t chan)
{
Vector3f mag_offsets = compass.get_offsets();
Vector3f accel_offsets = ins.get_accel_offsets();
Vector3f gyro_offsets = ins.get_gyro_offsets();
mavlink_msg_sensor_offsets_send(chan,
mag_offsets.x,
@ -413,8 +415,12 @@ static void NOINLINE send_raw_imu3(mavlink_channel_t chan) @@ -413,8 +415,12 @@ static void NOINLINE send_raw_imu3(mavlink_channel_t chan)
compass.get_declination(),
barometer.get_raw_pressure(),
barometer.get_raw_temp(),
ins.gx(), ins.gy(), ins.gz(),
ins.ax(), ins.ay(), ins.az());
gyro_offsets.x,
gyro_offsets.y,
gyro_offsets.z,
accel_offsets.x,
accel_offsets.y,
accel_offsets.z);
}
static void NOINLINE send_ahrs(mavlink_channel_t chan)

Loading…
Cancel
Save