Skip to content

Commit

Permalink
LineStripMarker: ignore invalid points (#1440)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke authored Oct 27, 2019
1 parent e49a544 commit 5805917
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/rviz/default_plugin/markers/line_strip_marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "marker_selection_handler.h"
#include "rviz/default_plugin/marker_display.h"
#include "rviz/display_context.h"
#include <rviz/validate_floats.h>

#include <rviz/ogre_helpers/billboard_line.h>

Expand Down Expand Up @@ -90,11 +91,23 @@ void LineStripMarker::onNewMessage(const MarkerConstPtr& old_message, const Mark
const geometry_msgs::Point& p = *it;

Ogre::Vector3 v( p.x, p.y, p.z );
if (!validateFloats(p))
{
ROS_WARN("Marker '%s/%d': invalid point[%zu] (%.2f, %.2f, %.2f)",
new_message->ns.c_str(), new_message->id, i, p.x, p.y, p.z);
continue;
}

Ogre::ColourValue c;
if (has_per_point_color)
{
const std_msgs::ColorRGBA& color = new_message->colors[i];
if (!validateFloats(color))
{
ROS_WARN("Marker '%s/%d': invalid color[%zu] (%.2f, %.2f, %.2f, %.2f)",
new_message->ns.c_str(), new_message->id, i, color.r, color.g, color.b, color.a);
continue;
}
c.r = color.r;
c.g = color.g;
c.b = color.b;
Expand Down

0 comments on commit 5805917

Please sign in to comment.