diff --git a/qt_pi/resources/playground.pgm b/qt_pi/resources/playground.pgm deleted file mode 100644 index f4af84d..0000000 Binary files a/qt_pi/resources/playground.pgm and /dev/null differ diff --git a/qt_pi/resources/resources.qrc b/qt_pi/resources/resources.qrc index 4a04629..a8bbdea 100644 --- a/qt_pi/resources/resources.qrc +++ b/qt_pi/resources/resources.qrc @@ -4,6 +4,5 @@ shaders/blink.vert shaders/map.vert shaders/map.frag - playground.pgm diff --git a/qt_pi/src/speller.cpp b/qt_pi/src/speller.cpp index c72630b..cf1aa35 100644 --- a/qt_pi/src/speller.cpp +++ b/qt_pi/src/speller.cpp @@ -66,24 +66,27 @@ void Speller::classify(int len, struct insight_data *buf) { void Speller::reconfigure_map(int result, int shape) { int w = area_displayed->width(); int h = area_displayed->height(); + int x = area_displayed->x(); + int y = area_displayed->y(); + switch (shape) { case SQUARE: switch (result) { case TOP_LEFT: - area_displayed->setWidth(w / 1.9); - area_displayed->setY(h * 0.9 / 1.9); + area_displayed->setWidth(w / 1.8); + area_displayed->setY(y + h / 1.8); break; case TOP_RIGHT: - area_displayed->setX(w * 0.9 / 1.9); - area_displayed->setY(h * 0.9 / 1.9); + area_displayed->setX(x + w / 1.8); + area_displayed->setY(y + h / 1.8); break; case BOTTOM_LEFT: - area_displayed->setHeight(h / 1.9); - area_displayed->setWidth(w / 1.9); + area_displayed->setHeight(h / 1.8); + area_displayed->setWidth(w / 1.8); break; case BOTTOM_RIGHT: - area_displayed->setHeight(h / 1.9); - area_displayed->setX(w * 0.9 / 1.9); + area_displayed->setHeight(h / 1.8); + area_displayed->setX(x + w / 1.8); break; } break; @@ -91,11 +94,11 @@ void Speller::reconfigure_map(int result, int shape) { switch (result) { case TOP_LEFT: case BOTTOM_LEFT: - area_displayed->setWidth(w / 1.9); + area_displayed->setWidth(w / 1.8); break; case TOP_RIGHT: case BOTTOM_RIGHT: - area_displayed->setX(w * 0.9 / 1.9); + area_displayed->setX(x + w / 1.8); break; } break; @@ -103,11 +106,11 @@ void Speller::reconfigure_map(int result, int shape) { switch (result) { case TOP_LEFT: case TOP_RIGHT: - area_displayed->setY(h * 0.9 / 1.9); + area_displayed->setY(h + h / 1.8); break; case BOTTOM_LEFT: case BOTTOM_RIGHT: - area_displayed->setHeight(h / 1.9); + area_displayed->setHeight(h / 1.8); break; } break; @@ -190,8 +193,7 @@ __inline__ void Speller::init_ros() { } curr_map = new QImage(map_tex_buffer, map.info.width, map.info.height, 3 * map.info.width, QImage::Format_RGB888); - area_displayed = new QRect(QPoint(0, 0), QSize(curr_map->size().height() / 2, - curr_map->size().width())); + area_displayed = new QRect(QPoint(0, 0), curr_map->size()); } void Speller::poseCB(nav_msgs::Odometry::ConstPtr &msg) {