Fawkes API Fawkes Development Version
amcl_plugin.cpp
1
2/***************************************************************************
3 * amcl_plugin.cpp - Adaptive Monte Carlo Localization plugin
4 *
5 * Created: Wed May 16 16:02:15 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 "amcl_thread.h"
24
25#include <core/plugin.h>
26#ifdef HAVE_ROS
27# include "amcl_utils.h"
28# include "ros_thread.h"
29#endif
30
31using namespace fawkes;
32
33/** Adaptive Monte Carlo Localization plugin.
34 * @author Tim Niemueller
35 */
37{
38public:
39 /** Constructor.
40 * @param config Fawkes configuration
41 */
43 {
44#ifdef HAVE_ROS
45 AmclROSThread *rt = NULL;
46 bool ros_enabled = true;
47 try {
48 ros_enabled = config->get_bool(AMCL_CFG_PREFIX "ros/enable");
49 } catch (Exception &e) {
50 } // ignore, use default
51 if (ros_enabled) {
52 rt = new AmclROSThread();
54 }
56#else
58#endif
59 }
60};
61
62PLUGIN_DESCRIPTION("Adaptive Monte Carlo Localization")
63EXPORT_PLUGIN(AmclPlugin)
Adaptive Monte Carlo Localization plugin.
Definition: amcl_plugin.cpp:37
AmclPlugin(Configuration *config)
Constructor.
Definition: amcl_plugin.cpp:42
Thread for ROS integration of the Adaptive Monte Carlo Localization.
Definition: ros_thread.h:53
Thread to perform Adaptive Monte Carlo Localization.
Definition: amcl_thread.h:77
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.