Skip to content

Commit f164166

Browse files
authored
Merge pull request #167 from BCLab-UNM/odom-point
Added point indicating rover location in odom frame Because it is against the rules to modify the GUI, and this is a gui only change we will merge this now.
2 parents a6224af + 65dde32 commit f164166

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/rqt_rover_gui/src/MapFrame.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,20 @@ void MapFrame::paintEvent(QPaintEvent* event) {
455455

456456
if(!display_unique_rover_colors) painter.setPen(green);
457457

458-
if (display_encoder_data) painter.drawPath(scaled_encoder_rover_path);
458+
if (display_encoder_data) {
459+
painter.drawPath(scaled_encoder_rover_path);
460+
std::pair<float, float> odom_point = map_data->getEncoderPath(rover_to_display)->back();
461+
float o_x = map_origin_x+((odom_point.first-min_seen_x)/max_seen_width)*(map_width-map_origin_x);
462+
float o_y = map_origin_y+((odom_point.second-min_seen_y)/max_seen_height)*(map_height-map_origin_y);
463+
QPen old_pen = painter.pen();
464+
QPen pen;
465+
pen.setWidth(10);
466+
pen.setColor(old_pen.color());
467+
pen.setCapStyle(Qt::RoundCap);
468+
painter.setPen(pen);
469+
painter.drawPoint(QPoint(o_x,o_y));
470+
painter.setPen(old_pen);
471+
}
459472

460473
painter.setPen(red);
461474
QPoint* point_array = &scaled_collection_points[0];

0 commit comments

Comments
 (0)