From 01199c928943296a33f4a8b786a127646bd806ac Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Thu, 10 Oct 2024 12:43:03 +0000 Subject: [PATCH] fix wrong data type in cpm setters --- .../include/etsi_its_msgs_utils/impl/cpm/cpm_ts_setters.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etsi_its_msgs_utils/include/etsi_its_msgs_utils/impl/cpm/cpm_ts_setters.h b/etsi_its_msgs_utils/include/etsi_its_msgs_utils/impl/cpm/cpm_ts_setters.h index 21743c8c..a43a1629 100644 --- a/etsi_its_msgs_utils/include/etsi_its_msgs_utils/impl/cpm/cpm_ts_setters.h +++ b/etsi_its_msgs_utils/include/etsi_its_msgs_utils/impl/cpm/cpm_ts_setters.h @@ -149,10 +149,10 @@ inline void setMeasurementDeltaTimeOfPerceivedObject(PerceivedObject& object, co * @param value The value to be set in centimeters. * @param confidence The confidence to be set in centimeters (default: CoordinateConfidence::UNAVAILABLE). */ -inline void setCartesianCoordinateWithConfidence(CartesianCoordinateWithConfidence& coordinate, const int16_t value, +inline void setCartesianCoordinateWithConfidence(CartesianCoordinateWithConfidence& coordinate, const int32_t value, const uint16_t confidence = CoordinateConfidence::UNAVAILABLE) { // limit value range - int16_t limited_value = std::max(CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE, + int32_t limited_value = std::max(CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE, std::min(CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE, value)); coordinate.value.value = limited_value;