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 51003cea..64c7fa7e 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 @@ -136,10 +136,10 @@ inline void setMeasurementDeltaTimeOfPerceivedObject(PerceivedObject& object, co * @param value Value to set in cm * @param confidence Confidence to set cm (optional) */ -inline void setCartesianCoordinateWithConfidence(CartesianCoordinateWithConfidence& coordinate, const int32_t value, +inline void setCartesianCoordinateWithConfidence(CartesianCoordinateWithConfidence& coordinate, const int16_t value, const uint16_t confidence = CoordinateConfidence::UNAVAILABLE) { // limit value range - int32_t limited_value = std::max(CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE, + int16_t limited_value = std::max(CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE, std::min(CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE, value)); coordinate.value.value = limited_value; diff --git a/etsi_its_msgs_utils/test/impl/test_cpm_ts_access.cpp b/etsi_its_msgs_utils/test/impl/test_cpm_ts_access.cpp index b09bbfe2..d6b42417 100644 --- a/etsi_its_msgs_utils/test/impl/test_cpm_ts_access.cpp +++ b/etsi_its_msgs_utils/test/impl/test_cpm_ts_access.cpp @@ -60,7 +60,7 @@ TEST(etsi_its_cpm_ts_msgs, test_set_get_cpm) { EXPECT_NEAR(longitude, cpm_ts_access::getLongitude(cpm), 1e-7); EXPECT_NEAR(altitude, cpm_ts_access::getAltitude(cpm), 1e-2); - etsi_its_cpm_ts_msgs::msg::PerceivedObject object; + cpm_ts_msgs::PerceivedObject object; gm::Vector3 dimensions; dimensions.x = randomDouble(0.1, 25.6); dimensions.y = randomDouble(0.1, 25.6);