se2ez
scene.cpp
Go to the documentation of this file.
1
/* Author: Constantinos Chamzas */
2
#include <
se2ez/core.h
>
3
#include <
se2ez/gui.h
>
4
#include <
se2ez/gui/jointpanel.h
>
5
#include <
se2ez/gui/scenepanel.h
>
6
#include <
se2ez/gui/cspacepanel.h
>
7
#include <
se2ez/gui/planpanel.h
>
8
9
using namespace
se2ez
;
10
11
int
main
(
int
argc,
char
**argv)
12
{
13
if
(argc < 2)
14
{
15
std::cout
<<
" Use [robot] [env1] ..."
<<
std::endl
;
16
return
-1;
17
}
18
19
std::vector<RobotPtr>
roboList;
20
for
(
int
i = 1; i < argc; i++)
21
roboList.
emplace_back
(
io::loadRobot
(
std::string
(argv[i])));
22
23
auto
robot = roboList[0];
24
25
std::cout
<< robot->printTree() <<
std::endl
;
26
27
QApplication a(argc, argv);
28
gui::MainWindow
gui;
29
30
// This robot is connected with the planning panel
31
gui.
addPanel
(
new
gui::JointPanel
(robot,
"Rob1"
));
32
gui.
addPanel
(
new
gui::JointPanel
(robot,
"Rob2"
));
33
34
// Add the rest of the robots in the scene
35
for
(
int
i = 1; i < argc - 1; i++)
36
{
37
auto
name =
"Env"
+
std::to_string
(i);
38
gui.
addPanel
(
new
gui::JointPanel
(roboList[i], name));
39
}
40
41
auto
scene = std::make_shared<Scene>(robot);
42
gui.
addPanel
(
new
gui::ScenePanel
(scene,
"Scene"
));
43
gui.
addPanel
(
new
gui::PlanPanel
(scene->getSceneRobot(),
"Plan"
));
44
45
// This must be called if you want to see a robot
46
gui.show();
47
return
a.exec();
48
}
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
scenepanel.h
std::to_string
T to_string(T... args)
std::endl
T endl(T... args)
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
se2ez::gui::PlanPanel
Definition:
planpanel.h:44
std::vector
se2ez::gui::JointPanel
Definition:
jointpanel.h:41
se2ez::gui::ScenePanel
Definition:
scenepanel.h:32
se2ez
Main namespace.
Definition:
collision.h:11
std::cout
gui.h
planpanel.h
main
int main(int argc, char **argv)
Definition:
scene.cpp:11
std::vector::emplace_back
T emplace_back(T... args)
script
gui
scene.cpp
Generated on Tue Mar 10 2020 10:17:50 for se2ez by
1.8.13