Skip to content

Commit

Permalink
fix(autonomous_emergency_braking): fix invalid access to imu_ptr (aut…
Browse files Browse the repository at this point in the history
…owarefoundation#7171)

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
  • Loading branch information
soblin authored and karishma1911 committed Jun 3, 2024
1 parent 5fbfe5c commit b158aa9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions control/autonomous_emergency_braking/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,13 @@ bool AEB::fetchLatestData()
}

const auto imu_ptr = sub_imu_.takeData();
if (use_imu_path_ && !imu_ptr) {
return missing("imu message");
if (use_imu_path_) {
if (!imu_ptr) {
return missing("imu message");
}
// imu_ptr is valid
onImu(imu_ptr);
}
onImu(imu_ptr);
if (use_imu_path_ && !angular_velocity_ptr_) {
return missing("imu");
}
Expand Down

0 comments on commit b158aa9

Please sign in to comment.