Skip to content

Commit

Permalink
fix(autonomous_emergency_braking): fix invalid access to imu_ptr
Browse files Browse the repository at this point in the history
Signed-off-by: Mamoru Sobue <[email protected]>
  • Loading branch information
soblin committed May 30, 2024
1 parent 6e5d597 commit 323ec98
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 323ec98

Please sign in to comment.