mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 14:41:36 +08:00
drivers: re-use calibration topic
E.g. instead of defining a gyro_scale struct in drv_gyro.h, use the gyro_calibration message.
This commit is contained in:
@@ -1075,23 +1075,21 @@ int HMC5883::calibrate(struct file *filp, unsigned enable)
|
||||
// XXX do something smarter here
|
||||
int fd = (int)enable;
|
||||
|
||||
struct mag_scale mscale_previous = {
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.0f,
|
||||
1.0f,
|
||||
};
|
||||
struct mag_calibration_s mscale_previous;
|
||||
mscale_previous.x_offset = 0.0f,
|
||||
mscale_previous.x_scale = 1.0f,
|
||||
mscale_previous.y_offset = 0.0f,
|
||||
mscale_previous.y_scale = 1.0f,
|
||||
mscale_previous.z_offset = 0.0f,
|
||||
mscale_previous.z_scale = 1.0f,
|
||||
|
||||
struct mag_scale mscale_null = {
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.0f,
|
||||
1.0f,
|
||||
};
|
||||
struct mag_calibration_s mscale_null;
|
||||
mscale_null.x_offset = 0.0f,
|
||||
mscale_null.x_scale = 1.0f,
|
||||
mscale_null.y_offset = 0.0f,
|
||||
mscale_null.y_scale = 1.0f,
|
||||
mscale_null.z_offset = 0.0f,
|
||||
mscale_null.z_scale = 1.0f,
|
||||
|
||||
float sum_excited[3] = {0.0f, 0.0f, 0.0f};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user