49 " d) display offsets and scaling\n" 50 " l) level (capture offsets from level)\n" 63 if (user_input ==
'd' || user_input ==
'D') {
67 if (user_input ==
't' || user_input ==
'T') {
71 if (user_input ==
'r' || user_input ==
'R') {
84 hal.
console->
printf(
"\nAccel Offsets X:%10.8f \t Y:%10.8f \t Z:%10.8f\n",
85 (
double)accel_offsets.
x,
86 (
double)accel_offsets.
y,
87 (
double)accel_offsets.
z);
88 hal.
console->
printf(
"Accel Scale X:%10.8f \t Y:%10.8f \t Z:%10.8f\n",
89 (
double)accel_scale.
x,
90 (
double)accel_scale.
y,
91 (
double)accel_scale.
z);
92 hal.
console->
printf(
"Gyro Offsets X:%10.8f \t Y:%10.8f \t Z:%10.8f\n",
93 (
double)gyro_offsets.
x,
94 (
double)gyro_offsets.
y,
95 (
double)gyro_offsets.
z);
105 static uint8_t ins_count =
MAX(accel_count, gyro_count);
124 if (counter++ % 50 != 0) {
129 for (uint8_t ii = 0; ii < ins_count; ii++) {
132 if (ii > accel_count - 1) {
145 hal.
console->
printf(
"%u - Accel (%c) : X:%6.2f Y:%6.2f Z:%6.2f norm:%5.2f",
146 ii, state, (
double)accel.
x, (
double)accel.
y, (
double)accel.
z,
151 if (ii > gyro_count - 1) {
162 hal.
console->
printf(
" Gyro (%c) : X:%6.2f Y:%6.2f Z:%6.2f\n",
163 state, (
double)gyro.
x, (
double)gyro.
y, (
double)gyro.
z);
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
AP_HAL::UARTDriver * console
const Vector3f & get_gyro(uint8_t i) const
float get_temperature(uint8_t instance) const
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
const Vector3f & get_accel(uint8_t i) const
virtual void delay(uint16_t ms)=0
static AP_InertialSensor ins
virtual void printf(const char *,...) FMT_PRINTF(2
static AP_BoardConfig BoardConfig
const Vector3f & get_gyro_offsets(uint8_t i) const
static void display_offsets_and_scaling()
virtual uint32_t available()=0
virtual void reboot(bool hold_in_bootloader)=0
void init(uint16_t sample_rate_hz)
void wait_for_sample(void)
const Vector3f & get_accel_offsets(uint8_t i) const
uint8_t get_gyro_count(void) const
const Vector3f & get_accel_scale(uint8_t i) const
bool get_gyro_health(uint8_t instance) const
AP_HAL::Scheduler * scheduler
uint8_t get_accel_count(void) const
bool get_accel_health(uint8_t instance) const