@@ -108,19 +108,19 @@ extern "C" void app_main(void) {
108108 // create the IMU
109109 Imu imu (config);
110110
111- // ---------------------------------------------------------------------------
112- // [Optional] Sensor Calibration (FOC & CRT)
113- // WARNING:
114- // 1. The device must be COMPLETELY STATIONARY on a flat surface.
115- // 2. Enable these lines only when you need calibration (e.g., once after assembly).
116- // ---------------------------------------------------------------------------
117- #if CONFIG_EXAMPLE_RUN_CALIBRATION
111+ // ---------------------------------------------------------------------------
112+ // [Optional] Sensor Calibration (FOC & CRT)
113+ // WARNING:
114+ // 1. The device must be COMPLETELY STATIONARY on a flat surface.
115+ // 2. Enable these lines only when you need calibration (e.g., once after assembly).
116+ // ---------------------------------------------------------------------------
117+ #if CONFIG_EXAMPLE_RUN_CALIBRATION
118118 // Perform FOC (Fast Offset Compensation)
119119 // Note: This assumes the device is flat on a table (Z-axis = 1g)
120120 // For a real application, you might want to trigger this based on a user action
121121 // or store the offsets in NVS.
122122 std::error_code ec;
123-
123+
124124 logger.info (" Performing Accelerometer FOC..." );
125125 Imu::AccelFocGValue accel_foc_target = {.x = 0 , .y = 0 , .z = 1 , .sign = 0 }; // 1g on Z axis
126126 if (imu.perform_accel_foc (accel_foc_target, ec)) {
@@ -145,7 +145,7 @@ extern "C" void app_main(void) {
145145 } else {
146146 logger.error (" CRT failed: {}" , ec.message ());
147147 }
148- #endif
148+ #endif
149149
150150 // make a task to read out the IMU data and print it to console
151151 auto task_fn = [&](std::mutex &m, std::condition_variable &cv) -> bool {
@@ -198,7 +198,7 @@ extern "C" void app_main(void) {
198198 // print madgwick filter outputs
199199 text += fmt::format (" {:03.3f},{:03.3f},{:03.3f}," , roll, pitch, yaw);
200200 text += fmt::format (" {:03.3f},{:03.3f},{:03.3f}" , vx, vy, vz);
201-
201+
202202 fmt::print (" {}\n " , text);
203203
204204 return false ;
0 commit comments