Skip to content

Commit 65dde32

Browse files
committed
Added point indicating rover location in odom frame
the point is only visible when odom is selected and is displayed in the same color as the robot's odom track.
1 parent 9c818f3 commit 65dde32

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)