Skip to content

Commit 9dcf81e

Browse files
authored
fix(autonomous_emergency_braking): fix invalid access to imu_ptr (#7171)
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
1 parent 566ae09 commit 9dcf81e

File tree

1 file changed

+6
-3
lines changed
  • control/autonomous_emergency_braking/src

1 file changed

+6
-3
lines changed

control/autonomous_emergency_braking/src/node.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,13 @@ bool AEB::fetchLatestData()
301301
}
302302

303303
const auto imu_ptr = sub_imu_.takeData();
304-
if (use_imu_path_ && !imu_ptr) {
305-
return missing("imu message");
304+
if (use_imu_path_) {
305+
if (!imu_ptr) {
306+
return missing("imu message");
307+
}
308+
// imu_ptr is valid
309+
onImu(imu_ptr);
306310
}
307-
onImu(imu_ptr);
308311
if (use_imu_path_ && !angular_velocity_ptr_) {
309312
return missing("imu");
310313
}

0 commit comments

Comments
 (0)