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
33using namespace fawkes;
34
35/** Graph-based global path planning.
36 * @author Tim Niemueller
37 */
39{
40public:
41 /** Constructor.
42 * @param config Fawkes configuration
43 */
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) {
56 } else {
58 }
59#else
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) {
70 }
71#endif
72 }
73};
74
75PLUGIN_DESCRIPTION("Graph-based local path planning")
76EXPORT_PLUGIN(NavGraphPlugin)
Graph-based global path planning.
NavGraphPlugin(Configuration *config)
Constructor.
Publish navgaraph to ROS.
Definition: rospub_thread.h:45
Thread to perform graph-based path planning.
Send Marker messages to rviz to show navgraph 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.