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
29using namespace fawkes;
30
31/** Plugin to generate navgraphs based on given parameters.
32 * @author Tim Niemueller
33 */
35{
36public:
37 /** Constructor.
38 * @param config Fawkes configuration
39 */
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) {
52 } else {
54 }
55#else
57#endif
58 }
59};
60
61PLUGIN_DESCRIPTION("Plugin to instruct and perform navgraph generation")
62EXPORT_PLUGIN(NavGraphGeneratorPlugin)
Plugin to generate navgraphs based on given parameters.
NavGraphGeneratorPlugin(Configuration *config)
Constructor.
Thread to perform graph-based path planning.
Send Marker messages to rviz to show navgraph-generator info.
Interface for configuration handling.
Definition: config.h:68
virtual bool get_bool(const char *path)=0
Get value from configuration which is of type bool.
Base class for exceptions in Fawkes.
Definition: exception.h:36
Plugin interface class.
Definition: plugin.h:34
ThreadList thread_list
Thread list member.
Definition: plugin.h:53
Configuration * config
Fawkes configuration.
Definition: plugin.h:58
void push_back(Thread *thread)
Add thread to the end.
Fawkes library namespace.