Skip to content

Commit 41d9292

Browse files
committed
update to use std::tie
1 parent e3896d7 commit 41d9292

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

components/esp-box/example/main/esp_box_example.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,7 @@ extern "C" void app_main(void) {
259259
float accelRoll = atan2(accel.y, accel.z);
260260
kf.predict({float(gyro.x * M_PI / 180.0f), float(gyro.y * M_PI / 180.0f)}, dt);
261261
kf.update({accelPitch, accelRoll});
262-
auto state = kf.get_state();
263-
pitch = state[0];
264-
roll = state[1];
262+
std::tie(pitch, roll) = kf.get_state();
265263

266264
vx = sin(pitch);
267265
vy = -cos(pitch) * sin(roll);

components/icm42607/example/main/icm42607_example.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ extern "C" void app_main(void) {
150150
float accelRoll = atan2(accel.y, accel.z);
151151
kf.predict({float(gyro.x * M_PI / 180.0f), float(gyro.y * M_PI / 180.0f)}, dt);
152152
kf.update({accelPitch, accelRoll});
153-
auto state = kf.get_state();
154-
pitch = state[0];
155-
roll = state[1];
153+
std::tie(pitch, roll) = kf.get_state();
156154

157155
vx = sin(pitch);
158156
vy = -cos(pitch) * sin(roll);

0 commit comments

Comments
 (0)