se2ez
cspace_gui.cpp
Go to the documentation of this file.
1
/* Author: Zachary Kingston */
2
3
#include <QFileDialog>
4
5
#include <
se2ez/core.h
>
6
#include <
se2ez/gui.h
>
7
#include <
se2ez/plan.h
>
8
9
#include <
se2ez/gui/jointpanel.h
>
10
#include <
se2ez/gui/planpanel.h
>
11
#include <
se2ez/gui/cspacepanel.h
>
12
13
using namespace
se2ez
;
14
15
int
main
(
int
argc,
char
**argv)
16
{
17
QApplication a(argc, argv);
18
19
std::string
filename;
20
if
(argc < 2)
21
{
22
QString tmp =
23
QFileDialog::getOpenFileName(
nullptr
,
"Open File"
, SE2EZ_YAML_DIRECTORY,
"YAML (*.yml *.yaml)"
);
24
filename = tmp.toStdString();
25
}
26
else
27
filename =
std::string
(argv[1]);
28
29
auto
robot =
io::loadRobot
(filename);
30
if
(!robot)
31
return
-1;
32
33
auto
constraints =
plan::loadConstraints
(robot, filename);
34
gui::MainWindow
gui;
35
36
gui.
addPanel
(
new
gui::CSpacePanel
(robot,
"CSpace"
, constraints));
37
gui.
addPanel
(
new
gui::JointPanel
(robot,
"Robot"
));
38
39
gui.show();
40
return
a.exec();
41
}
cspacepanel.h
se2ez::io::loadRobot
RobotPtr loadRobot(const std::string &filename)
Loads a robot from a YAML file.
Definition:
yaml.cpp:303
se2ez::gui::MainWindow
The main widget that acts a container for other widgets (canvas, panels). It also delegates the drawi...
Definition:
mainwindow.h:34
core.h
jointpanel.h
se2ez::gui::MainWindow::addPanel
void addPanel(Panel *panel)
Adds a panel to the main GUI.
Definition:
mainwindow.cpp:95
std::string
plan.h
se2ez::gui::JointPanel
Definition:
jointpanel.h:41
se2ez::plan::loadConstraints
std::map< std::string, ompl::base::ConstraintPtr > loadConstraints(const RobotPtr &robot, const std::string &filename)
Definition:
yaml.cpp:135
se2ez
Main namespace.
Definition:
collision.h:11
se2ez::gui::CSpacePanel
Definition:
cspacepanel.h:36
main
int main(int argc, char **argv)
Definition:
cspace_gui.cpp:15
gui.h
planpanel.h
script
gui
cspace_gui.cpp
Generated on Tue Mar 10 2020 10:17:50 for se2ez by
1.8.13