PX4 Firmware
PX4 Autopilot Software http://px4.io
gyro_calibration.cpp File Reference

Gyroscope calibration routine. More...

#include <px4_platform_common/px4_config.h>
#include "gyro_calibration.h"
#include "calibration_messages.h"
#include "calibration_routines.h"
#include "commander_helper.h"
#include <px4_platform_common/posix.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/time.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <math.h>
#include <string.h>
#include <drivers/drv_hrt.h>
#include <uORB/topics/sensor_combined.h>
#include <uORB/topics/sensor_correction.h>
#include <drivers/drv_gyro.h>
#include <systemlib/mavlink_log.h>
#include <parameters/param.h>
#include <systemlib/err.h>
Include dependency graph for gyro_calibration.cpp:

Go to the source code of this file.

Classes

struct  gyro_worker_data_t
 Data passed to calibration worker routine. More...
 

Functions

static calibrate_return gyro_calibration_worker (int cancel_sub, void *data)
 
int do_gyro_calibration (orb_advert_t *mavlink_log_pub)
 

Variables

static const char * sensor_name = "gyro"
 
static constexpr unsigned max_gyros = 3
 

Detailed Description

Gyroscope calibration routine.

Definition in file gyro_calibration.cpp.

Function Documentation

◆ do_gyro_calibration()

int do_gyro_calibration ( orb_advert_t mavlink_log_pub)

< sensor thermal corrections

Definition at line 218 of file gyro_calibration.cpp.

References CAL_ERROR_APPLY_CAL_MSG, CAL_ERROR_RESET_CAL_MSG, CAL_QGC_DONE_MSG, CAL_QGC_FAILED_MSG, CAL_QGC_STARTED_MSG, calibrate_cancel_subscribe(), calibrate_cancel_unsubscribe(), calibrate_return_cancelled, calibrate_return_error, calibration_log_critical, calibration_log_info, gyro_worker_data_t::device_id, device_id_primary, device_prio_max, fd, GYRO_BASE_DEVICE_PATH, gyro_calibration_worker(), sensor_correction_s::gyro_mapping, gyro_worker_data_t::gyro_report_0, gyro_worker_data_t::gyro_scale, gyro_worker_data_t::gyro_sensor_sub, GYROIOCSSCALE, mavlink_log_pub, gyro_worker_data_t::mavlink_log_pub, max_gyros, orb_copy(), orb_group_count(), ORB_ID, orb_priority(), orb_subscribe(), orb_subscribe_multi(), orb_unsubscribe(), param_find(), param_get(), param_notify_changes(), param_set_no_notification(), px4_close(), px4_ioctl(), px4_open(), gyro_worker_data_t::sensor_correction_sub, sensor_name, sensor_gyro_s::x, gyro_calibration_s::x_offset, gyro_calibration_s::x_scale, sensor_gyro_s::y, gyro_calibration_s::y_offset, gyro_calibration_s::y_scale, sensor_gyro_s::z, gyro_calibration_s::z_offset, and gyro_calibration_s::z_scale.

Referenced by commander_low_prio_loop(), and commander_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gyro_calibration_worker()

Variable Documentation

◆ max_gyros

constexpr unsigned max_gyros = 3
static

Definition at line 65 of file gyro_calibration.cpp.

Referenced by do_gyro_calibration(), and gyro_calibration_worker().

◆ sensor_name

const char* sensor_name = "gyro"
static

Definition at line 63 of file gyro_calibration.cpp.

Referenced by do_gyro_calibration().