Skip to content
This repository was archived by the owner on Feb 21, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/tools/kobukiViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ if (${QT5_COMPILE} AND ${roscpp_FOUND})
)


SET(HEADERS robot/robot.h gui/gui.h gui/widget/cameraswidget.h gui/widget/controlvw.h gui/widget/glwidget.h)
SET(HEADERS robot/robot.h gui/gui.h gui/widget/cameraswidget.h gui/widget/controlvw.h)
SET(RESOURCES resources.qrc)

SET(SOURCE main.cpp depuratewindow.cpp
SET(SOURCE main.cpp
robot/actuators.cpp robot/robot.cpp robot/sensors.cpp
pioneer/pioneer.c pioneer/pioneeropengl.c
gui/gui.cpp gui/stategui.cpp gui/threadupdategui.cpp
gui/widget/cameraswidget.cpp gui/widget/controlvw.cpp gui/widget/glwidget.cpp gui/widget/laserwidget.cpp
gui/gui.cpp gui/threadupdategui.cpp
gui/widget/cameraswidget.cpp gui/widget/controlvw.cpp gui/widget/laserwidget.cpp
${HEADERS}
${RESOURCES}
)
Expand Down
39 changes: 0 additions & 39 deletions src/tools/kobukiViewer/depuratewindow.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions src/tools/kobukiViewer/depuratewindow.h

This file was deleted.

18 changes: 3 additions & 15 deletions src/tools/kobukiViewer/gui/gui.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "gui.h"

GUI::GUI(Robot* robot, StateGUI *state, Ice::CommunicatorPtr ic)
GUI::GUI(Robot* robot, Ice::CommunicatorPtr ic)
{

this->state = state;
this->robot = robot;

QGridLayout* mainLayout = new QGridLayout();
Expand All @@ -12,12 +11,10 @@ GUI::GUI(Robot* robot, StateGUI *state, Ice::CommunicatorPtr ic)


camerasWidget = new CamerasWidget(robot);
glwidget = new GLWidget(state, robot);

buttonStopRobot = new QPushButton("Stop Robot");
checkLaser = new QCheckBox("Laser");
checkCameras = new QCheckBox("Cameras");
check3DWorld = new QCheckBox("3DWorld");

InfoCurrentV = new QLabel("Current v (m/s):");
InfoCurrentW = new QLabel("Current w (rad/s):");
Expand All @@ -28,8 +25,6 @@ GUI::GUI(Robot* robot, StateGUI *state, Ice::CommunicatorPtr ic)
canvasVW->setIC(ic);
laserWidget =new LaserWidget();

depurateWindow = new DepurateWindow();
state->setDepurateWindow(depurateWindow);

int indiceFilaGui = 0;
layoutControl->addWidget(canvasVW, 0, 0);
Expand All @@ -43,9 +38,8 @@ GUI::GUI(Robot* robot, StateGUI *state, Ice::CommunicatorPtr ic)
layoutButtons->addItem(item);

layoutButtons->addWidget(buttonStopRobot, 2);
layoutButtons->addWidget(check3DWorld, 3);
layoutButtons->addWidget(checkCameras, 4);
layoutButtons->addWidget(checkLaser, 5);
layoutButtons->addWidget(checkCameras, 3);
layoutButtons->addWidget(checkLaser, 4);



Expand All @@ -64,19 +58,15 @@ GUI::GUI(Robot* robot, StateGUI *state, Ice::CommunicatorPtr ic)

connect(canvasVW, SIGNAL(VW_changed(float,float)), this, SLOT(on_update_canvas_recieved(float, float)));

connect(check3DWorld, SIGNAL(stateChanged(int)), this, SLOT(on_checks_changed()));
connect(checkLaser, SIGNAL(stateChanged(int)), this, SLOT(on_checks_changed()));
connect(checkCameras, SIGNAL(stateChanged(int)), this, SLOT(on_checks_changed()));

show();

depurateWindow->setVisible(false);

}

void GUI::on_checks_changed()
{
glwidget->setVisible(check3DWorld->isChecked());
camerasWidget->setVisible(checkCameras->isChecked());
laserWidget->setVisible(checkLaser->isChecked());
}
Expand All @@ -101,10 +91,8 @@ void GUI::updateThreadGUI()
void GUI::on_updateGUI_recieved()
{
camerasWidget->update();
glwidget->updateGL();
laserWidget->update(this->robot->getSensors()->getLaserData());
currentV->setText( QString::number(canvasVW->getV()));
currentW->setText( QString::number(canvasVW->getW()));
depurateWindow->update();
}

10 changes: 1 addition & 9 deletions src/tools/kobukiViewer/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,28 @@
#include <QtWidgets>

#include "../robot/robot.h"
#include "stategui.h"

#include "widget/controlvw.h"
#include "widget/cameraswidget.h"
#include "widget/glwidget.h"
#include "widget/laserwidget.h"

#include "../depuratewindow.h"

class GUI:public QWidget
{
Q_OBJECT

public:
GUI(Robot* robot, StateGUI* state, Ice::CommunicatorPtr ic);
GUI(Robot* robot, Ice::CommunicatorPtr ic);
void updateThreadGUI();

private:
QPushButton* buttonStopRobot;

controlVW* canvasVW;
CamerasWidget* camerasWidget;
GLWidget* glwidget;
LaserWidget* laserWidget;
DepurateWindow* depurateWindow;

Robot* robot;
StateGUI* state;

QCheckBox* check3DWorld;
QCheckBox* checkCameras;
QCheckBox* checkLaser;

Expand Down
34 changes: 0 additions & 34 deletions src/tools/kobukiViewer/gui/stategui.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions src/tools/kobukiViewer/gui/stategui.h

This file was deleted.

4 changes: 2 additions & 2 deletions src/tools/kobukiViewer/gui/threadupdategui.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "threadupdategui.h"

ThreadUpdateGUI::ThreadUpdateGUI(Robot* robot, StateGUI* state, Ice::CommunicatorPtr ic)
ThreadUpdateGUI::ThreadUpdateGUI(Robot* robot, Ice::CommunicatorPtr ic)
{
this->robot = robot;

gui = new GUI(robot, state, ic);
gui = new GUI(robot, ic);
gui->show();

}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/kobukiViewer/gui/threadupdategui.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class ThreadUpdateGUI: public QThread
{
public:
ThreadUpdateGUI(Robot *robot, StateGUI *state, Ice::CommunicatorPtr ic);
ThreadUpdateGUI(Robot *robot, Ice::CommunicatorPtr ic);

private:
GUI* gui;
Expand Down
Loading