diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-23 20:45:28 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-23 20:45:28 +0200 |
commit | b07de1379d1636847148e3052c055c9396ef8f4f (patch) | |
tree | fd30154431330e14695f9ee5f41fd4f29f7d73ef /apps/commander/commander.c | |
parent | 112cd4a95b0b0c5920b68e8c8db1e83b72e14fa8 (diff) | |
download | px4-firmware-b07de1379d1636847148e3052c055c9396ef8f4f.tar.gz px4-firmware-b07de1379d1636847148e3052c055c9396ef8f4f.tar.bz2 px4-firmware-b07de1379d1636847148e3052c055c9396ef8f4f.zip |
moved commander to new param interface
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r-- | apps/commander/commander.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 75946fb24..e89dae983 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -406,9 +406,17 @@ void do_mag_calibration(int status_pub, struct vehicle_status_s *status) mag_offset[1] = (max_avg[1] + min_avg[1]) / 2.0f; mag_offset[2] = (max_avg[2] + min_avg[2]) / 2.0f; - global_data_parameter_storage->pm.param_values[PARAM_SENSOR_MAG_XOFFSET] = mag_offset[0]; - global_data_parameter_storage->pm.param_values[PARAM_SENSOR_MAG_YOFFSET] = mag_offset[1]; - global_data_parameter_storage->pm.param_values[PARAM_SENSOR_MAG_ZOFFSET] = mag_offset[2]; + if (param_set(param_find("SENSOR_MAG_XOFF"), &(mag_offset[0]))) { + fprintf(stderr, "[commander] Setting X mag offset failed!\n"); + } + + if (param_set(param_find("SENSOR_MAG_YOFF"), &(mag_offset[1]))) { + fprintf(stderr, "[commander] Setting Y mag offset failed!\n"); + } + + if (param_set(param_find("SENSOR_MAG_ZOFF"), &(mag_offset[2]))) { + fprintf(stderr, "[commander] Setting Z mag offset failed!\n"); + } free(mag_maxima[0]); free(mag_maxima[1]); |