40 #include <opencv2/core/core.hpp> 50 position_tolerance_(0.0),
52 covariance_checked_(false),
55 buffer_holder_(false),
57 static_arrow_sizes_(false),
72 icon.fill(Qt::transparent);
74 QPainter painter(&icon);
75 painter.setRenderHint(QPainter::Antialiasing,
true);
82 pen.setCapStyle(Qt::RoundCap);
84 painter.drawPoint(8, 8);
89 pen.setCapStyle(Qt::FlatCap);
91 painter.drawLine(1, 14, 14, 1);
96 pen.setCapStyle(Qt::SquareCap);
98 painter.drawLine(2, 13, 13, 2);
99 painter.drawLine(13, 2, 13, 8);
100 painter.drawLine(13, 2, 7, 2);
114 if (style ==
"lines")
118 else if (style ==
"points")
122 else if (style ==
"arrows")
156 bool transformed =
true;
199 if (((std::fabs(check.
x()) <= 3) && (std::fabs(check.
y()) <= 3)) &&
212 if (((std::fabs(check.
x()) > 25) && (std::fabs(check.
y()) > 25)) &&
226 glBegin(GL_LINE_STRIP);
234 std::list<StampedPoint>::iterator it =
points_.begin();
235 for (; it !=
points_.end(); ++it)
237 success &= it->transformed;
240 glVertex2d(it->transformed_point.getX(), it->transformed_point.getY());
285 std::list<StampedPoint>::iterator it =
points_.begin();
286 for (; it !=
points_.end(); ++it)
326 double arrow_width = size / 5.0;
327 double head_length = size * 0.75;
338 for (uint32_t i = 0; i < point.
cov_points.size(); i++)
354 bool transformed =
false;
356 std::list<StampedPoint>::iterator points_it =
points_.begin();
357 for (; points_it !=
points_.end(); ++points_it)
363 if (
laps_.size() > 0)
365 for (
size_t i = 0; i <
laps_.size(); i++)
367 std::list<StampedPoint>::iterator lap_it =
laps_[i].begin();
368 for (; lap_it !=
laps_[i].end(); ++lap_it)
374 if (!
points_.empty() && !transformed)
383 bool transformed =
points_.size() != 0;
386 QColor base_color =
color_;
387 if (
laps_.size() != 0)
389 for (
size_t i = 0; i <
laps_.size(); i++)
395 glBegin(GL_LINE_STRIP);
403 std::list<StampedPoint>::iterator it =
laps_[i].begin();
404 for (; it !=
laps_[i].end(); it++)
408 glVertex2d(it->transformed_point.getX(),
409 it->transformed_point.getY());
419 glBegin(GL_LINE_STRIP);
427 glColor4d(base_color.redF(), base_color.greenF(), base_color.blueF(), 0.5);
431 std::list<StampedPoint>::iterator it =
points_.begin();
432 for (; it !=
points_.end(); ++it)
434 transformed &= it->transformed;
437 glVertex2d(it->transformed_point.getX(),
438 it->transformed_point.getY());
449 int hue =
static_cast<int>(
color_.hue() + (i + 1.0) * 10.0 * M_PI);
454 int sat =
color_.saturation();
456 base_color.setHsv(hue, sat, v);
457 glColor4d(base_color.redF(), base_color.greenF(), base_color.blueF(),
463 bool success =
laps_.size() != 0 &&
points_.size() != 0;
466 QColor base_color =
color_;
467 if (
laps_.size() != 0)
469 for (
size_t i = 0; i <
laps_.size(); i++)
472 std::list<StampedPoint>::iterator it =
laps_[i].begin();
473 for (; it !=
laps_[i].end(); ++it)
475 glBegin(GL_LINE_STRIP);
482 int hue =
static_cast<int>(
color_.hue() +
laps_.size() * 10.0 * M_PI);
483 int sat =
color_.saturation();
485 base_color.setHsv(hue, sat, v);
486 glColor4d(base_color.redF(), base_color.greenF(), base_color.blueF(),
492 std::list<StampedPoint>::iterator it =
points_.begin();
493 for (; it !=
points_.end(); ++it)
495 glBegin(GL_LINE_STRIP);
bool GetTransform(const ros::Time &stamp, swri_transform_util::Transform &transform, bool use_latest_transforms=true)
std::vector< tf::Point > cov_points
tf::Point transformed_arrow_right
void transform(Route &route, const swri_transform_util::Transform &transform, const std::string &target_frame)
virtual void PositionToleranceChanged(double value)
virtual void SetArrowSize(int arrowSize)
tf::Point transformed_arrow_point
virtual bool DrawPoints(double scale)
virtual void UpdateColor(QColor base_color, int i)
TFSIMD_FORCE_INLINE const tfScalar & getY() const
std::string target_frame_
tf::Point transformed_point
virtual bool DrawArrows()
virtual bool DrawLapsArrows()
TFSIMD_FORCE_INLINE const tfScalar & x() const
double position_tolerance_
TFSIMD_FORCE_INLINE const tfScalar & y() const
virtual void BufferSizeChanged(int value)
std::vector< std::list< StampedPoint > > laps_
virtual void SetColor(const QColor &color)
virtual void SetStaticArrowSizes(bool isChecked)
virtual bool DrawArrow(const StampedPoint &point)
virtual void CollectLaps()
std::vector< tf::Point > transformed_cov_points
TFSIMD_FORCE_INLINE const tfScalar & getX() const
tf::Point transformed_arrow_left
virtual void SetDrawStyle(QString style)
tf::Quaternion orientation
virtual bool TransformPoint(StampedPoint &point)
virtual void PrintError(const std::string &message)=0
std::list< StampedPoint > points_