From a0a18e7d160f0e2f1b0be0f44eeb961f5bfb3d30 Mon Sep 17 00:00:00 2001 From: Alaa El Jawad Date: Fri, 11 Aug 2023 11:17:17 +0200 Subject: [PATCH] use modern casting Signed-off-by: Alaa El Jawad --- src/ImuSensor.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ImuSensor.cc b/src/ImuSensor.cc index 5ae1f7ce..7cc7f8b2 100644 --- a/src/ImuSensor.cc +++ b/src/ImuSensor.cc @@ -268,7 +268,9 @@ bool ImuSensor::Update(const std::chrono::steady_clock::duration &_now) GaussianNoiseModelPtr gaussian = std::dynamic_pointer_cast( this->dataPtr->noises[noiseType]); - return (float) (gaussian->StdDev() * gaussian->StdDev()); + if (gaussian) { + return static_cast(gaussian->StdDev() * gaussian->StdDev()); + } } return 0.001f; };