From 1e60d49ad6f9ec321eeb078370ffa835426606b5 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Mon, 12 Aug 2019 17:23:01 +0200 Subject: [PATCH 1/2] validateFloats: check against Ogre::Real Ogre::Real might be float or double. Both types have different ranges. --- src/rviz/validate_floats.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/rviz/validate_floats.h b/src/rviz/validate_floats.h index 60931ac72e..4184937057 100644 --- a/src/rviz/validate_floats.h +++ b/src/rviz/validate_floats.h @@ -46,12 +46,7 @@ namespace rviz { -inline bool validateFloats(float val) -{ - return !(std::isnan(val) || std::isinf(val)); -} - -inline bool validateFloats(double val) +inline bool validateFloats(Ogre::Real val) { return !(std::isnan(val) || std::isinf(val)); } From c128dad317d7a50f614fb674bceb25fcf45f57da Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Mon, 12 Aug 2019 17:24:06 +0200 Subject: [PATCH 2/2] ShapeMarker: consider failure return value of transform() --- src/rviz/default_plugin/markers/shape_marker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rviz/default_plugin/markers/shape_marker.cpp b/src/rviz/default_plugin/markers/shape_marker.cpp index 25c98c2713..3e81fb16e8 100644 --- a/src/rviz/default_plugin/markers/shape_marker.cpp +++ b/src/rviz/default_plugin/markers/shape_marker.cpp @@ -81,7 +81,8 @@ void ShapeMarker::onNewMessage( const MarkerConstPtr& old_message, Ogre::Vector3 pos, scale, scale_correct; Ogre::Quaternion orient; - transform(new_message, pos, orient, scale); + if (!transform(new_message, pos, orient, scale)) + return; if (owner_ && (new_message->scale.x * new_message->scale.y * new_message->scale.z == 0.0f))