git commit -m "first commit"
This commit is contained in:
39
navigations/move_base_flex/mbf_simple_nav/CHANGELOG.rst
Executable file
39
navigations/move_base_flex/mbf_simple_nav/CHANGELOG.rst
Executable file
@@ -0,0 +1,39 @@
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Changelog for package mbf_simple_nav
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
0.3.2 (2020-05-25)
|
||||
------------------
|
||||
|
||||
0.3.1 (2020-04-07)
|
||||
------------------
|
||||
|
||||
0.3.0 (2020-03-31)
|
||||
------------------
|
||||
* unify license declaration to BSD-3
|
||||
|
||||
0.2.5 (2019-10-11)
|
||||
------------------
|
||||
|
||||
0.2.4 (2019-06-16)
|
||||
------------------
|
||||
|
||||
0.2.3 (2018-11-14)
|
||||
------------------
|
||||
|
||||
0.2.2 (2018-10-10)
|
||||
------------------
|
||||
|
||||
0.2.1 (2018-10-03)
|
||||
------------------
|
||||
* Make MBF melodic and indigo compatible
|
||||
* Fix GoalHandle references bug in callbacks
|
||||
|
||||
0.2.0 (2018-09-11)
|
||||
------------------
|
||||
* Update copyright and 3-clause-BSD license
|
||||
* Concurrency for planners, controllers and recovery behaviors
|
||||
|
||||
0.1.0 (2018-03-22)
|
||||
------------------
|
||||
* First release of move_base_flex for kinetic and lunar
|
||||
82
navigations/move_base_flex/mbf_simple_nav/CMakeLists.txt
Executable file
82
navigations/move_base_flex/mbf_simple_nav/CMakeLists.txt
Executable file
@@ -0,0 +1,82 @@
|
||||
cmake_minimum_required(VERSION 2.8.3)
|
||||
project(mbf_simple_nav)
|
||||
|
||||
find_package(catkin REQUIRED
|
||||
COMPONENTS
|
||||
actionlib
|
||||
actionlib_msgs
|
||||
dynamic_reconfigure
|
||||
geometry_msgs
|
||||
mbf_abstract_nav
|
||||
mbf_msgs
|
||||
mbf_abstract_core
|
||||
nav_msgs
|
||||
pluginlib
|
||||
roscpp
|
||||
std_msgs
|
||||
std_srvs
|
||||
tf
|
||||
tf2
|
||||
tf2_ros
|
||||
)
|
||||
|
||||
find_package(Boost COMPONENTS thread chrono REQUIRED)
|
||||
|
||||
set(MBF_SIMPLE_SERVER_LIB mbf_simple_server)
|
||||
set(MBF_SIMPLE_SERVER_NODE mbf_simple_nav)
|
||||
|
||||
catkin_package(
|
||||
INCLUDE_DIRS include
|
||||
LIBRARIES ${MBF_SIMPLE_SERVER_LIB}
|
||||
CATKIN_DEPENDS
|
||||
actionlib
|
||||
actionlib_msgs
|
||||
dynamic_reconfigure
|
||||
geometry_msgs
|
||||
mbf_abstract_nav
|
||||
mbf_msgs
|
||||
mbf_abstract_core
|
||||
nav_msgs
|
||||
pluginlib
|
||||
roscpp
|
||||
std_msgs
|
||||
std_srvs
|
||||
tf
|
||||
tf2
|
||||
tf2_ros
|
||||
DEPENDS Boost
|
||||
)
|
||||
|
||||
include_directories(
|
||||
include
|
||||
${catkin_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_library(${MBF_SIMPLE_SERVER_LIB}
|
||||
src/simple_navigation_server.cpp
|
||||
)
|
||||
|
||||
add_dependencies(${MBF_SIMPLE_SERVER_LIB} ${catkin_EXPORTED_TARGETS})
|
||||
target_link_libraries(${MBF_SIMPLE_SERVER_LIB}
|
||||
${catkin_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(${MBF_SIMPLE_SERVER_NODE} src/simple_server_node.cpp)
|
||||
add_dependencies(${MBF_SIMPLE_SERVER_NODE} ${MBF_SIMPLE_SERVER_LIB})
|
||||
target_link_libraries(${MBF_SIMPLE_SERVER_NODE}
|
||||
${MBF_SIMPLE_SERVER_LIB}
|
||||
${catkin_LIBRARIES})
|
||||
|
||||
install(TARGETS
|
||||
${MBF_SIMPLE_SERVER_LIB} ${MBF_SIMPLE_SERVER_NODE}
|
||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
|
||||
)
|
||||
|
||||
install(DIRECTORY include/${PROJECT_NAME}/
|
||||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
|
||||
)
|
||||
|
||||
6
navigations/move_base_flex/mbf_simple_nav/README.md
Executable file
6
navigations/move_base_flex/mbf_simple_nav/README.md
Executable file
@@ -0,0 +1,6 @@
|
||||
# Move Base Flex Simple Navigation Server {#mainpage}
|
||||
|
||||
|
||||
The mbf_simple_nav package contains a simple navigation server implementation of Move Base Flex (MBF). The simple navigation server is bound to no map representation. It provides actions for planning, controlling and recovering. MBF loads all defined plugins which are defined in the lists *planners*, *controllers* and *recovery_behaviors*. Each list holds a pair of a *name* and a *type*. The *type* defines which kind of plugin to load. The *name* defines under which name the plugin should be callable by the actions.
|
||||
|
||||
It tries to load the defined plugins which implements the defined interfaces in [mbf_abstract_core](wiki.ros.org/mbf_abstract_core).
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright 2018, Magazino GmbH, Sebastian Pütz, Jorge Santos Simón
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* simple_navigation_server.h
|
||||
*
|
||||
* authors:
|
||||
* Sebastian Pütz <spuetz@uni-osnabrueck.de>
|
||||
* Jorge Santos Simón <santos@magazino.eu>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MBF_SIMPLE_NAV__SIMPLE_NAVIGATION_SERVER_H_
|
||||
#define MBF_SIMPLE_NAV__SIMPLE_NAVIGATION_SERVER_H_
|
||||
|
||||
#include <mbf_abstract_nav/abstract_navigation_server.h>
|
||||
#include <pluginlib/class_loader.h>
|
||||
#include <mbf_utility/types.h>
|
||||
|
||||
namespace mbf_simple_nav
|
||||
{
|
||||
/**
|
||||
* @defgroup simple_server Simple Server
|
||||
* @brief Classes belonging to the Simple Server level.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief The SimpleNavigationServer provides a simple navigation server, which does not bind a map representation to
|
||||
* Move Base Flex. It combines the execution classes which use the mbf_abstract_core/AbstractController,
|
||||
* mbf_abstract_core/AbstractPlanner and the mbf_abstract_core/AbstractRecovery base classes
|
||||
* as plugin interfaces.
|
||||
*
|
||||
* @ingroup navigation_server simple_server
|
||||
*/
|
||||
class SimpleNavigationServer : public mbf_abstract_nav::AbstractNavigationServer
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param tf_listener_ptr Shared pointer to a common TransformListener
|
||||
*/
|
||||
SimpleNavigationServer(const TFPtr &tf_listener_ptr);
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
virtual ~SimpleNavigationServer();
|
||||
|
||||
/**
|
||||
* @brief Loads the plugin associated with the given controller type parameter
|
||||
* @param controller_type The type of the controller plugin
|
||||
* @return A shared pointer to a new loaded controller, if the controller plugin was loaded successfully,
|
||||
* an empty pointer otherwise.
|
||||
*/
|
||||
virtual mbf_abstract_core::AbstractController::Ptr loadControllerPlugin(const std::string& controller_type);
|
||||
|
||||
/**
|
||||
* @brief Empty init method. Nothing to initialize.
|
||||
* @param name The name of the controller
|
||||
* @param controller_ptr pointer to the controller object which corresponds to the name param
|
||||
* @return true always
|
||||
*/
|
||||
virtual bool initializeControllerPlugin(
|
||||
const std::string& name,
|
||||
const mbf_abstract_core::AbstractController::Ptr& controller_ptr
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Loads the plugin associated with the given planner_type parameter.
|
||||
* @param planner_type The type of the planner plugin to load.
|
||||
* @return true, if the local planner plugin was successfully loaded.
|
||||
*/
|
||||
virtual mbf_abstract_core::AbstractPlanner::Ptr loadPlannerPlugin(const std::string& planner_type);
|
||||
|
||||
/**
|
||||
* @brief Empty init method. Nothing to initialize.
|
||||
* @param name The name of the planner
|
||||
* @param planner_ptr pointer to the planner object which corresponds to the name param
|
||||
* @return true always
|
||||
*/
|
||||
virtual bool initializePlannerPlugin(
|
||||
const std::string& name,
|
||||
const mbf_abstract_core::AbstractPlanner::Ptr& planner_ptr
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Loads a Recovery plugin associated with given recovery type parameter
|
||||
* @param recovery_name The name of the Recovery plugin
|
||||
* @return A shared pointer to a Recovery plugin, if the plugin was loaded successfully, an empty pointer otherwise.
|
||||
*/
|
||||
virtual mbf_abstract_core::AbstractRecovery::Ptr loadRecoveryPlugin(const std::string& recovery_type);
|
||||
|
||||
/**
|
||||
* @brief Pure virtual method, the derived class has to implement. Depending on the plugin base class,
|
||||
* some plugins need to be initialized!
|
||||
* @param name The name of the recovery behavior
|
||||
* @param behavior_ptr pointer to the recovery behavior object which corresponds to the name param
|
||||
* @return true always
|
||||
*/
|
||||
virtual bool initializeRecoveryPlugin(
|
||||
const std::string& name,
|
||||
const mbf_abstract_core::AbstractRecovery::Ptr& behavior_ptr
|
||||
);
|
||||
|
||||
private:
|
||||
pluginlib::ClassLoader<mbf_abstract_core::AbstractPlanner> planner_plugin_loader_;
|
||||
pluginlib::ClassLoader<mbf_abstract_core::AbstractController> controller_plugin_loader_;
|
||||
pluginlib::ClassLoader<mbf_abstract_core::AbstractRecovery> recovery_plugin_loader_;
|
||||
};
|
||||
|
||||
} /* namespace mbf_simple_nav */
|
||||
|
||||
#endif /* MBF_SIMPLE_NAV__SIMPLE_NAVIGATION_SERVER_H_ */
|
||||
36
navigations/move_base_flex/mbf_simple_nav/package.xml
Executable file
36
navigations/move_base_flex/mbf_simple_nav/package.xml
Executable file
@@ -0,0 +1,36 @@
|
||||
<package format="2">
|
||||
<name>mbf_simple_nav</name>
|
||||
<version>0.3.2</version>
|
||||
<description>
|
||||
The mbf_simple_nav package contains a simple navigation server implementation of Move Base Flex (MBF). The simple navigation server is bound to no map representation. It provides actions for planning, controlling and recovering. MBF loads all defined plugins which are defined in the lists *planners*, *controllers* and *recovery_behaviors*. Each list holds a pair of a *name* and a *type*. The *type* defines which kind of plugin to load. The *name* defines under which name the plugin should be callable by the actions.
|
||||
|
||||
It tries to load the defined plugins which implements the defined interfaces in <a href="wiki.ros.org/mbf_abstract_core">mbf_abstract_core</a>.
|
||||
</description>
|
||||
<url>http://wiki.ros.org/move_base_flex</url>
|
||||
<author email="spuetz@uos.de">Sebastian Pütz</author>
|
||||
<maintainer email="spuetz@uos.de">Sebastian Pütz</maintainer>
|
||||
<maintainer email="santos@magazino.eu">Jorge Santos</maintainer>
|
||||
<license>BSD-3</license>
|
||||
|
||||
<buildtool_depend>catkin</buildtool_depend>
|
||||
|
||||
<depend>tf</depend>
|
||||
<depend>roscpp</depend>
|
||||
<depend>pluginlib</depend>
|
||||
<depend>actionlib</depend>
|
||||
<depend>actionlib_msgs</depend>
|
||||
<depend>dynamic_reconfigure</depend>
|
||||
<depend>std_msgs</depend>
|
||||
<depend>std_srvs</depend>
|
||||
<depend>nav_msgs</depend>
|
||||
<depend>geometry_msgs</depend>
|
||||
<depend>mbf_abstract_nav</depend>
|
||||
<depend>mbf_abstract_core</depend>
|
||||
<depend>mbf_msgs</depend>
|
||||
|
||||
<depend>tf2</depend>
|
||||
<depend>tf2_ros</depend>
|
||||
<export>
|
||||
<rosdoc config="rosdoc.yaml" />
|
||||
</export>
|
||||
</package>
|
||||
5
navigations/move_base_flex/mbf_simple_nav/rosdoc.yaml
Executable file
5
navigations/move_base_flex/mbf_simple_nav/rosdoc.yaml
Executable file
@@ -0,0 +1,5 @@
|
||||
- builder: doxygen
|
||||
name: Move Base Flex
|
||||
homepage: http://wiki.ros.org/move_base_flex
|
||||
file_patterns: '*.c *.cpp *.h *.cc *.hh *.py *.md'
|
||||
use_mdfile_as_mainpage: README.md
|
||||
142
navigations/move_base_flex/mbf_simple_nav/src/simple_navigation_server.cpp
Executable file
142
navigations/move_base_flex/mbf_simple_nav/src/simple_navigation_server.cpp
Executable file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright 2018, Magazino GmbH, Sebastian Pütz, Jorge Santos Simón
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* simple_navigation_server.cpp
|
||||
*
|
||||
* authors:
|
||||
* Sebastian Pütz <spuetz@uni-osnabrueck.de>
|
||||
* Jorge Santos Simón <santos@magazino.eu>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mbf_simple_nav/simple_navigation_server.h"
|
||||
|
||||
namespace mbf_simple_nav
|
||||
{
|
||||
|
||||
SimpleNavigationServer::SimpleNavigationServer(const TFPtr &tf_listener_ptr) :
|
||||
mbf_abstract_nav::AbstractNavigationServer(tf_listener_ptr),
|
||||
planner_plugin_loader_("mbf_abstract_core", "mbf_abstract_core::AbstractPlanner"),
|
||||
controller_plugin_loader_("mbf_abstract_core", "mbf_abstract_core::AbstractController"),
|
||||
recovery_plugin_loader_("mbf_abstract_core", "mbf_abstract_core::AbstractRecovery")
|
||||
{
|
||||
// initialize all plugins
|
||||
initializeServerComponents();
|
||||
|
||||
// start all action servers
|
||||
startActionServers();
|
||||
}
|
||||
|
||||
mbf_abstract_core::AbstractPlanner::Ptr SimpleNavigationServer::loadPlannerPlugin(const std::string& planner_type)
|
||||
{
|
||||
mbf_abstract_core::AbstractPlanner::Ptr planner_ptr;
|
||||
ROS_INFO("Load global planner plugin.");
|
||||
try
|
||||
{
|
||||
planner_ptr = planner_plugin_loader_.createInstance(planner_type);
|
||||
}
|
||||
catch (const pluginlib::PluginlibException &ex)
|
||||
{
|
||||
ROS_FATAL_STREAM("Failed to load the " << planner_type << " planner, are you sure it is properly registered"
|
||||
<< " and that the containing library is built? Exception: " << ex.what());
|
||||
}
|
||||
ROS_INFO("Global planner plugin loaded.");
|
||||
|
||||
return planner_ptr;
|
||||
}
|
||||
|
||||
bool SimpleNavigationServer::initializePlannerPlugin(
|
||||
const std::string& name,
|
||||
const mbf_abstract_core::AbstractPlanner::Ptr& planner_ptr
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
mbf_abstract_core::AbstractController::Ptr SimpleNavigationServer::loadControllerPlugin(
|
||||
const std::string& controller_type)
|
||||
{
|
||||
mbf_abstract_core::AbstractController::Ptr controller_ptr;
|
||||
ROS_DEBUG("Load controller plugin.");
|
||||
try
|
||||
{
|
||||
controller_ptr = controller_plugin_loader_.createInstance(controller_type);
|
||||
ROS_INFO_STREAM("MBF_core-based local planner plugin " << controller_type << " loaded");
|
||||
}
|
||||
catch (const pluginlib::PluginlibException &ex)
|
||||
{
|
||||
ROS_FATAL_STREAM("Failed to load the " << controller_type
|
||||
<< " local planner, are you sure it's properly registered"
|
||||
<< " and that the containing library is built? Exception: " << ex.what());
|
||||
}
|
||||
return controller_ptr;
|
||||
}
|
||||
|
||||
bool SimpleNavigationServer::initializeControllerPlugin(
|
||||
const std::string& name,
|
||||
const mbf_abstract_core::AbstractController::Ptr& controller_ptr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
mbf_abstract_core::AbstractRecovery::Ptr SimpleNavigationServer::loadRecoveryPlugin(
|
||||
const std::string& recovery_type)
|
||||
{
|
||||
mbf_abstract_core::AbstractRecovery::Ptr recovery_ptr;
|
||||
|
||||
try
|
||||
{
|
||||
recovery_ptr = boost::static_pointer_cast<mbf_abstract_core::AbstractRecovery>(
|
||||
recovery_plugin_loader_.createInstance(recovery_type));
|
||||
}
|
||||
catch (pluginlib::PluginlibException &ex)
|
||||
{
|
||||
ROS_FATAL_STREAM("Failed to load the " << recovery_type << " recovery behavior, are you sure it's properly registered"
|
||||
<< " and that the containing library is built? Exception: " << ex.what());
|
||||
}
|
||||
return recovery_ptr;
|
||||
}
|
||||
|
||||
bool SimpleNavigationServer::initializeRecoveryPlugin(
|
||||
const std::string& name,
|
||||
const mbf_abstract_core::AbstractRecovery::Ptr& behavior_ptr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
SimpleNavigationServer::~SimpleNavigationServer()
|
||||
{
|
||||
}
|
||||
|
||||
} /* namespace mbf_simple_nav */
|
||||
69
navigations/move_base_flex/mbf_simple_nav/src/simple_server_node.cpp
Executable file
69
navigations/move_base_flex/mbf_simple_nav/src/simple_server_node.cpp
Executable file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright 2018, Magazino GmbH, Sebastian Pütz, Jorge Santos Simón
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* simple_server_node.cpp
|
||||
*
|
||||
* authors:
|
||||
* Sebastian Pütz <spuetz@uni-osnabrueck.de>
|
||||
* Jorge Santos Simón <santos@magazino.eu>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mbf_simple_nav/simple_navigation_server.h"
|
||||
#include <mbf_utility/types.h>
|
||||
#include <tf2_ros/transform_listener.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ros::init(argc, argv, "mbf_simple_server");
|
||||
|
||||
typedef boost::shared_ptr<mbf_simple_nav::SimpleNavigationServer> SimpleNavigationServerPtr;
|
||||
|
||||
ros::NodeHandle nh;
|
||||
ros::NodeHandle private_nh("~");
|
||||
|
||||
double cache_time;
|
||||
private_nh.param("tf_cache_time", cache_time, 10.0);
|
||||
|
||||
#ifdef USE_OLD_TF
|
||||
TFPtr tf_listener_ptr(new TF(nh, ros::Duration(cache_time), true));
|
||||
#else
|
||||
TFPtr tf_listener_ptr(new TF(ros::Duration(cache_time)));
|
||||
tf2_ros::TransformListener tf_listener(*tf_listener_ptr);
|
||||
#endif
|
||||
|
||||
SimpleNavigationServerPtr controller_ptr(
|
||||
new mbf_simple_nav::SimpleNavigationServer(tf_listener_ptr));
|
||||
|
||||
ros::spin();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user