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