Fawkes API
Fawkes Development Version
navgraph_generator_plugin.cpp
1
2
/***************************************************************************
3
* navgraph_generator_plugin.cpp - Graph-based global path planning
4
*
5
* Created: Mon Feb 09 17:34:21 2015
6
* Copyright 2015 Tim Niemueller [www.niemueller.de]
7
****************************************************************************/
8
9
/* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU Library General Public License for more details.
18
*
19
* Read the full text in the LICENSE.GPL file in the doc directory.
20
*/
21
22
#include "navgraph_generator_thread.h"
23
24
#include <core/plugin.h>
25
#ifdef HAVE_VISUALIZATION
26
# include "visualization_thread.h"
27
#endif
28
29
using namespace
fawkes
;
30
31
/** Plugin to generate navgraphs based on given parameters.
32
* @author Tim Niemueller
33
*/
34
class
NavGraphGeneratorPlugin
:
public
fawkes::Plugin
35
{
36
public
:
37
/** Constructor.
38
* @param config Fawkes configuration
39
*/
40
explicit
NavGraphGeneratorPlugin
(
Configuration
*config) :
Plugin
(config)
41
{
42
#ifdef HAVE_VISUALIZATION
43
bool
use_vis =
false
;
44
try
{
45
use_vis = config->
get_bool
(
"/navgraph-generator/visualization/enable"
);
46
}
catch
(
Exception
&e) {
47
}
// ignored, use default
48
if
(use_vis) {
49
NavGraphGeneratorVisualizationThread
*vt =
new
NavGraphGeneratorVisualizationThread
();
50
thread_list.push_back(
new
NavGraphGeneratorThread
(vt));
51
thread_list.push_back(vt);
52
}
else
{
53
thread_list.push_back(
new
NavGraphGeneratorThread
());
54
}
55
#else
56
thread_list.push_back(
new
NavGraphGeneratorThread
());
57
#endif
58
}
59
};
60
61
PLUGIN_DESCRIPTION(
"Plugin to instruct and perform navgraph generation"
)
62
EXPORT_PLUGIN(
NavGraphGeneratorPlugin
)
NavGraphGeneratorPlugin::NavGraphGeneratorPlugin
NavGraphGeneratorPlugin(Configuration *config)
Constructor.
Definition:
navgraph_generator_plugin.cpp:40
fawkes::Configuration::get_bool
virtual bool get_bool(const char *path)=0
fawkes::Configuration
Definition:
config.h:70
NavGraphGeneratorVisualizationThread
Definition:
visualization_thread.h:35
fawkes
NavGraphGeneratorPlugin
Plugin to generate navgraphs based on given parameters.
Definition:
navgraph_generator_plugin.cpp:34
NavGraphGeneratorThread
Definition:
navgraph_generator_thread.h:39
fawkes::Plugin
Definition:
plugin.h:39
fawkes::Exception
Definition:
exception.h:41
src
plugins
navgraph-generator
navgraph_generator_plugin.cpp
Generated by
1.8.17