Skip to content

Commit

Permalink
use modern casting
Browse files Browse the repository at this point in the history
Signed-off-by: Alaa El Jawad <[email protected]>
  • Loading branch information
ejalaa12 committed Aug 11, 2023
1 parent f9885a8 commit a0a18e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ImuSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ bool ImuSensor::Update(const std::chrono::steady_clock::duration &_now)
GaussianNoiseModelPtr gaussian =
std::dynamic_pointer_cast<GaussianNoiseModel>(
this->dataPtr->noises[noiseType]);
return (float) (gaussian->StdDev() * gaussian->StdDev());
if (gaussian) {
return static_cast<float>(gaussian->StdDev() * gaussian->StdDev());
}
}
return 0.001f;
};
Expand Down

0 comments on commit a0a18e7

Please sign in to comment.