Browse Source

删除hector导致编译无法通过的包

corvin 4 years ago
parent
commit
5d2c506b00
22 changed files with 0 additions and 4114 deletions
  1. 0 165
      src/hector_exploration_controller/CMakeLists.txt
  2. 0 64
      src/hector_exploration_controller/package.xml
  3. 0 91
      src/hector_exploration_controller/src/simple_exploration_controller.cpp
  4. 0 163
      src/hector_exploration_node/CMakeLists.txt
  5. 0 26
      src/hector_exploration_node/config/costmap.yaml
  6. 0 9
      src/hector_exploration_node/launch/exploration_planner.launch
  7. 0 56
      src/hector_exploration_node/package.xml
  8. 0 87
      src/hector_exploration_node/src/exploration_node.cpp
  9. 0 184
      src/hector_exploration_planner/CMakeLists.txt
  10. 0 24
      src/hector_exploration_planner/cfg/ExplorationPlanner.cfg
  11. 0 6
      src/hector_exploration_planner/hector_exploration_base_global_planner_plugin.xml
  12. 0 104
      src/hector_exploration_planner/include/hector_exploration_planner/exploration_transform_vis.h
  13. 0 59
      src/hector_exploration_planner/include/hector_exploration_planner/hector_exploration_base_global_planner_plugin.h
  14. 0 186
      src/hector_exploration_planner/include/hector_exploration_planner/hector_exploration_planner.h
  15. 0 76
      src/hector_exploration_planner/package.xml
  16. 0 55
      src/hector_exploration_planner/src/hector_exploration_base_global_planner_plugin.cpp
  17. 0 1991
      src/hector_exploration_planner/src/hector_exploration_planner.cpp
  18. 0 166
      src/hector_path_follower/CMakeLists.txt
  19. 0 90
      src/hector_path_follower/include/hector_path_follower/hector_path_follower.h
  20. 0 61
      src/hector_path_follower/package.xml
  21. 0 403
      src/hector_path_follower/src/hector_path_follower.cpp
  22. 0 48
      src/hector_path_follower/src/hector_path_follower_node.cpp

+ 0 - 165
src/hector_exploration_controller/CMakeLists.txt

@@ -1,165 +0,0 @@
-cmake_minimum_required(VERSION 2.8.3)
-project(hector_exploration_controller)
-
-## Find catkin macros and libraries
-## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
-## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS
-  roscpp
-  rospy
-  std_msgs
-  hector_path_follower
-  hector_nav_msgs
-)
-
-## System dependencies are found with CMake's conventions
-# find_package(Boost REQUIRED COMPONENTS system)
-
-
-## Uncomment this if the package has a setup.py. This macro ensures
-## modules and global scripts declared therein get installed
-## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
-# catkin_python_setup()
-
-################################################
-## Declare ROS messages, services and actions ##
-################################################
-
-## To declare and build messages, services or actions from within this
-## package, follow these steps:
-## * Let MSG_DEP_SET be the set of packages whose message types you use in
-##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
-## * In the file package.xml:
-##   * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
-##   * If MSG_DEP_SET isn't empty the following dependencies might have been
-##     pulled in transitively but can be declared for certainty nonetheless:
-##     * add a build_depend tag for "message_generation"
-##     * add a run_depend tag for "message_runtime"
-## * In this file (CMakeLists.txt):
-##   * add "message_generation" and every package in MSG_DEP_SET to
-##     find_package(catkin REQUIRED COMPONENTS ...)
-##   * add "message_runtime" and every package in MSG_DEP_SET to
-##     catkin_package(CATKIN_DEPENDS ...)
-##   * uncomment the add_*_files sections below as needed
-##     and list every .msg/.srv/.action file to be processed
-##   * uncomment the generate_messages entry below
-##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
-
-## Generate messages in the 'msg' folder
-# add_message_files(
-#   FILES
-#   Message1.msg
-#   Message2.msg
-# )
-
-## Generate services in the 'srv' folder
-# add_service_files(
-#   FILES
-#   Service1.srv
-#   Service2.srv
-# )
-
-## Generate actions in the 'action' folder
-# add_action_files(
-#   FILES
-#   Action1.action
-#   Action2.action
-# )
-
-## Generate added messages and services with any dependencies listed here
-# generate_messages(
-#   DEPENDENCIES
-#   std_msgs
-# )
-
-###################################
-## catkin specific configuration ##
-###################################
-## The catkin_package macro generates cmake config files for your package
-## Declare things to be passed to dependent projects
-## INCLUDE_DIRS: uncomment this if you package contains header files
-## LIBRARIES: libraries you create in this project that dependent projects also need
-## CATKIN_DEPENDS: catkin_packages dependent projects also need
-## DEPENDS: system dependencies of this project that dependent projects also need
-catkin_package(
-#  INCLUDE_DIRS include
-#  LIBRARIES hector_exploration_controller
-#  CATKIN_DEPENDS roscpp rospy std_msgs
-#  DEPENDS system_lib
-)
-
-###########
-## Build ##
-###########
-
-## Specify additional locations of header files
-## Your package locations should be listed before other locations
-# include_directories(include)
-include_directories(
-  ${catkin_INCLUDE_DIRS}
-)
-
-## Declare a cpp library
-# add_library(hector_exploration_controller
-#   src/${PROJECT_NAME}/hector_exploration_controller.cpp
-# )
-
-## Declare a cpp executable
-add_executable(simple_exploration_controller src/simple_exploration_controller.cpp)
-
-## Add cmake target dependencies of the executable/library
-## as an example, message headers may need to be generated before nodes
-# add_dependencies(hector_exploration_controller_node hector_exploration_controller_generate_messages_cpp)
-
-## Specify libraries to link a library or executable target against
-target_link_libraries(simple_exploration_controller
-  ${catkin_LIBRARIES}
-)
-
-#############
-## Install ##
-#############
-
-# all install targets should use catkin DESTINATION variables
-# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
-
-## Mark executable scripts (Python etc.) for installation
-## in contrast to setup.py, you can choose the destination
-# install(PROGRAMS
-#   scripts/my_python_script
-#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark executables and/or libraries for installation
-# install(TARGETS hector_exploration_controller hector_exploration_controller_node
-#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark cpp header files for installation
-# install(DIRECTORY include/${PROJECT_NAME}/
-#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
-#   FILES_MATCHING PATTERN "*.h"
-#   PATTERN ".svn" EXCLUDE
-# )
-
-## Mark other files for installation (e.g. launch and bag files, etc.)
-# install(FILES
-#   # myfile1
-#   # myfile2
-#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
-# )
-
-#############
-## Testing ##
-#############
-
-## Add gtest based cpp test target and link libraries
-# catkin_add_gtest(${PROJECT_NAME}-test test/test_hector_exploration_controller.cpp)
-# if(TARGET ${PROJECT_NAME}-test)
-#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
-# endif()
-
-## Add folders to be run by python nosetests
-# catkin_add_nosetests(test)

+ 0 - 64
src/hector_exploration_controller/package.xml

@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-<package>
-  <name>hector_exploration_controller</name>
-  <version>0.0.0</version>
-  <description>hector_exploration_controller is a simple controller that requests a plan via a service and generates geometry_msgs/Twist commands accordingly to follow this plan</description>
-
-  <!-- One maintainer tag required, multiple allowed, one person per tag --> 
-  <!-- Example:  -->
-  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
-  <maintainer email="kohlbrecher@sim.tu-darmstadt.de">Stefan Kohlbrecher</maintainer>
-
-
-
-  <!-- One license tag required, multiple allowed, one license per tag -->
-  <!-- Commonly used license strings: -->
-  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
-  <license>BSD</license>
-
-
-  <!-- Url tags are optional, but mutiple are allowed, one per tag -->
-  <!-- Optional attribute type can be: website, bugtracker, or repository -->
-  <!-- Example: -->
-  <!-- <url type="website">http://wiki.ros.org/hector_exploration_controller</url> -->
-
-
-  <!-- Author tags are optional, mutiple are allowed, one per tag -->
-  <!-- Authors do not have to be maintianers, but could be -->
-  <!-- Example: -->
-  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->
-
-
-  <!-- The *_depend tags are used to specify dependencies -->
-  <!-- Dependencies can be catkin packages or system dependencies -->
-  <!-- Examples: -->
-  <!-- Use build_depend for packages you need at compile time: -->
-  <!--   <build_depend>message_generation</build_depend> -->
-  <!-- Use buildtool_depend for build tool packages: -->
-  <!--   <buildtool_depend>catkin</buildtool_depend> -->
-  <!-- Use run_depend for packages you need at runtime: -->
-  <!--   <run_depend>message_runtime</run_depend> -->
-  <!-- Use test_depend for packages you need only for testing: -->
-  <!--   <test_depend>gtest</test_depend> -->
-  <buildtool_depend>catkin</buildtool_depend>
-  <build_depend>roscpp</build_depend>
-  <build_depend>rospy</build_depend>
-  <build_depend>std_msgs</build_depend>
-  <build_depend>hector_path_follower</build_depend>
-  <build_depend>hector_nav_msgs</build_depend>
-
-  <run_depend>roscpp</run_depend>
-  <run_depend>rospy</run_depend>
-  <run_depend>std_msgs</run_depend>
-  <run_depend>hector_path_follower</run_depend>
-  <run_depend>hector_nav_msgs</run_depend>
-
-  <!-- The export tag contains other, unspecified, tags -->
-  <export>
-    <!-- You can specify that this package is a metapackage here: -->
-    <!-- <metapackage/> -->
-
-    <!-- Other tools can request additional information be placed here -->
-
-  </export>
-</package>

+ 0 - 91
src/hector_exploration_controller/src/simple_exploration_controller.cpp

@@ -1,91 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-
-#include <ros/ros.h>
-#include <hector_path_follower/hector_path_follower.h>
-#include <hector_nav_msgs/GetRobotTrajectory.h>
-
-class SimpleExplorationController
-{
-public:
-  SimpleExplorationController()
-  {
-    ros::NodeHandle nh;
-
-    exploration_plan_service_client_ = nh.serviceClient<hector_nav_msgs::GetRobotTrajectory>("get_exploration_path");
-
-    path_follower_.initialize(&tfl_);
-
-    exploration_plan_generation_timer_ = nh.createTimer(ros::Duration(3.0), &SimpleExplorationController::timerPlanExploration, this, false );
-    cmd_vel_generator_timer_ = nh.createTimer(ros::Duration(0.2), &SimpleExplorationController::timerCmdVelGeneration, this, false );
-
-    vel_pub_ = nh.advertise<geometry_msgs::Twist>("/robot0/cmd_vel", 10);
-
-  }
-
-  void timerPlanExploration(const ros::TimerEvent& e)
-  {
-    hector_nav_msgs::GetRobotTrajectory srv_exploration_plan;
-
-    if (exploration_plan_service_client_.call(srv_exploration_plan)){
-      ROS_INFO("Generated exploration path with %u poses", (unsigned int)srv_exploration_plan.response.trajectory.poses.size());
-      path_follower_.setPlan(srv_exploration_plan.response.trajectory.poses);
-    }else{
-      ROS_WARN("Service call for exploration service failed");
-    }
-  }
-
-  void timerCmdVelGeneration(const ros::TimerEvent& e)
-  {
-    geometry_msgs::Twist twist;
-    path_follower_.computeVelocityCommands(twist);
-    vel_pub_.publish(twist);
-  }
-
-
-protected:
-  ros::ServiceClient exploration_plan_service_client_;
-  ros::Publisher vel_pub_;
-
-  tf::TransformListener tfl_;
-
-  pose_follower::HectorPathFollower path_follower_;
-
-  ros::Timer exploration_plan_generation_timer_;
-  ros::Timer cmd_vel_generator_timer_;
-};
-
-int main(int argc, char **argv) {
-  ros::init(argc, argv, ROS_PACKAGE_NAME);
-
-  SimpleExplorationController ec;
-
-  ros::spin();
-  return 0;
-}

+ 0 - 163
src/hector_exploration_node/CMakeLists.txt

@@ -1,163 +0,0 @@
-cmake_minimum_required(VERSION 2.8.3)
-project(hector_exploration_node)
-
-## Find catkin macros and libraries
-## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
-## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS
-  hector_exploration_planner
-  hector_nav_msgs
-)
-
-## System dependencies are found with CMake's conventions
-# find_package(Boost REQUIRED COMPONENTS system)
-
-
-## Uncomment this if the package has a setup.py. This macro ensures
-## modules and global scripts declared therein get installed
-## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
-# catkin_python_setup()
-
-################################################
-## Declare ROS messages, services and actions ##
-################################################
-
-## To declare and build messages, services or actions from within this
-## package, follow these steps:
-## * Let MSG_DEP_SET be the set of packages whose message types you use in
-##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
-## * In the file package.xml:
-##   * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
-##   * If MSG_DEP_SET isn't empty the following dependencies might have been
-##     pulled in transitively but can be declared for certainty nonetheless:
-##     * add a build_depend tag for "message_generation"
-##     * add a run_depend tag for "message_runtime"
-## * In this file (CMakeLists.txt):
-##   * add "message_generation" and every package in MSG_DEP_SET to
-##     find_package(catkin REQUIRED COMPONENTS ...)
-##   * add "message_runtime" and every package in MSG_DEP_SET to
-##     catkin_package(CATKIN_DEPENDS ...)
-##   * uncomment the add_*_files sections below as needed
-##     and list every .msg/.srv/.action file to be processed
-##   * uncomment the generate_messages entry below
-##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
-
-## Generate messages in the 'msg' folder
-# add_message_files(
-#   FILES
-#   Message1.msg
-#   Message2.msg
-# )
-
-## Generate services in the 'srv' folder
-# add_service_files(
-#   FILES
-#   Service1.srv
-#   Service2.srv
-# )
-
-## Generate actions in the 'action' folder
-# add_action_files(
-#   FILES
-#   Action1.action
-#   Action2.action
-# )
-
-## Generate added messages and services with any dependencies listed here
-# generate_messages(
-#   DEPENDENCIES
-#   hector_nav_msgs
-# )
-
-###################################
-## catkin specific configuration ##
-###################################
-## The catkin_package macro generates cmake config files for your package
-## Declare things to be passed to dependent projects
-## INCLUDE_DIRS: uncomment this if you package contains header files
-## LIBRARIES: libraries you create in this project that dependent projects also need
-## CATKIN_DEPENDS: catkin_packages dependent projects also need
-## DEPENDS: system dependencies of this project that dependent projects also need
-catkin_package(
-#  INCLUDE_DIRS include
-#  LIBRARIES hector_exploration_node
-#  CATKIN_DEPENDS hector_exploration_planner hector_nav_msgs
-#  DEPENDS system_lib
-)
-
-###########
-## Build ##
-###########
-
-## Specify additional locations of header files
-## Your package locations should be listed before other locations
-# include_directories(include)
-include_directories(
-  ${catkin_INCLUDE_DIRS}
-)
-
-## Declare a cpp library
-# add_library(hector_exploration_node
-#   src/${PROJECT_NAME}/hector_exploration_node.cpp
-# )
-
-## Declare a cpp executable
-# add_executable(hector_exploration_node_node src/hector_exploration_node_node.cpp)
-add_executable(exploration_planner_node src/exploration_node.cpp)
-
-## Add cmake target dependencies of the executable/library
-## as an example, message headers may need to be generated before nodes
-# add_dependencies(hector_exploration_node_node hector_exploration_node_generate_messages_cpp)
-
-## Specify libraries to link a library or executable target against
-target_link_libraries(exploration_planner_node
-  ${catkin_LIBRARIES}
-)
-
-#############
-## Install ##
-#############
-
-# all install targets should use catkin DESTINATION variables
-# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
-
-## Mark executable scripts (Python etc.) for installation
-## in contrast to setup.py, you can choose the destination
-# install(PROGRAMS
-#   scripts/my_python_script
-#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark executables and/or libraries for installation
-# install(TARGETS hector_exploration_node hector_exploration_node_node
-#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark cpp header files for installation
-# install(DIRECTORY include/${PROJECT_NAME}/
-#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
-#   FILES_MATCHING PATTERN "*.h"
-#   PATTERN ".svn" EXCLUDE
-# )
-
-## Mark other files for installation (e.g. launch and bag files, etc.)
-# install(FILES
-#   # myfile1
-#   # myfile2
-#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
-# )
-
-#############
-## Testing ##
-#############
-
-## Add gtest based cpp test target and link libraries
-# catkin_add_gtest(${PROJECT_NAME}-test test/test_hector_exploration_node.cpp)
-# if(TARGET ${PROJECT_NAME}-test)
-#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
-# endif()
-
-## Add folders to be run by python nosetests
-# catkin_add_nosetests(test)

+ 0 - 26
src/hector_exploration_node/config/costmap.yaml

@@ -1,26 +0,0 @@
-global_costmap:
-
-  map_type: costmap
-  track_unknown_space: true
-  unknown_cost_value: 255
-  obstacle_range: 2.5
-  raytrace_range: 3.0
-  footprint: [[0.2, 0.2],
-              [-0.2, 0.2],
-              [-0.2, -0.2],
-              [0.2, -0.2]]
-  inflation_radius: 0.32
-  #transform_tolerance: 0.5
-  inscribed_radius: 0.3
-  circumscribed_radius: 0.32
-
-  global_frame: /map
-  robot_base_frame: /robot0
-  update_frequency: 0.5
-  publish_frequency: 0.5
-  static_map: true
-  rolling_window: false
-
-  #Investigate what this actually does
-  cost_scaling_factor: 10.0
-

+ 0 - 9
src/hector_exploration_node/launch/exploration_planner.launch

@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-
-<launch>
-  <!--launch-prefix="gdb -ex run ++args"-->
-  <node pkg="hector_exploration_node" type="exploration_planner_node" name="hector_exploration_node" output="screen">
-    <rosparam file="$(find hector_exploration_node)/config/costmap.yaml" command="load" />
-  </node>
-</launch>
-

+ 0 - 56
src/hector_exploration_node/package.xml

@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<package>
-  <name>hector_exploration_node</name>
-  <version>0.0.0</version>
-  <description>hector_exploration_node is a node that provides exploration plans via a service server</description>
-
-  <!-- One maintainer tag required, multiple allowed, one person per tag --> 
-  <!-- Example:  -->
-  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
-  <maintainer email="kohlbrecher@sim.tu-darmstadt.de">Stefan Kohlbrecher</maintainer>
-
-  <!-- One license tag required, multiple allowed, one license per tag -->
-  <!-- Commonly used license strings: -->
-  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
-  <license>BSD</license>
-
-
-  <!-- Url tags are optional, but mutiple are allowed, one per tag -->
-  <!-- Optional attribute type can be: website, bugtracker, or repository -->
-  <!-- Example: -->
-  <!-- <url type="website">http://wiki.ros.org/hector_exploration_node</url> -->
-
-
-  <!-- Author tags are optional, mutiple are allowed, one per tag -->
-  <!-- Authors do not have to be maintianers, but could be -->
-  <!-- Example: -->
-  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->
-
-
-  <!-- The *_depend tags are used to specify dependencies -->
-  <!-- Dependencies can be catkin packages or system dependencies -->
-  <!-- Examples: -->
-  <!-- Use build_depend for packages you need at compile time: -->
-  <!--   <build_depend>message_generation</build_depend> -->
-  <!-- Use buildtool_depend for build tool packages: -->
-  <!--   <buildtool_depend>catkin</buildtool_depend> -->
-  <!-- Use run_depend for packages you need at runtime: -->
-  <!--   <run_depend>message_runtime</run_depend> -->
-  <!-- Use test_depend for packages you need only for testing: -->
-  <!--   <test_depend>gtest</test_depend> -->
-  <buildtool_depend>catkin</buildtool_depend>
-  <build_depend>hector_exploration_planner</build_depend>
-  <build_depend>hector_nav_msgs</build_depend>
-  <run_depend>hector_exploration_planner</run_depend>
-  <run_depend>hector_nav_msgs</run_depend>
-
-
-  <!-- The export tag contains other, unspecified, tags -->
-  <export>
-    <!-- You can specify that this package is a metapackage here: -->
-    <!-- <metapackage/> -->
-
-    <!-- Other tools can request additional information be placed here -->
-
-  </export>
-</package>

+ 0 - 87
src/hector_exploration_node/src/exploration_node.cpp

@@ -1,87 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-#include <ros/ros.h>
-#include <hector_exploration_planner/hector_exploration_planner.h>
-#include <costmap_2d/costmap_2d_ros.h>
-#include <hector_nav_msgs/GetRobotTrajectory.h>
-
-class SimpleExplorationPlanner
-{
-public:
-  SimpleExplorationPlanner()
-  {
-    ros::NodeHandle nh;
-    costmap_2d_ros_ = new costmap_2d::Costmap2DROS("global_costmap", tfl_);
-
-    planner_ = new hector_exploration_planner::HectorExplorationPlanner();
-    planner_->initialize("hector_exploration_planner",costmap_2d_ros_);
-
-    exploration_plan_service_server_ = nh.advertiseService("get_exploration_path", &SimpleExplorationPlanner::explorationServiceCallback, this);
-    exploration_plan_pub_ = nh.advertise<nav_msgs::Path>("exploration_path", 5);
-  }
-
-  bool explorationServiceCallback(hector_nav_msgs::GetRobotTrajectory::Request  &req,
-                                  hector_nav_msgs::GetRobotTrajectory::Response &res )
-    {
-      ROS_INFO("Exploration Service called");
-
-      tf::Stamped<tf::Pose> robot_pose_tf;
-      costmap_2d_ros_->getRobotPose(robot_pose_tf);
-
-      geometry_msgs::PoseStamped pose;
-      tf::poseStampedTFToMsg(robot_pose_tf, pose);
-      planner_->doExploration(pose, res.trajectory.poses);
-      res.trajectory.header.frame_id = "map";
-      res.trajectory.header.stamp = ros::Time::now();
-
-      if (exploration_plan_pub_.getNumSubscribers() > 0)
-      {
-        exploration_plan_pub_.publish(res.trajectory);
-      }
-
-      return true;
-    }
-
-protected:
-  hector_exploration_planner::HectorExplorationPlanner* planner_;
-  ros::ServiceServer exploration_plan_service_server_;
-  ros::Publisher exploration_plan_pub_;
-  costmap_2d::Costmap2DROS* costmap_2d_ros_;
-  tf::TransformListener tfl_;
-
-};
-
-int main(int argc, char **argv) {
-  ros::init(argc, argv, ROS_PACKAGE_NAME);
-  SimpleExplorationPlanner ep;
-
-  ros::spin();
-  return 0;
-}
-

+ 0 - 184
src/hector_exploration_planner/CMakeLists.txt

@@ -1,184 +0,0 @@
-cmake_minimum_required(VERSION 2.8.3)
-project(hector_exploration_planner)
-
-## Find catkin macros and libraries
-## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
-## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS
-  cmake_modules
-  costmap_2d
-  dynamic_reconfigure
-  geometry_msgs
-  hector_nav_msgs
-  nav_core
-  nav_msgs
-  pluginlib
-  rosconsole
-  roscpp
-  rospy
-)
-
-## System dependencies are found with CMake's conventions
-# find_package(Boost REQUIRED COMPONENTS system)
-find_package(Eigen REQUIRED)
-include_directories(${EIGEN_INCLUDE_DIRS})
-add_definitions(${EIGEN_DEFINITIONS})
-
-generate_dynamic_reconfigure_options(
-  cfg/ExplorationPlanner.cfg
-)
-
-## Uncomment this if the package has a setup.py. This macro ensures
-## modules and global scripts declared therein get installed
-## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
-# catkin_python_setup()
-
-################################################
-## Declare ROS messages, services and actions ##
-################################################
-
-## To declare and build messages, services or actions from within this
-## package, follow these steps:
-## * Let MSG_DEP_SET be the set of packages whose message types you use in
-##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
-## * In the file package.xml:
-##   * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
-##   * If MSG_DEP_SET isn't empty the following dependencies might have been
-##     pulled in transitively but can be declared for certainty nonetheless:
-##     * add a build_depend tag for "message_generation"
-##     * add a run_depend tag for "message_runtime"
-## * In this file (CMakeLists.txt):
-##   * add "message_generation" and every package in MSG_DEP_SET to
-##     find_package(catkin REQUIRED COMPONENTS ...)
-##   * add "message_runtime" and every package in MSG_DEP_SET to
-##     catkin_package(CATKIN_DEPENDS ...)
-##   * uncomment the add_*_files sections below as needed
-##     and list every .msg/.srv/.action file to be processed
-##   * uncomment the generate_messages entry below
-##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
-
-## Generate messages in the 'msg' folder
-# add_message_files(
-#   FILES
-#   Message1.msg
-#   Message2.msg
-# )
-
-## Generate services in the 'srv' folder
-# add_service_files(
-#   FILES
-#   Service1.srv
-#   Service2.srv
-# )
-
-## Generate actions in the 'action' folder
-# add_action_files(
-#   FILES
-#   Action1.action
-#   Action2.action
-# )
-
-## Generate added messages and services with any dependencies listed here
-# generate_messages(
-#   DEPENDENCIES
-#   geometry_msgs#   hector_nav_msgs#   nav_msgs
-# )
-
-###################################
-## catkin specific configuration ##
-###################################
-## The catkin_package macro generates cmake config files for your package
-## Declare things to be passed to dependent projects
-## INCLUDE_DIRS: uncomment this if you package contains header files
-## LIBRARIES: libraries you create in this project that dependent projects also need
-## CATKIN_DEPENDS: catkin_packages dependent projects also need
-## DEPENDS: system dependencies of this project that dependent projects also need
-catkin_package(
-  INCLUDE_DIRS include
-  LIBRARIES hector_exploration_base_global_planner_plugin ${PROJECT_NAME}
-  CATKIN_DEPENDS costmap_2d dynamic_reconfigure geometry_msgs hector_nav_msgs nav_core nav_msgs pluginlib rosconsole roscpp rospy
-#  DEPENDS system_lib
-)
-
-###########
-## Build ##
-###########
-
-## Specify additional locations of header files
-## Your package locations should be listed before other locations
-# include_directories(include)
-include_directories(
-  include
-  ${catkin_INCLUDE_DIRS}
-)
-
-## Declare a cpp library
-# add_library(hector_exploration_planner
-#   src/${PROJECT_NAME}/hector_exploration_planner.cpp
-# )
-add_library(${PROJECT_NAME} src/hector_exploration_planner.cpp)
-add_library(hector_exploration_base_global_planner_plugin src/hector_exploration_base_global_planner_plugin.cpp)
-
-## Declare a cpp executable
-# add_executable(hector_exploration_planner_node src/hector_exploration_planner_node.cpp)
-
-## Add cmake target dependencies of the executable/library
-## as an example, message headers may need to be generated before nodes
-# add_dependencies(hector_exploration_planner_node hector_exploration_planner_generate_messages_cpp)
-add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg)
-add_dependencies(hector_exploration_base_global_planner_plugin ${PROJECT_NAME}_gencfg)
-
-## Specify libraries to link a library or executable target against
-# target_link_libraries(hector_exploration_planner_node
-#   ${catkin_LIBRARIES}
-# )
-
-target_link_libraries(hector_exploration_base_global_planner_plugin ${PROJECT_NAME})
-
-#############
-## Install ##
-#############
-
-# all install targets should use catkin DESTINATION variables
-# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
-
-## Mark executable scripts (Python etc.) for installation
-## in contrast to setup.py, you can choose the destination
-# install(PROGRAMS
-#   scripts/my_python_script
-#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark executables and/or libraries for installation
-# install(TARGETS hector_exploration_base_global_planner_plugin ${PROJECT_NAME}
-#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark cpp header files for installation
-# install(DIRECTORY include/${PROJECT_NAME}/
-#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
-#   FILES_MATCHING PATTERN "*.h"
-#   PATTERN ".svn" EXCLUDE
-# )
-
-## Mark other files for installation (e.g. launch and bag files, etc.)
-# install(FILES
-#   # myfile1
-#   # myfile2
-#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
-# )
-
-#############
-## Testing ##
-#############
-
-## Add gtest based cpp test target and link libraries
-# catkin_add_gtest(${PROJECT_NAME}-test test/test_hector_exploration_planner.cpp)
-# if(TARGET ${PROJECT_NAME}-test)
-#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
-# endif()
-
-## Add folders to be run by python nosetests
-# catkin_add_nosetests(test)

+ 0 - 24
src/hector_exploration_planner/cfg/ExplorationPlanner.cfg

@@ -1,24 +0,0 @@
-#! /usr/bin/env python
-PACKAGE='hector_exploration_planner'
-
-from dynamic_reconfigure.parameter_generator_catkin import *
-
-gen = ParameterGenerator()
-
-gen.add("security_constant", double_t, 0, "security_constant", 0.5, 0.0, 10000.0)
-gen.add("min_obstacle_dist", int_t, 0, "min_obstacle_dist", 10, 0, 1000)
-gen.add("plan_in_unknown", bool_t, 0, "plan_in_unknown", True)
-gen.add("explore_close_to_path", bool_t, 0, "explore_close_to_path", True)
-gen.add("use_inflated_obstacles", bool_t, 0, "use_inflated_obstacle", True)
-gen.add("goal_angle_penalty", int_t, 0, "goal_angle_penalty", 50, 0, 10000)
-gen.add("min_frontier_size", int_t, 0, "min_frontier_size", 5, 0, 1000)
-gen.add("dist_for_goal_reached", double_t, 0, "dist_for_goal_reached", 0.25, 0.0, 10.0)
-gen.add("same_frontier_distance", double_t, 0, "same_frontier_distance", 0.25, 0.0, 10.0)
-gen.add("obstacle_cutoff_distance", double_t, 0, "obstacle_cutoff_distance", 1.0, 0.0, 100.0)
-gen.add("use_observation_pose_calculation", bool_t, 0, "use observation pose calculation", True)
-gen.add("observation_pose_desired_dist", double_t, 0, "Observation pose desired distance", 0.5, 0.0, 10.0)
-gen.add("observation_pose_allowed_angle", double_t, 0, "allowed angle for observation pose adjustment [deg]", 135.0, 0.0, 360.0)
-gen.add("close_to_path_target_distance", double_t, 0, "close to path exploration target distance", 1.2, 0.0, 10.0)
-
-
-exit(gen.generate(PACKAGE, "hector_exploration_planner", "ExplorationPlanner"))

+ 0 - 6
src/hector_exploration_planner/hector_exploration_base_global_planner_plugin.xml

@@ -1,6 +0,0 @@
-<library path="lib/libhector_exploration_base_global_planner_plugin">
-  <class name="hector_exploration_planner/HectorExplorationBaseGlobalPlannerPlugin" type="hector_exploration_planner::HectorExplorationBaseGlobalPlannerPlugin" base_class_type="nav_core::BaseGlobalPlanner">
-  <description>
-    A global planner using the exploration transform algorithm
-  </description>
-</library>

+ 0 - 104
src/hector_exploration_planner/include/hector_exploration_planner/exploration_transform_vis.h

@@ -1,104 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Mark Sollweck, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-#ifndef EXPLORATION_TRANSFORM_VIS_H___
-#define EXPLORATION_TRANSFORM_VIS_H___
-
-#include <sensor_msgs/PointCloud.h>
-#include <ros/ros.h>
-#include <costmap_2d/costmap_2d.h>
-
-
-namespace hector_exploration_planner{
-
-  class ExplorationTransformVis
-  {
-  public:
-    ExplorationTransformVis(const std::string& topic_name)
-    {
-      ros::NodeHandle pnh("~");
-      exploration_transform_pointcloud_pub_ = pnh.advertise<sensor_msgs::PointCloud>(topic_name, 2, false);
-    }
-
-    virtual ~ExplorationTransformVis()
-    {}
-
-    void publishVisOnDemand(const costmap_2d::Costmap2D& costmap, const unsigned int* exploration_array)
-    {
-      if (exploration_transform_pointcloud_pub_.getNumSubscribers() > 0){
-        unsigned int size_x = costmap.getSizeInCellsX();
-        unsigned int size_y = costmap.getSizeInCellsY();
-        unsigned int size = size_x * size_y;
-
-        unsigned int max = 0;
-
-        for (size_t i = 0; i < size; ++i){
-          if ((exploration_array[i] < INT_MAX) && (exploration_array[i] > max)){
-            max = exploration_array[i];
-          }
-        }
-
-        float max_f = static_cast<float>(max);
-
-        sensor_msgs::PointCloud cloud;
-        cloud.header.frame_id = "/map";
-        cloud.header.stamp = ros::Time::now();
-
-        double x_world, y_world;
-
-        geometry_msgs::Point32 point;
-
-        for (size_t x = 0; x < size_x; ++x){
-          for (size_t y = 0; y < size_y; ++y){
-
-            unsigned int index = costmap.getIndex(x,y);
-
-            if (exploration_array[index] < INT_MAX){
-
-              costmap.mapToWorld(x,y, x_world, y_world);
-              point.x = x_world;
-              point.y = y_world;
-              point.z = static_cast<float>(exploration_array[index])/max_f;
-
-              cloud.points.push_back(point);
-            }
-
-          }
-        }
-        exploration_transform_pointcloud_pub_.publish(cloud);
-      }
-    }
-
-  protected:
-
-    ros::Publisher exploration_transform_pointcloud_pub_;
-  };
-
-}
-
-#endif

+ 0 - 59
src/hector_exploration_planner/include/hector_exploration_planner/hector_exploration_base_global_planner_plugin.h

@@ -1,59 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Mark Sollweck, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-#ifndef HECTOR_EXPLORATION_BASE_GLOBAL_PLANNER_PLUGIN_H___
-#define HECTOR_EXPLORATION_BASE_GLOBAL_PLANNER_PLUGIN_H___
-
-#include "hector_exploration_planner.h"
-
-#include <nav_core/base_global_planner.h>
-#include <pluginlib/class_list_macros.h>
-
-//PLUGINLIB_DECLARE_CLASS(hector_global_planner, HectorGlobalPlanner, hector_global_planner::HectorGlobalPlanner, nav_core::BaseGlobalPlanner);
-
-namespace hector_exploration_planner{
-
-class HectorExplorationBaseGlobalPlannerPlugin : public nav_core::BaseGlobalPlanner
-{
-public:
-  HectorExplorationBaseGlobalPlannerPlugin();
-  virtual ~HectorExplorationBaseGlobalPlannerPlugin();
-
-  virtual bool makePlan(const geometry_msgs::PoseStamped& start,
-                        const geometry_msgs::PoseStamped& goal, std::vector<geometry_msgs::PoseStamped>& plan);
-
-  virtual void initialize(std::string name, costmap_2d::Costmap2DROS* costmap_ros);
-
-protected:
-  HectorExplorationPlanner* exploration_planner;
-};
-
-
-}
-
-#endif

+ 0 - 186
src/hector_exploration_planner/include/hector_exploration_planner/hector_exploration_planner.h

@@ -1,186 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Mark Sollweck, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-#ifndef HECTOR_EXPLORATION_PLANNER_H___
-#define HECTOR_EXPLORATION_PLANNER_H___
-
-#include <ros/ros.h>
-#include <costmap_2d/costmap_2d.h>
-#include <costmap_2d/costmap_2d_ros.h>
-#include <geometry_msgs/PoseStamped.h>
-
-#include <dynamic_reconfigure/server.h>
-
-#include <hector_exploration_planner/exploration_transform_vis.h>
-
-#include <boost/shared_array.hpp>
-
-namespace hector_exploration_planner{
-
-class ExplorationPlannerConfig;
-
-class HectorExplorationPlanner {
-public:
-  HectorExplorationPlanner();
-  ~HectorExplorationPlanner();
-  HectorExplorationPlanner(std::string name,costmap_2d::Costmap2DROS *costmap_ros);
-  void initialize(std::string name,costmap_2d::Costmap2DROS *costmap_ros);
-
-  void dynRecParamCallback(hector_exploration_planner::ExplorationPlannerConfig &config, uint32_t level);
-
-  /**
-   * Plans from start to given goal. If orientation quaternion of goal is all zeros, calls exploration instead. This is a hacky workaround that
-   * has to be refactored.
-   * @param start The start point
-   * @param goal The goal point (Use orientation quaternion all 0 to let exploration find goal point)
-   * @param plan The generated plan
-   */
-  bool makePlan(const geometry_msgs::PoseStamped &start, const geometry_msgs::PoseStamped &original_goal, std::vector<geometry_msgs::PoseStamped> &plan);
-
-  /**
-    * Given a start point, finds a frontier between known and unknown space and generates a plan to go there
-    * @param start The start point
-    * @param plan The plan to explore into unknown space
-    */
-  bool doExploration(const geometry_msgs::PoseStamped &start,std::vector<geometry_msgs::PoseStamped> &plan);
-
-  /**
-    * This can be used if there are no frontiers to unknown space left in the map. The robot will retrieve it's path travelled so far via a service
-    * and try to go to places having a large distance to this path.
-    * @param start The start point
-    * @param plan The plan to explore into unknown space
-    */
-  bool doInnerExploration(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> &plan);
-
-  bool getObservationPose(const geometry_msgs::PoseStamped& observation_pose, const double desired_distance, geometry_msgs::PoseStamped& new_observation_pose);
-
-  bool doAlternativeExploration(const geometry_msgs::PoseStamped &start,std::vector<geometry_msgs::PoseStamped> &plan, std::vector<geometry_msgs::PoseStamped> &oldplan);
-  bool findFrontiers(std::vector<geometry_msgs::PoseStamped> &frontiers, std::vector<geometry_msgs::PoseStamped> &noFrontiers);
-  bool findFrontiersCloseToPath(std::vector<geometry_msgs::PoseStamped> &frontiers);
-  bool findFrontiers(std::vector<geometry_msgs::PoseStamped> &frontiers);
-  bool findInnerFrontier(std::vector<geometry_msgs::PoseStamped> &innerFrontier);
-  
-  float angleDifferenceWall(const geometry_msgs::PoseStamped &start, const geometry_msgs::PoseStamped &goal);
-  bool exploreWalls(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> &goals);
-
-private:
-
-  enum LastMode{
-    FRONTIER_EXPLORE,
-    INNER_EXPLORE
-  } last_mode_;
-
-  /**
-   * Updates costmap data and resizes internal data structures if costmap size has changed. Should be called once before every planning command
-   */
-  void setupMapData();
-  void deleteMapData();
-  bool buildobstacle_trans_array_(bool use_inflated_obstacles);
-  bool buildexploration_trans_array_(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> goals,bool useAnglePenalty, bool use_cell_danger = true);
-  bool getTrajectory(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> goals, std::vector<geometry_msgs::PoseStamped> &plan);
-  bool recoveryMakePlan(const geometry_msgs::PoseStamped &start, const geometry_msgs::PoseStamped &goal,std::vector<geometry_msgs::PoseStamped> &plan);
-  unsigned int cellDanger(int point);
-  unsigned int angleDanger(float angle);
-
-  void saveMaps(std::string path);
-  void resetMaps();
-  void clearFrontiers();
-  bool isValid(int point);
-  bool isFree(int point);
-  bool isFreeFrontiers(int point);
-  bool isFrontier(int point);
-  float angleDifference(const geometry_msgs::PoseStamped &start, const geometry_msgs::PoseStamped &goal);
-  float getDistanceWeight(const geometry_msgs::PoseStamped &point1, const geometry_msgs::PoseStamped &point2);
-  double getYawToUnknown(int point);
-  bool isFrontierReached(int point);
-  bool isSameFrontier(int frontier_point1,int frontier_point2);
-
-  void getStraightPoints(int point, int points[]);
-  void getDiagonalPoints(int point, int points[]);
-  void getAdjacentPoints(int point, int points[]);
-  int left(int point);
-  int upleft(int point);
-  int up(int point);
-  int upright(int point);
-  int right(int point);
-  int downright(int point);
-  int down(int point);
-  int downleft(int point);
-
-  ros::Publisher observation_pose_pub_;
-  ros::Publisher goal_pose_pub_;
-
-  ros::Publisher visualization_pub_;
-  ros::ServiceClient path_service_client_;
-  costmap_2d::Costmap2DROS* costmap_ros_;
-  costmap_2d::Costmap2D* costmap_;
-
-  const unsigned char* occupancy_grid_array_;
-  boost::shared_array<unsigned int> exploration_trans_array_;
-  boost::shared_array<unsigned int> obstacle_trans_array_;
-  boost::shared_array<int> frontier_map_array_;
-  boost::shared_array<bool> is_goal_array_;
-
-  bool initialized_;
-  int previous_goal_;
-
-  std::string name;
-  unsigned int map_width_;
-  unsigned int map_height_;
-  unsigned int num_map_cells_;
-
-  // Parameters
-  bool p_plan_in_unknown_;
-  bool p_explore_close_to_path_;
-  bool p_use_inflated_obs_;
-  int p_goal_angle_penalty_;
-  int p_min_obstacle_dist_;
-  int p_min_frontier_size_;
-  double p_alpha_;
-  double p_dist_for_goal_reached_;
-  double p_same_frontier_dist_;
-  double p_obstacle_cutoff_dist_;
-  bool p_use_observation_pose_calculation_;
-  double p_observation_pose_desired_dist_;
-
-  double p_cos_of_allowed_observation_pose_angle_;
-  double p_close_to_path_target_distance_;
-
-  boost::shared_ptr<dynamic_reconfigure::Server<hector_exploration_planner::ExplorationPlannerConfig> > dyn_rec_server_;
-
-  boost::shared_ptr<ExplorationTransformVis> vis_;
-  boost::shared_ptr<ExplorationTransformVis> close_path_vis_;
-  boost::shared_ptr<ExplorationTransformVis> inner_vis_;
-  boost::shared_ptr<ExplorationTransformVis> obstacle_vis_;
-
-};
-}
-
-#endif
-
-

+ 0 - 76
src/hector_exploration_planner/package.xml

@@ -1,76 +0,0 @@
-<?xml version="1.0"?>
-<package>
-  <name>hector_exploration_planner</name>
-  <version>0.0.0</version>
-  <description>hector_exploration_planner is a planner that can both plan paths to goal points and generate goals to explore unknown environments</description>
-
-  <!-- One maintainer tag required, multiple allowed, one person per tag --> 
-  <!-- Example:  -->
-  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
-  <maintainer email="kohlbrecher@sim.tu-darmstadt.de">Stefan Kohlbrecher</maintainer>
-
-  <!-- One license tag required, multiple allowed, one license per tag -->
-  <!-- Commonly used license strings: -->
-  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
-  <license>BSD</license>
-
-
-  <!-- Url tags are optional, but mutiple are allowed, one per tag -->
-  <!-- Optional attribute type can be: website, bugtracker, or repository -->
-  <!-- Example: -->
-  <!-- <url type="website">http://wiki.ros.org/hector_exploration_planner</url> -->
-
-
-  <!-- Author tags are optional, mutiple are allowed, one per tag -->
-  <!-- Authors do not have to be maintianers, but could be -->
-  <!-- Example: -->
-  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->
-
-
-  <!-- The *_depend tags are used to specify dependencies -->
-  <!-- Dependencies can be catkin packages or system dependencies -->
-  <!-- Examples: -->
-  <!-- Use build_depend for packages you need at compile time: -->
-  <!--   <build_depend>message_generation</build_depend> -->
-  <!-- Use buildtool_depend for build tool packages: -->
-  <!--   <buildtool_depend>catkin</buildtool_depend> -->
-  <!-- Use run_depend for packages you need at runtime: -->
-  <!--   <run_depend>message_runtime</run_depend> -->
-  <!-- Use test_depend for packages you need only for testing: -->
-  <!--   <test_depend>gtest</test_depend> -->
-  <buildtool_depend>catkin</buildtool_depend>
-  <build_depend>cmake_modules</build_depend>  
-  <build_depend>costmap_2d</build_depend>
-  <build_depend>dynamic_reconfigure</build_depend>
-  <build_depend>geometry_msgs</build_depend>
-  <build_depend>hector_nav_msgs</build_depend>
-  <build_depend>nav_core</build_depend>
-  <build_depend>nav_msgs</build_depend>
-  <build_depend>pluginlib</build_depend>
-  <build_depend>rosconsole</build_depend>
-  <build_depend>roscpp</build_depend>
-  <build_depend>rospy</build_depend>
-  <run_depend>costmap_2d</run_depend>
-  <run_depend>dynamic_reconfigure</run_depend>
-  <run_depend>geometry_msgs</run_depend>
-  <run_depend>hector_nav_msgs</run_depend>
-  <run_depend>nav_core</run_depend>
-  <run_depend>nav_msgs</run_depend>
-  <run_depend>pluginlib</run_depend>
-  <run_depend>rosconsole</run_depend>
-  <run_depend>roscpp</run_depend>
-  <run_depend>rospy</run_depend>
-
-
-  <!-- The export tag contains other, unspecified, tags -->
-  <export>
-    <!-- You can specify that this package is a metapackage here: -->
-    <!-- <metapackage/> -->
-
-    <!-- Other tools can request additional information be placed here -->
-
-    <nav_core plugin="${prefix}/hector_exploration_base_global_planner_plugin.xml" />
-    <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib -lhector_exploration_planner"/>
-
-  </export>
-</package>

+ 0 - 55
src/hector_exploration_planner/src/hector_exploration_base_global_planner_plugin.cpp

@@ -1,55 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Mark Sollweck, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-#include <hector_exploration_planner/hector_exploration_base_global_planner_plugin.h>
-
-PLUGINLIB_DECLARE_CLASS(hector_exploration_planner, HectorExplorationBaseGlobalPlannerPlugin, hector_exploration_planner::HectorExplorationBaseGlobalPlannerPlugin, nav_core::BaseGlobalPlanner);
-
-using namespace hector_exploration_planner;
-
-
-HectorExplorationBaseGlobalPlannerPlugin::HectorExplorationBaseGlobalPlannerPlugin()
-{
-  exploration_planner = new HectorExplorationPlanner();
-}
-
-HectorExplorationBaseGlobalPlannerPlugin::~HectorExplorationBaseGlobalPlannerPlugin()
-{
-  delete exploration_planner;
-}
-
-bool HectorExplorationBaseGlobalPlannerPlugin::makePlan(const geometry_msgs::PoseStamped& start,
-                      const geometry_msgs::PoseStamped& goal, std::vector<geometry_msgs::PoseStamped>& plan)
-{
-  return exploration_planner->makePlan(start, goal, plan);
-}
-
-void HectorExplorationBaseGlobalPlannerPlugin::initialize(std::string name, costmap_2d::Costmap2DROS* costmap_ros)
-{
-  exploration_planner->initialize(name, costmap_ros);
-}

+ 0 - 1991
src/hector_exploration_planner/src/hector_exploration_planner.cpp

@@ -1,1991 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Mark Sollweck, Stefan Kohlbrecher, Florian Berz TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-#include <hector_exploration_planner/hector_exploration_planner.h>
-
-#include <visualization_msgs/Marker.h>
-#include <visualization_msgs/MarkerArray.h>
-#include <hector_nav_msgs/GetRobotTrajectory.h>
-#include <Eigen/Geometry>
-
-#include <hector_exploration_planner/ExplorationPlannerConfig.h>
-
-#define STRAIGHT_COST 100
-#define DIAGONAL_COST 141
-
-//#define STRAIGHT_COST 3
-//#define DIAGONAL_COST 4
-
-using namespace hector_exploration_planner;
-
-HectorExplorationPlanner::HectorExplorationPlanner()
-: costmap_ros_(0)
-, costmap_(0)
-, initialized_(false)
-, map_width_(0)
-, map_height_(0)
-, num_map_cells_(0)
-{}
-
-HectorExplorationPlanner::~HectorExplorationPlanner(){
-  this->deleteMapData();
-}
-
-HectorExplorationPlanner::HectorExplorationPlanner(std::string name, costmap_2d::Costmap2DROS *costmap_ros_in) :
-costmap_ros_(NULL), initialized_(false) {
-  HectorExplorationPlanner::initialize(name, costmap_ros_in);
-}
-
-void HectorExplorationPlanner::initialize(std::string name, costmap_2d::Costmap2DROS *costmap_ros_in){
-
-  last_mode_ = FRONTIER_EXPLORE;
-  // unknown: 255, obstacle 254, inflated: 253, free: 0
-
-  if(initialized_){
-    ROS_ERROR("[hector_exploration_planner] HectorExplorationPlanner is already initialized_! Please check why initialize() got called twice.");
-    return;
-  }
-
-  ROS_INFO("[hector_exploration_planner] Initializing HectorExplorationPlanner");
-
-  // initialize costmaps
-  this->costmap_ros_ = costmap_ros_in;
-  this->setupMapData();
-
-  // initialize parameters
-  ros::NodeHandle private_nh_("~/" + name);
-  ros::NodeHandle nh;
-  visualization_pub_ = private_nh_.advertise<visualization_msgs::Marker>("visualization_marker", 1);
-
-  observation_pose_pub_ = private_nh_.advertise<geometry_msgs::PoseStamped>("observation_pose", 1, true);
-  goal_pose_pub_ = private_nh_.advertise<geometry_msgs::PoseStamped>("goal_pose", 1, true);
-
-  dyn_rec_server_.reset(new dynamic_reconfigure::Server<hector_exploration_planner::ExplorationPlannerConfig>(ros::NodeHandle("~/hector_exploration_planner")));
-
-  dyn_rec_server_->setCallback(boost::bind(&HectorExplorationPlanner::dynRecParamCallback, this, _1, _2));
-
-  path_service_client_ = nh.serviceClient<hector_nav_msgs::GetRobotTrajectory>("trajectory");
-
-  ROS_INFO("[hector_exploration_planner] Parameter set. security_const: %f, min_obstacle_dist: %d, plan_in_unknown: %d, use_inflated_obstacle: %d, p_goal_angle_penalty_:%d , min_frontier_size: %d, p_dist_for_goal_reached_: %f, same_frontier: %f", p_alpha_, p_min_obstacle_dist_, p_plan_in_unknown_, p_use_inflated_obs_, p_goal_angle_penalty_, p_min_frontier_size_,p_dist_for_goal_reached_,p_same_frontier_dist_);
-  //p_min_obstacle_dist_ = p_min_obstacle_dist_ * STRAIGHT_COST;
-
-  this->name = name;
-  this->initialized_ = true;
-  this->previous_goal_ = -1;
-
-  vis_.reset(new ExplorationTransformVis("exploration_transform"));
-  close_path_vis_.reset(new ExplorationTransformVis("close_path_exploration_transform"));
-  inner_vis_.reset(new ExplorationTransformVis("inner_exploration_transform"));
-  obstacle_vis_.reset(new ExplorationTransformVis("obstacle_transform"));
-}
-
-void HectorExplorationPlanner::dynRecParamCallback(hector_exploration_planner::ExplorationPlannerConfig &config, uint32_t level)
-{
-  p_plan_in_unknown_ = config.plan_in_unknown;
-  p_explore_close_to_path_ = config.explore_close_to_path;
-  p_use_inflated_obs_ = config.use_inflated_obstacles;
-  p_goal_angle_penalty_ = config.goal_angle_penalty;
-  p_alpha_ = config.security_constant;
-  p_dist_for_goal_reached_ = config.dist_for_goal_reached;
-  p_same_frontier_dist_ = config.same_frontier_distance;
-  p_min_frontier_size_ = config.min_frontier_size;
-  p_min_obstacle_dist_ = config.min_obstacle_dist * STRAIGHT_COST;
-  p_obstacle_cutoff_dist_ = config.obstacle_cutoff_distance;
-
-  p_use_observation_pose_calculation_ = config.use_observation_pose_calculation;
-  p_observation_pose_desired_dist_ = config.observation_pose_desired_dist;
-  double angle_rad = config.observation_pose_allowed_angle * (M_PI / 180.0);
-  p_cos_of_allowed_observation_pose_angle_ = cos(angle_rad);
-  p_close_to_path_target_distance_ = config.close_to_path_target_distance;
-}
-
-bool HectorExplorationPlanner::makePlan(const geometry_msgs::PoseStamped &start, const geometry_msgs::PoseStamped &original_goal, std::vector<geometry_msgs::PoseStamped> &plan){
-
-  this->setupMapData();
-
-  // do exploration? (not used anymore? -> call doExploration())
-
-  if ((original_goal.pose.orientation.w == 0.0) && (original_goal.pose.orientation.x == 0.0) &&
-  (original_goal.pose.orientation.y == 0.0) && (original_goal.pose.orientation.z == 0.0)){
-      ROS_ERROR("Trying to plan with invalid quaternion, this shouldn't be done anymore, but we'll start exploration for now.");
-      return doExploration(start,plan);
-  }
-
-
-  // planning
-  ROS_INFO("[hector_exploration_planner] planning: starting to make a plan to given goal point");
-
-  // setup maps and goals
-  resetMaps();
-  plan.clear();
-
-  std::vector<geometry_msgs::PoseStamped> goals;
-
-  // create obstacle tranform
-  //buildobstacle_trans_array_(p_use_inflated_obs_);
-
-  goal_pose_pub_.publish(original_goal);
-
-  geometry_msgs::PoseStamped adjusted_goal;
-
-  if (p_use_observation_pose_calculation_){
-    ROS_INFO("Using observation pose calc.");
-    if (!this->getObservationPose(original_goal, p_observation_pose_desired_dist_, adjusted_goal)){
-      ROS_ERROR("getObservationPose returned false, no area around target point available to drive to!");
-      return false;
-    }
-  }else{
-    ROS_INFO("Not using observation pose calc.");
-    this->buildobstacle_trans_array_(true);
-    adjusted_goal = original_goal;
-  }
-
-  observation_pose_pub_.publish(adjusted_goal);
-
-  // plan to given goal
-  goals.push_back(adjusted_goal);
-
-  // make plan
-  if(!buildexploration_trans_array_(start,goals,true)){
-    return false;
-  }
-  if(!getTrajectory(start,goals,plan)){
-    return false;
-  }
-
-  // save and add last point
-  plan.push_back(adjusted_goal);
-  unsigned int mx,my;
-  costmap_->worldToMap(adjusted_goal.pose.position.x,adjusted_goal.pose.position.y,mx,my);
-  previous_goal_ = costmap_->getIndex(mx,my);
-
-  if ((original_goal.pose.orientation.w == 0.0) && (original_goal.pose.orientation.x == 0.0) &&
-  (original_goal.pose.orientation.y == 0.0) && (original_goal.pose.orientation.z == 0.0)){
-      geometry_msgs::PoseStamped second_last_pose;
-      geometry_msgs::PoseStamped last_pose;
-      second_last_pose = plan[plan.size()-2];
-      last_pose = plan[plan.size()-1];
-      last_pose.pose.orientation = second_last_pose.pose.orientation;
-      plan[plan.size()-1] = last_pose;
-
-
-  }
-
-  ROS_INFO("[hector_exploration_planner] planning: plan has been found! plansize: %u ", (unsigned int)plan.size());
-  return true;
-}
-
-bool HectorExplorationPlanner::doExploration(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> &plan){
-  this->setupMapData();
-
-  // setup maps and goals
-
-  resetMaps();
-  clearFrontiers();
-  plan.clear();
-
-  std::vector<geometry_msgs::PoseStamped> goals;
-
-  // create obstacle tranform
-  buildobstacle_trans_array_(p_use_inflated_obs_);
-
-
-  bool frontiers_found = false;
-
-  if (p_explore_close_to_path_){
-
-    frontiers_found = findFrontiersCloseToPath(goals);
-
-    if (!frontiers_found){
-      ROS_WARN("Close Exploration desired, but no frontiers found. Falling back to normal exploration!");
-      frontiers_found = findFrontiers(goals);
-    }
-
-  }else{
-    frontiers_found = findFrontiers(goals);
-  }
-
-  // search for frontiers
-  if(frontiers_found){
-
-    last_mode_ = FRONTIER_EXPLORE;
-    ROS_INFO("[hector_exploration_planner] exploration: found %u frontiers!", (unsigned int)goals.size());
-  } else {
-    ROS_INFO("[hector_exploration_planner] exploration: no frontiers have been found! starting inner-exploration");
-    return doInnerExploration(start,plan);
-  }
-
-  // make plan
-  if(!buildexploration_trans_array_(start,goals,true)){
-    return false;
-  }
-
-  if(!getTrajectory(start,goals,plan)){
-    ROS_INFO("[hector_exploration_planner] exploration: could not plan to frontier, starting inner-exploration");
-    return doInnerExploration(start,plan);
-  }
-
-  // update previous goal
-  if(!plan.empty()){
-    geometry_msgs::PoseStamped thisgoal = plan.back();
-    unsigned int mx,my;
-    costmap_->worldToMap(thisgoal.pose.position.x,thisgoal.pose.position.y,mx,my);
-    previous_goal_ = costmap_->getIndex(mx,my);
-  }
-
-
-  ROS_INFO("[hector_exploration_planner] exploration: plan to a frontier has been found! plansize: %u", (unsigned int)plan.size());
-  return true;
-}
-
-bool HectorExplorationPlanner::doInnerExploration(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> &plan){
-  ROS_INFO("[hector_exploration_planner] inner-exploration: starting exploration");
-
-  // setup maps and goals
-
-  resetMaps();
-  clearFrontiers();
-  plan.clear();
-
-  std::vector<geometry_msgs::PoseStamped> goals;
-
-  // create obstacle tranform
-  buildobstacle_trans_array_(p_use_inflated_obs_);
-
-  // If we have been in inner explore before, check if we have reached the previous inner explore goal
-  if (last_mode_ == INNER_EXPLORE){
-
-    tf::Stamped<tf::Pose> robotPose;
-    if(!costmap_ros_->getRobotPose(robotPose)){
-      ROS_WARN("[hector_exploration_planner]: Failed to get RobotPose");
-    }
-
-    unsigned int xm, ym;
-    costmap_->indexToCells(previous_goal_, xm, ym);
-
-    double xw, yw;
-    costmap_->mapToWorld(xm, ym, xw, yw);
-
-    double dx = xw - robotPose.getOrigin().getX();
-    double dy = yw - robotPose.getOrigin().getY();
-
-    //If we have not  reached the previous goal, try planning and moving toward it.
-    //If planning fails, we just continue below this block and try to find another inner frontier
-    if ( (dx*dx + dy*dy) > 0.5*0.5){
-
-      geometry_msgs::PoseStamped robotPoseMsg;
-      tf::poseStampedTFToMsg(robotPose, robotPoseMsg);
-
-      geometry_msgs::PoseStamped goalMsg;
-      goalMsg.pose.position.x = xw;
-      goalMsg.pose.position.y = yw;
-      goalMsg.pose.orientation.w = 1.0;
-
-      if(makePlan(robotPoseMsg, goalMsg, plan)){
-        //Successfully generated plan to (previous) inner explore goal
-        ROS_INFO("[hector_exploration_planner] inner-exploration: Planning to previous inner frontier");
-        last_mode_ = INNER_EXPLORE;
-        return true;
-      }
-    }
-  }
-
-  // search for frontiers
-  if(findInnerFrontier(goals)){
-    ROS_INFO("[hector_exploration_planner] inner-exploration: found %u inner-frontiers!", (unsigned int)goals.size());
-  } else {
-    ROS_WARN("[hector_exploration_planner] inner-exploration: no inner-frontiers have been found! exploration failed!");
-    return false;
-  }
-
-  // make plan
-  if(!buildexploration_trans_array_(start,goals,false)){
-    ROS_WARN("[hector_exploration_planner] inner-exploration: Creating exploration transform failed!");
-    return false;
-  }
-  if(!getTrajectory(start,goals,plan)){
-    ROS_WARN("[hector_exploration_planner] inner-exploration: could not plan to inner-frontier. exploration failed!");
-    return false;
-  }
-
-  // cutoff last points of plan due to sbpl error when planning close to walls
-
-  int plansize = plan.size() - 5;
-  if(plansize > 0 ){
-    plan.resize(plansize);
-  }
-
-  // update previous goal
-  if(!plan.empty()){
-    const geometry_msgs::PoseStamped& thisgoal = plan.back();
-    unsigned int mx,my;
-    costmap_->worldToMap(thisgoal.pose.position.x,thisgoal.pose.position.y,mx,my);
-    previous_goal_ = costmap_->getIndex(mx,my);
-    last_mode_ = INNER_EXPLORE;
-  }
-
-  ROS_INFO("[hector_exploration_planner] inner-exploration: plan to an inner-frontier has been found! plansize: %u", (unsigned int)plan.size());
-  return true;
-}
-
-bool HectorExplorationPlanner::getObservationPose(const geometry_msgs::PoseStamped& observation_pose, const double desired_distance, geometry_msgs::PoseStamped& new_observation_pose)
-{
-  // We call this from inside the planner, so map data setup and reset already happened
-  //this->setupMapData();
-  //resetMaps();
-
-  if (!p_use_observation_pose_calculation_){
-    ROS_WARN("getObservationPose was called although use_observation_pose_calculation param is set to false. Returning original pose!");
-    new_observation_pose = observation_pose;
-    this->buildobstacle_trans_array_(true);
-    return true;
-  }
-
-  unsigned int mxs,mys;
-  costmap_->worldToMap(observation_pose.pose.position.x, observation_pose.pose.position.y, mxs, mys);
-
-  double pose_yaw = tf::getYaw(observation_pose.pose.orientation);
-
-  Eigen::Vector2f obs_pose_dir_vec (cos(pose_yaw), sin(pose_yaw));
-
-  this->buildobstacle_trans_array_(true);
-
-  int searchSize = 2.0 / costmap_->getResolution();
-
-  int min_x = mxs - searchSize/2;
-  int min_y = mys - searchSize/2;
-
-  if (min_x < 0){
-    min_x = 0;
-  }
-
-  if (min_y < 0){
-    min_y = 0;
-  }
-
-  int max_x = mxs + searchSize/2;
-  int max_y = mys + searchSize/2;
-
-  if (max_x > static_cast<int>(costmap_->getSizeInCellsX())){
-    max_x = static_cast<int>(costmap_->getSizeInCellsX()-1);
-  }
-
-  if (max_y > static_cast<int>(costmap_->getSizeInCellsY())){
-    max_y = static_cast<int>(costmap_->getSizeInCellsY()-1);
-  }
-
-  int closest_x = -1;
-  int closest_y = -1;
-
-  unsigned int closest_sqr_dist = UINT_MAX;
-
-  bool no_information = true;
-
-  for (int x = min_x; x < max_x; ++x){
-    for (int y = min_y; y < max_y; ++y){
-
-      unsigned int point = costmap_->getIndex(x,y);
-
-      unsigned int obstacle_trans_val = obstacle_trans_array_[point];
-
-      if ( (obstacle_trans_val != UINT_MAX) && (obstacle_trans_val != 0) && (occupancy_grid_array_[point] != costmap_2d::NO_INFORMATION)){
-
-        no_information = false;
-
-        int diff_x = x - (int)mxs;
-        int diff_y = y - (int)mys;
-
-        unsigned int sqr_dist = diff_x*diff_x + diff_y*diff_y;
-
-        //std::cout << "diff: " << diff_x << " , " << diff_y << " sqr_dist: " << sqr_dist << " pos: " << x << " , " << y << " closest sqr dist: " << closest_sqr_dist << " obstrans " << obstacle_trans_array_[costmap_->getIndex(x,y)] << "\n";
-
-        if (sqr_dist < closest_sqr_dist){
-
-          Eigen::Vector2f curr_dir_vec(static_cast<float>(diff_x), static_cast<float>(diff_y));
-          curr_dir_vec.normalize();
-
-          if (curr_dir_vec.dot(obs_pose_dir_vec) <  p_cos_of_allowed_observation_pose_angle_){
-
-            closest_x = (unsigned int)x;
-            closest_y = (unsigned int)y;
-            closest_sqr_dist = sqr_dist;
-          }
-        }
-      }
-    }
-  }
-
-  if (no_information){
-    new_observation_pose.pose = observation_pose.pose;
-    new_observation_pose.pose.position.z = 0.0;
-    ROS_INFO("Observation pose unchanged as no information available around goal area");
-    return true;
-  }
-
-  //std::cout << "start: " << mxs << " , " << mys << " min: " << min_x << " , " << min_y << " max: " <<  max_x << " , " << max_y << "\n";
-  //std::cout << "pos: " << closest_x << " , " << closest_y << "\n";
-
-  // Found valid pose if both coords are larger than -1
-  if ((closest_x > -1) && (closest_y > -1)){
-
-    Eigen::Vector2d closest_point_world;
-    costmap_->mapToWorld(closest_x, closest_y, closest_point_world.x(),  closest_point_world.y());
-
-    Eigen::Vector2d original_goal_pose(observation_pose.pose.position.x, observation_pose.pose.position.y);
-
-    //geometry_msgs::PoseStamped pose;
-    new_observation_pose.header.frame_id = "map";
-    new_observation_pose.header.stamp = observation_pose.header.stamp;
-
-    Eigen::Vector2d dir_vec(original_goal_pose - closest_point_world);
-
-    double distance = dir_vec.norm();
-
-    //If we get back the original observation pose (or another one very close to it), return that
-    if (distance < (costmap_->getResolution() * 1.5)){
-      new_observation_pose.pose = observation_pose.pose;
-      new_observation_pose.pose.position.z = 0.0;
-      ROS_INFO("Observation pose unchanged");
-    }else{
-
-      if (desired_distance < distance){
-        new_observation_pose.pose.position.x = closest_point_world.x();
-        new_observation_pose.pose.position.y = closest_point_world.y();
-        new_observation_pose.pose.position.z = 0.0;
-      }else{
-
-        double test_distance = distance;
-
-        Eigen::Vector2d last_valid_pos(closest_point_world);
-
-        do{
-          test_distance += 0.1;
-
-          double distance_factor = test_distance / distance;
-
-          Eigen::Vector2d new_pos(original_goal_pose - dir_vec*distance_factor);
-
-          unsigned int x, y;
-          costmap_->worldToMap(new_pos[0], new_pos[1], x, y);
-          unsigned int idx = costmap_->getIndex(x,y);
-
-          if(!this->isFree(idx)){
-            break;
-          }
-
-          last_valid_pos = new_pos;
-
-        }while (test_distance < desired_distance);
-
-        new_observation_pose.pose.position.x = last_valid_pos.x();
-        new_observation_pose.pose.position.y = last_valid_pos.y();
-        new_observation_pose.pose.position.z = 0.0;
-      }
-
-      double angle = std::atan2(dir_vec.y(), dir_vec.x());
-
-      new_observation_pose.pose.orientation.w = cos(angle*0.5);
-      new_observation_pose.pose.orientation.x = 0.0;
-      new_observation_pose.pose.orientation.y = 0.0;
-      new_observation_pose.pose.orientation.z = sin(angle*0.5);
-      ROS_INFO("Observation pose moved away from wall");
-    }
-
-    return true;
-  }else{
-    // If closest vals are still -1, we didn't find a position
-    ROS_ERROR("Couldn't find observation pose for given point.");
-    return false;
-  }
-}
-
-bool HectorExplorationPlanner::doAlternativeExploration(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> &plan, std::vector<geometry_msgs::PoseStamped> &oldplan){
-  ROS_INFO("[hector_exploration_planner] alternative exploration: starting alternative exploration");
-
-  // setup maps and goals
-  resetMaps();
-  plan.clear();
-
-  std::vector<geometry_msgs::PoseStamped> goals;
-
-  std::vector<geometry_msgs::PoseStamped> old_frontier;
-  old_frontier.push_back(oldplan.back());
-
-  // create obstacle tranform
-  buildobstacle_trans_array_(p_use_inflated_obs_);
-
-  // search for frontiers
-  if(findFrontiers(goals,old_frontier)){
-    ROS_INFO("[hector_exploration_planner] alternative exploration: found %u frontiers!", (unsigned int) goals.size());
-  } else {
-    ROS_WARN("[hector_exploration_planner] alternative exploration: no frontiers have been found!");
-    return false;
-  }
-
-  // make plan
-  if(!buildexploration_trans_array_(start,goals,true)){
-    return false;
-  }
-  if(!getTrajectory(start,goals,plan)){
-    return false;
-  }
-
-  const geometry_msgs::PoseStamped& this_goal = plan.back();
-  unsigned int mx,my;
-  costmap_->worldToMap(this_goal.pose.position.x,this_goal.pose.position.y,mx,my);
-  previous_goal_ = costmap_->getIndex(mx,my);
-
-  ROS_INFO("[hector_exploration_planner] alternative exploration: plan to a frontier has been found! plansize: %u ", (unsigned int)plan.size());
-  return true;
-}
-
-float HectorExplorationPlanner::angleDifferenceWall(const geometry_msgs::PoseStamped &start, const geometry_msgs::PoseStamped &goal){
-  // setup start positions
-  unsigned int mxs,mys;
-  costmap_->worldToMap(start.pose.position.x,start.pose.position.y,mxs,mys);
-
-  unsigned int gx,gy;
-  costmap_->worldToMap(goal.pose.position.x,goal.pose.position.y,gx,gy);
-
-  int goal_proj_x = gx-mxs;
-  int goal_proj_y = gy-mys;
-
-  float start_angle = tf::getYaw(start.pose.orientation);
-  float goal_angle = std::atan2(goal_proj_y,goal_proj_x);
-
-  float both_angle = 0;
-  if(start_angle > goal_angle){
-    both_angle = start_angle - goal_angle;
-  } else {
-    both_angle = goal_angle - start_angle;
-  }
-
-  return both_angle;
-}
-
-bool HectorExplorationPlanner::exploreWalls(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> &plan){
-
-  //@TODO: Properly set this parameters
-  int startExploreWall = 1;
-
-  ROS_DEBUG("[hector_exploration_planner] wall-follow: exploreWalls");
-  unsigned int mx,my;
-  if(!costmap_->worldToMap(start.pose.position.x, start.pose.position.y, mx, my)){
-    ROS_WARN("[hector_exploration_planner] wall-follow: The start coordinates are outside the costmap!");
-    return false;
-  }
-  int currentPoint=costmap_->getIndex(mx, my);
-  int nextPoint;
-  int oldDirection = -1;
-  int k=0;
-  int loop=0;
-
-  while(k<50){
-    int adjacentPoints [8];
-    getAdjacentPoints(currentPoint, adjacentPoints);
-    int dirPoints [3];
-
-    unsigned int minDelta = UINT_MAX;
-    unsigned int maxDelta = 0;
-    unsigned int thisDelta;
-    float minAngle=3.1415; //Rad -> 180°
-
-    geometry_msgs::PoseStamped trajPoint;
-    unsigned int gx,gy;
-
-    if(oldDirection==-1){
-      // find robot orientation
-      for ( int i=0; i<8; i++){
-        costmap_->indexToCells((unsigned int)adjacentPoints[i],gx,gy);
-        double wx,wy;
-        costmap_->mapToWorld(gx,gy,wx,wy);
-        std::string global_frame = costmap_ros_->getGlobalFrameID();
-        trajPoint.header.frame_id = global_frame;
-        trajPoint.pose.position.x = wx;
-        trajPoint.pose.position.y = wy;
-        trajPoint.pose.position.z = 0.0;
-        float yaw = angleDifferenceWall(start, trajPoint);
-        if(yaw < minAngle){
-          minAngle=yaw;
-          oldDirection=i;
-        }
-      }
-    }
-
-    //search possible orientation
-
-    if (oldDirection == 0){
-      dirPoints[0]=oldDirection+4; //right-forward
-      dirPoints[1]=oldDirection;   //forward
-      dirPoints[2]=oldDirection+7; //left-forward
-    }
-    else if (oldDirection < 3){
-      dirPoints[0]=oldDirection+4;
-      dirPoints[1]=oldDirection;
-      dirPoints[2]=oldDirection+3;
-    }
-    else if (oldDirection == 3){
-      dirPoints[0]=oldDirection+4;
-      dirPoints[1]=oldDirection;
-      dirPoints[2]=oldDirection+3;
-    }
-    else if (oldDirection == 4){
-      dirPoints[0]=oldDirection-3;
-      dirPoints[1]=oldDirection;
-      dirPoints[2]=oldDirection-4;
-    }
-    else if (oldDirection < 7){
-      dirPoints[0]=oldDirection-3;
-      dirPoints[1]=oldDirection;
-      dirPoints[2]=oldDirection-4;
-    }
-    else if (oldDirection == 7){
-      dirPoints[0]=oldDirection-7;
-      dirPoints[1]=oldDirection;
-      dirPoints[2]=oldDirection-4;
-    }
-
-    // decide LHR or RHR
-    if(startExploreWall == -1){
-      if(obstacle_trans_array_[adjacentPoints[dirPoints[0]]] <= obstacle_trans_array_[adjacentPoints[dirPoints[2]]]){
-        startExploreWall = 0;
-        ROS_INFO("[hector_exploration_planner] wall-follow: RHR");//mirror inverted??
-      }
-      else {
-        startExploreWall = 1;
-        ROS_INFO("[hector_exploration_planner] wall-follow: LHR");//mirror inverted??
-      }
-    }
-
-
-
-    //switch left and right, LHR
-    if(startExploreWall == 1){
-      int temp=dirPoints[0];
-      dirPoints[0]=dirPoints[2];
-      dirPoints[2]=temp;
-    }
-
-
-    // find next point
-    int t=0;
-    for(int i=0; i<3; i++){
-      thisDelta = obstacle_trans_array_[adjacentPoints[dirPoints[i]]];
-
-      if (thisDelta > 3000 || loop > 7) // point is unknown or robot drive loop
-      {
-        int plansize = plan.size() - 4;
-        if(plansize > 0 ){
-          plan.resize(plansize);
-        }
-        ROS_DEBUG("[hector_exploration_planner] wall-follow: END: exploreWalls. Plansize %d", (int)plan.size());
-        return !plan.empty();
-      }
-
-      if(thisDelta >= (unsigned int) p_min_obstacle_dist_){
-        if(obstacle_trans_array_[currentPoint] >= (unsigned int) p_min_obstacle_dist_){
-          if(abs(thisDelta - p_min_obstacle_dist_) < minDelta){
-            minDelta = abs(thisDelta - p_min_obstacle_dist_);
-            nextPoint = adjacentPoints[dirPoints[i]];
-            oldDirection = dirPoints[i];
-          }
-        }
-        if(obstacle_trans_array_[currentPoint] < (unsigned int) p_min_obstacle_dist_){
-          if(thisDelta > maxDelta){
-            maxDelta = thisDelta;
-            nextPoint = adjacentPoints[dirPoints[i]];
-            oldDirection = dirPoints[i];
-          }
-        }
-      }
-      else {
-        if(thisDelta < obstacle_trans_array_[currentPoint]){
-          t++;
-        }
-        if(thisDelta > maxDelta){
-          maxDelta = thisDelta;
-          nextPoint = adjacentPoints[dirPoints[i]];
-          oldDirection = dirPoints[i];
-
-        }
-      }
-    }
-
-    if(t==3 && abs(obstacle_trans_array_[adjacentPoints[dirPoints[0]]] - obstacle_trans_array_[adjacentPoints[dirPoints[1]]]) < STRAIGHT_COST
-    && abs(obstacle_trans_array_[adjacentPoints[dirPoints[0]]] - obstacle_trans_array_[adjacentPoints[dirPoints[2]]]) < STRAIGHT_COST
-    && abs(obstacle_trans_array_[adjacentPoints[dirPoints[1]]] - obstacle_trans_array_[adjacentPoints[dirPoints[2]]]) < STRAIGHT_COST){
-      nextPoint=adjacentPoints[dirPoints[2]];
-      oldDirection=dirPoints[2];
-    }
-
-    if(oldDirection==dirPoints[2])
-      loop++;
-    else
-      loop=0;
-
-    // add point
-    unsigned int sx,sy;
-    costmap_->indexToCells((unsigned int)currentPoint,sx,sy);
-    costmap_->indexToCells((unsigned int)nextPoint,gx,gy);
-    double wx,wy;
-    costmap_->mapToWorld(sx,sy,wx,wy);
-    std::string global_frame = costmap_ros_->getGlobalFrameID();
-    trajPoint.header.frame_id = global_frame;
-    trajPoint.pose.position.x = wx;
-    trajPoint.pose.position.y = wy;
-    trajPoint.pose.position.z = 0.0;
-    // assign orientation
-    int dx = gx-sx;
-    int dy = gy-sy;
-    double yaw_path = std::atan2(dy,dx);
-    trajPoint.pose.orientation.x = 0.0;
-    trajPoint.pose.orientation.y = 0.0;
-    trajPoint.pose.orientation.z = sin(yaw_path*0.5f);
-    trajPoint.pose.orientation.w = cos(yaw_path*0.5f);
-    plan.push_back(trajPoint);
-
-    currentPoint=nextPoint;
-    k++;
-  }
-  ROS_DEBUG("[hector_exploration_planner] wall-follow: END: exploreWalls. Plansize %d", (int)plan.size());
-  return !plan.empty();
-}
-
-void HectorExplorationPlanner::setupMapData()
-{
-
-#ifdef COSTMAP_2D_LAYERED_COSTMAP_H_
-  costmap_ = costmap_ros_->getCostmap();
-#else
-  if (costmap_) delete costmap_;
-  costmap_ = new costmap_2d::Costmap2D;
-  costmap_ros_->getCostmapCopy(*costmap_);
-#endif
-
-  //Below code can be used to guarantee start pose is cleared. Somewhat risky.
-  //@TODO: Make available through dynamic reconfigure
-  /*
-  std::vector<geometry_msgs::Point> points;
-  costmap_ros_->getOrientedFootprint(points);
-
-  bool filled = costmap_->setConvexPolygonCost(points, costmap_2d::FREE_SPACE);
-
-  //std::vector<geometry_msgs::Point> points = costmap_ros_->getRobotFootprint();
-  for (size_t i = 0; i < points.size(); ++i)
-    std::cout << points[i];
-  if (filled)
-    ROS_INFO("Set costmap to free");
-  else
-    ROS_INFO("Failed to set costmap free");
-  */
-
-  if ((this->map_width_ != costmap_->getSizeInCellsX()) || (this->map_height_ != costmap_->getSizeInCellsY())){
-    map_width_ = costmap_->getSizeInCellsX();
-    map_height_ = costmap_->getSizeInCellsY();
-    num_map_cells_ = map_width_ * map_height_;
-
-    // initialize exploration_trans_array_, obstacle_trans_array_, goalMap and frontier_map_array_
-    exploration_trans_array_.reset(new unsigned int[num_map_cells_]);
-    obstacle_trans_array_.reset(new unsigned int[num_map_cells_]);
-    is_goal_array_.reset(new bool[num_map_cells_]);
-    frontier_map_array_.reset(new int[num_map_cells_]);
-    clearFrontiers();
-    resetMaps();
-  }
-
-  occupancy_grid_array_ = costmap_->getCharMap();
-}
-
-void HectorExplorationPlanner::deleteMapData()
-{
-  exploration_trans_array_.reset();
-  obstacle_trans_array_.reset();
-  is_goal_array_.reset();
-  frontier_map_array_.reset();
-}
-
-
-bool HectorExplorationPlanner::buildexploration_trans_array_(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> goals, bool useAnglePenalty, bool use_cell_danger){
-
-  ROS_DEBUG("[hector_exploration_planner] buildexploration_trans_array_");
-
-  // reset exploration transform
-  std::fill_n(exploration_trans_array_.get(), num_map_cells_, UINT_MAX);
-  std::fill_n(is_goal_array_.get(), num_map_cells_, false);
-
-  std::queue<int> myqueue;
-
-  size_t num_free_goals = 0;
-
-  // initialize goals
-  for(unsigned int i = 0; i < goals.size(); ++i){
-    // setup goal positions
-    unsigned int mx,my;
-
-    if(!costmap_->worldToMap(goals[i].pose.position.x,goals[i].pose.position.y,mx,my)){
-      //ROS_WARN("[hector_exploration_planner] The goal coordinates are outside the costmap!");
-      continue;
-    }
-
-    int goal_point = costmap_->getIndex(mx,my);
-
-    // Ignore free goal for the moment, check after iterating over all goals if there is not valid one at all
-    if(!isFree(goal_point)){
-      continue;
-    }else{
-      ++num_free_goals;
-    }
-
-    unsigned int init_cost = 0;
-    if(false){
-      init_cost = angleDanger(angleDifference(start,goals[i])) * getDistanceWeight(start,goals[i]);
-    }
-
-    exploration_trans_array_[goal_point] = init_cost;
-
-    // do not punish previous frontiers (oscillation)
-    if(false && isValid(previous_goal_)){
-      if(isSameFrontier(goal_point, previous_goal_)){
-        ROS_DEBUG("[hector_exploration_planner] same frontier: init with 0");
-        exploration_trans_array_[goal_point] = 0;
-      }
-    }
-
-    ROS_DEBUG("[hector_exploration_planner] Goal init cost: %d, point: %d", exploration_trans_array_[goal_point], goal_point);
-    is_goal_array_[goal_point] = true;
-    myqueue.push(goal_point);
-  }
-
-  if (num_free_goals == 0){
-    ROS_WARN("[hector_exploration_planner] All goal coordinates for exploration transform invalid (occupied or out of bounds), aborting.");
-    return false;
-  }
-
-  // exploration transform algorithm
-  if (use_cell_danger){
-    while(myqueue.size()){
-      int point = myqueue.front();
-      myqueue.pop();
-
-      unsigned int minimum = exploration_trans_array_[point];
-
-      int straightPoints[4];
-      getStraightPoints(point,straightPoints);
-      int diagonalPoints[4];
-      getDiagonalPoints(point,diagonalPoints);
-
-      // calculate the minimum exploration value of all adjacent cells
-      for (int i = 0; i < 4; ++i) {
-        if (isFree(straightPoints[i])) {
-          unsigned int neighbor_cost = minimum + STRAIGHT_COST + cellDanger(straightPoints[i]);
-
-          if (exploration_trans_array_[straightPoints[i]] > neighbor_cost) {
-            exploration_trans_array_[straightPoints[i]] = neighbor_cost;
-            myqueue.push(straightPoints[i]);
-          }
-        }
-
-        if (isFree(diagonalPoints[i])) {
-          unsigned int neighbor_cost = minimum + DIAGONAL_COST + cellDanger(diagonalPoints[i]);
-
-          if (exploration_trans_array_[diagonalPoints[i]] > neighbor_cost) {
-            exploration_trans_array_[diagonalPoints[i]] = neighbor_cost;
-            myqueue.push(diagonalPoints[i]);
-          }
-        }
-      }
-    }
-  }else{
-    while(myqueue.size()){
-      int point = myqueue.front();
-      myqueue.pop();
-
-      unsigned int minimum = exploration_trans_array_[point];
-
-      int straightPoints[4];
-      getStraightPoints(point,straightPoints);
-      int diagonalPoints[4];
-      getDiagonalPoints(point,diagonalPoints);
-
-      // calculate the minimum exploration value of all adjacent cells
-      for (int i = 0; i < 4; ++i) {
-        if (isFree(straightPoints[i])) {
-          unsigned int neighbor_cost = minimum + STRAIGHT_COST;
-
-          if (exploration_trans_array_[straightPoints[i]] > neighbor_cost) {
-            exploration_trans_array_[straightPoints[i]] = neighbor_cost;
-            myqueue.push(straightPoints[i]);
-          }
-        }
-
-        if (isFree(diagonalPoints[i])) {
-          unsigned int neighbor_cost = minimum + DIAGONAL_COST;
-
-          if (exploration_trans_array_[diagonalPoints[i]] > neighbor_cost) {
-            exploration_trans_array_[diagonalPoints[i]] = neighbor_cost;
-            myqueue.push(diagonalPoints[i]);
-          }
-        }
-      }
-    }
-  }
-
-  ROS_DEBUG("[hector_exploration_planner] END: buildexploration_trans_array_");
-
-  vis_->publishVisOnDemand(*costmap_, exploration_trans_array_.get());
-  return true;
-}
-
-bool HectorExplorationPlanner::buildobstacle_trans_array_(bool use_inflated_obstacles){
-  ROS_DEBUG("[hector_exploration_planner] buildobstacle_trans_array_");
-  std::queue<int> myqueue;
-
-  // init obstacles
-  for(unsigned int i=0; i < num_map_cells_; ++i){
-    if(occupancy_grid_array_[i] == costmap_2d::LETHAL_OBSTACLE){
-      myqueue.push(i);
-      obstacle_trans_array_[i] = 0;
-    } else if(use_inflated_obstacles){
-      if(occupancy_grid_array_[i] == costmap_2d::INSCRIBED_INFLATED_OBSTACLE){
-        myqueue.push(i);
-        obstacle_trans_array_[i] = 0;
-      }
-    }
-  }
-
-  unsigned int obstacle_cutoff_value = static_cast<unsigned int>((p_obstacle_cutoff_dist_ / costmap_->getResolution()) * STRAIGHT_COST + 0.5);
-
-  // obstacle transform algorithm
-  while(myqueue.size()){
-    int point = myqueue.front();
-    myqueue.pop();
-
-    unsigned int minimum = obstacle_trans_array_[point];
-    if (minimum > obstacle_cutoff_value) continue;
-
-    int straightPoints[4];
-    getStraightPoints(point,straightPoints);
-    int diagonalPoints[4];
-    getDiagonalPoints(point,diagonalPoints);
-
-    // check all 8 directions
-    for(int i = 0; i < 4; ++i){
-      if (isValid(straightPoints[i]) && (obstacle_trans_array_[straightPoints[i]] > minimum + STRAIGHT_COST)) {
-        obstacle_trans_array_[straightPoints[i]] = minimum + STRAIGHT_COST;
-        myqueue.push(straightPoints[i]);
-      }
-      if (isValid(diagonalPoints[i]) && (obstacle_trans_array_[diagonalPoints[i]] > minimum + DIAGONAL_COST)) {
-        obstacle_trans_array_[diagonalPoints[i]] = minimum + DIAGONAL_COST;
-        myqueue.push(diagonalPoints[i]);
-      }
-    }
-  }
-
-  ROS_DEBUG("[hector_exploration_planner] END: buildobstacle_trans_array_");
-
-  obstacle_vis_->publishVisOnDemand(*costmap_, obstacle_trans_array_.get());
-  return true;
-}
-
-bool HectorExplorationPlanner::getTrajectory(const geometry_msgs::PoseStamped &start, std::vector<geometry_msgs::PoseStamped> goals, std::vector<geometry_msgs::PoseStamped> &plan){
-
-  ROS_DEBUG("[hector_exploration_planner] getTrajectory");
-
-  // setup start positions
-  unsigned int mx,my;
-
-  if(!costmap_->worldToMap(start.pose.position.x,start.pose.position.y,mx,my)){
-    ROS_WARN("[hector_exploration_planner] The start coordinates are outside the costmap!");
-    return false;
-  }
-
-  int currentPoint = costmap_->getIndex(mx,my);
-  int nextPoint = currentPoint;
-
-
-
-  geometry_msgs::PoseStamped trajPoint;
-  std::string global_frame = costmap_ros_->getGlobalFrameID();
-  trajPoint.header.frame_id = global_frame;
-
-  if (is_goal_array_[currentPoint]){
-    ROS_INFO("Already at goal point position. No pose vector generated.");
-    return true;
-  }
-
-  while(!is_goal_array_[currentPoint]){
-    int thisDelta;
-    int adjacentPoints[8];
-    getAdjacentPoints(currentPoint,adjacentPoints);
-
-    int maxDelta = 0;
-
-    for(int i = 0; i < 8; ++i){
-      if(isFree(adjacentPoints[i])){
-        thisDelta = exploration_trans_array_[currentPoint] - exploration_trans_array_[adjacentPoints[i]];
-        if(thisDelta > maxDelta){
-          maxDelta = thisDelta;
-          nextPoint = adjacentPoints[i];
-        }
-      }
-    }
-
-    // This happens when there is no valid exploration transform data at the start point for example
-    if(maxDelta == 0){
-      ROS_WARN("[hector_exploration_planner] No path to the goal could be found by following gradient!");
-      return false;
-    }
-
-
-    // make trajectory point
-    unsigned int sx,sy,gx,gy;
-    costmap_->indexToCells((unsigned int)currentPoint,sx,sy);
-    costmap_->indexToCells((unsigned int)nextPoint,gx,gy);
-    double wx,wy;
-    costmap_->mapToWorld(sx,sy,wx,wy);
-
-    trajPoint.pose.position.x = wx;
-    trajPoint.pose.position.y = wy;
-    trajPoint.pose.position.z = 0.0;
-
-    // assign orientation
-    int dx = gx-sx;
-    int dy = gy-sy;
-    double yaw_path = std::atan2(dy,dx);
-    trajPoint.pose.orientation.x = 0.0;
-    trajPoint.pose.orientation.y = 0.0;
-    trajPoint.pose.orientation.z = sin(yaw_path*0.5f);
-    trajPoint.pose.orientation.w = cos(yaw_path*0.5f);
-
-    plan.push_back(trajPoint);
-
-    currentPoint = nextPoint;
-    maxDelta = 0;
-  }
-
-  ROS_DEBUG("[hector_exploration_planner] END: getTrajectory. Plansize %u", (unsigned int)plan.size());
-  return !plan.empty();
-}
-
-bool HectorExplorationPlanner::findFrontiers(std::vector<geometry_msgs::PoseStamped> &frontiers){
-  std::vector<geometry_msgs::PoseStamped> empty_vec;
-  return findFrontiers(frontiers,empty_vec);
-}
-
-/*
- * searches the occupancy grid for frontier cells and merges them into one target point per frontier.
- * The returned frontiers are in world coordinates.
- */
-bool HectorExplorationPlanner::findFrontiersCloseToPath(std::vector<geometry_msgs::PoseStamped> &frontiers){
-
-  clearFrontiers();
-  frontiers.clear();
-
-  // get the trajectory as seeds for the exploration transform
-  hector_nav_msgs::GetRobotTrajectory srv_path;
-  if (path_service_client_.call(srv_path)){
-
-    std::vector<geometry_msgs::PoseStamped>& traj_vector (srv_path.response.trajectory.poses);
-
-    // We push poses of the travelled trajectory to the goals vector for building the exploration transform
-    std::vector<geometry_msgs::PoseStamped> goals;
-
-    size_t size = traj_vector.size();
-    ROS_INFO("[hector_exploration_planner] Size of trajectory vector for close exploration %u", (unsigned int)size);
-
-    if(size > 0){
-      geometry_msgs::PoseStamped lastPose = traj_vector[size-1];
-      goals.push_back(lastPose);
-
-      if (size > 1){
-
-        for(int i = static_cast<int>(size-2); i >= 0; --i){
-          const geometry_msgs::PoseStamped& pose = traj_vector[i];
-          unsigned int x,y;
-          costmap_->worldToMap(pose.pose.position.x,pose.pose.position.y,x,y);
-          unsigned int m_point = costmap_->getIndex(x,y);
-
-          double dx = lastPose.pose.position.x - pose.pose.position.x;
-          double dy = lastPose.pose.position.y - pose.pose.position.y;
-
-          if((dx*dx) + (dy*dy) > (0.25*0.25)){
-            goals.push_back(pose);
-            lastPose = pose;
-          }
-        }
-
-        ROS_INFO("[hector_exploration_planner] pushed %u goals (trajectory) for close to robot frontier search", (unsigned int)goals.size());
-
-        // make exploration transform
-        tf::Stamped<tf::Pose> robotPose;
-        if(!costmap_ros_->getRobotPose(robotPose)){
-          ROS_WARN("[hector_exploration_planner]: Failed to get RobotPose");
-        }
-        geometry_msgs::PoseStamped robotPoseMsg;
-        tf::poseStampedTFToMsg(robotPose, robotPoseMsg);
-
-        if (!buildexploration_trans_array_(robotPoseMsg, goals, false, false)){
-          ROS_WARN("[hector_exploration_planner]: Creating exploration transform array in find inner frontier failed, aborting.");
-          return false;
-        }
-
-        close_path_vis_->publishVisOnDemand(*costmap_, exploration_trans_array_.get());
-
-        unsigned int explore_threshold = static_cast<unsigned int> (static_cast<double>(STRAIGHT_COST) * (1.0/costmap_->getResolution()) * p_close_to_path_target_distance_);
-
-        //std::vector<geometry_msgs::PoseStamped> close_frontiers;
-
-        for(unsigned int i = 0; i < num_map_cells_; ++i){
-
-          unsigned int current_val = exploration_trans_array_[i];
-
-          if(current_val < UINT_MAX){
-
-            if (current_val >= explore_threshold){ //&& current_val <= explore_threshold+ DIAGONAL_COST){
-              geometry_msgs::PoseStamped finalFrontier;
-              double wx,wy;
-              unsigned int mx,my;
-              costmap_->indexToCells(i, mx, my);
-              costmap_->mapToWorld(mx,my,wx,wy);
-              std::string global_frame = costmap_ros_->getGlobalFrameID();
-              finalFrontier.header.frame_id = global_frame;
-              finalFrontier.pose.position.x = wx;
-              finalFrontier.pose.position.y = wy;
-              finalFrontier.pose.position.z = 0.0;
-
-              double yaw = getYawToUnknown(costmap_->getIndex(mx,my));
-
-              //if(frontier_is_valid){
-
-              finalFrontier.pose.orientation = tf::createQuaternionMsgFromYaw(yaw);
-
-              frontiers.push_back(finalFrontier);
-
-            }
-
-          }
-        }
-
-        return frontiers.size() > 0;
-
-
-
-
-
-      }
-    }
-  }
-
-
-
-
-
-  // list of all frontiers in the occupancy grid
-  std::vector<int> allFrontiers;
-
-  // check for all cells in the occupancy grid whether or not they are frontier cells
-  for(unsigned int i = 0; i < num_map_cells_; ++i){
-    if(isFrontier(i)){
-      allFrontiers.push_back(i);
-    }
-  }
-
-  for(unsigned int i = 0; i < allFrontiers.size(); ++i){
-    if(!isFrontierReached(allFrontiers[i])){
-      geometry_msgs::PoseStamped finalFrontier;
-      double wx,wy;
-      unsigned int mx,my;
-      costmap_->indexToCells(allFrontiers[i], mx, my);
-      costmap_->mapToWorld(mx,my,wx,wy);
-      std::string global_frame = costmap_ros_->getGlobalFrameID();
-      finalFrontier.header.frame_id = global_frame;
-      finalFrontier.pose.position.x = wx;
-      finalFrontier.pose.position.y = wy;
-      finalFrontier.pose.position.z = 0.0;
-
-      double yaw = getYawToUnknown(costmap_->getIndex(mx,my));
-
-      //if(frontier_is_valid){
-
-      finalFrontier.pose.orientation = tf::createQuaternionMsgFromYaw(yaw);
-
-      frontiers.push_back(finalFrontier);
-    }
-    //}
-  }
-
-  return (frontiers.size() > 0);
-}
-
-/*
- * searches the occupancy grid for frontier cells and merges them into one target point per frontier.
- * The returned frontiers are in world coordinates.
- */
-bool HectorExplorationPlanner::findFrontiers(std::vector<geometry_msgs::PoseStamped> &frontiers, std::vector<geometry_msgs::PoseStamped> &noFrontiers){
-
-  // get latest costmap
-  clearFrontiers();
-
-  // list of all frontiers in the occupancy grid
-  std::vector<int> allFrontiers;
-
-  // check for all cells in the occupancy grid whether or not they are frontier cells
-  for(unsigned int i = 0; i < num_map_cells_; ++i){
-    if(isFrontier(i)){
-      allFrontiers.push_back(i);
-    }
-  }
-
-  for(unsigned int i = 0; i < allFrontiers.size(); ++i){
-    if(!isFrontierReached(allFrontiers[i])){
-      geometry_msgs::PoseStamped finalFrontier;
-      double wx,wy;
-      unsigned int mx,my;
-      costmap_->indexToCells(allFrontiers[i], mx, my);
-      costmap_->mapToWorld(mx,my,wx,wy);
-      std::string global_frame = costmap_ros_->getGlobalFrameID();
-      finalFrontier.header.frame_id = global_frame;
-      finalFrontier.pose.position.x = wx;
-      finalFrontier.pose.position.y = wy;
-      finalFrontier.pose.position.z = 0.0;
-
-      double yaw = getYawToUnknown(costmap_->getIndex(mx,my));
-
-      //if(frontier_is_valid){
-
-      finalFrontier.pose.orientation = tf::createQuaternionMsgFromYaw(yaw);
-
-      frontiers.push_back(finalFrontier);
-    }
-    //}
-  }
-
-  return (frontiers.size() > 0);
-
-  //@TODO: Review and possibly remove unused code below
-
-  // value of the next blob
-  int nextBlobValue = 1;
-  std::list<int> usedBlobs;
-
-  for(unsigned int i = 0; i < allFrontiers.size(); ++i){
-
-    // get all adjacent blobs to the current frontier point
-    int currentPoint = allFrontiers[i];
-    int adjacentPoints[8];
-    getAdjacentPoints(currentPoint,adjacentPoints);
-
-    std::list<int> blobs;
-
-    for(int j = 0; j < 8; j++){
-      if(isValid(adjacentPoints[j]) && (frontier_map_array_[adjacentPoints[j]] > 0)){
-        blobs.push_back(frontier_map_array_[adjacentPoints[j]]);
-      }
-    }
-    blobs.unique();
-
-    if(blobs.empty()){
-      // create new blob
-      frontier_map_array_[currentPoint] = nextBlobValue;
-      usedBlobs.push_back(nextBlobValue);
-      nextBlobValue++;
-    } else {
-      // merge all found blobs
-      int blobMergeVal = 0;
-
-      for(std::list<int>::iterator adjBlob = blobs.begin(); adjBlob != blobs.end(); ++adjBlob){
-        if(adjBlob == blobs.begin()){
-          blobMergeVal = *adjBlob;
-          frontier_map_array_[currentPoint] = blobMergeVal;
-        } else {
-
-          for(unsigned int k = 0; k < allFrontiers.size(); k++){
-            if(frontier_map_array_[allFrontiers[k]] == *adjBlob){
-              usedBlobs.remove(*adjBlob);
-              frontier_map_array_[allFrontiers[k]] = blobMergeVal;
-            }
-          }
-        }
-      }
-    }
-  }
-
-  int id = 1;
-
-  bool visualization_requested = (visualization_pub_.getNumSubscribers() > 0);
-
-  // summarize every blob into a single point (maximum obstacle_trans_array_ value)
-  for(std::list<int>::iterator currentBlob = usedBlobs.begin(); currentBlob != usedBlobs.end(); ++currentBlob){
-    int current_frontier_size = 0;
-    int max_obs_idx = 0;
-
-    for(unsigned int i = 0; i < allFrontiers.size(); ++i){
-      int point = allFrontiers[i];
-
-      if(frontier_map_array_[point] == *currentBlob){
-        current_frontier_size++;
-        if(obstacle_trans_array_[point] > obstacle_trans_array_[allFrontiers[max_obs_idx]]){
-          max_obs_idx = i;
-        }
-      }
-    }
-
-    if(current_frontier_size < p_min_frontier_size_){
-      continue;
-    }
-
-    int frontier_point = allFrontiers[max_obs_idx];
-    unsigned int x,y;
-    costmap_->indexToCells(frontier_point,x,y);
-
-    // check if frontier is valid (not to close to robot and not in noFrontiers vector
-    bool frontier_is_valid = true;
-
-    if(isFrontierReached(frontier_point)){
-      frontier_is_valid = false;
-    }
-
-    for(size_t i = 0; i < noFrontiers.size(); ++i){
-      const geometry_msgs::PoseStamped& noFrontier = noFrontiers[i];
-      unsigned int mx,my;
-      costmap_->worldToMap(noFrontier.pose.position.x,noFrontier.pose.position.y,mx,my);
-      int no_frontier_point = costmap_->getIndex(x,y);
-      if(isSameFrontier(frontier_point,no_frontier_point)){
-        frontier_is_valid = false;
-      }
-    }
-
-    geometry_msgs::PoseStamped finalFrontier;
-    double wx,wy;
-    costmap_->mapToWorld(x,y,wx,wy);
-    std::string global_frame = costmap_ros_->getGlobalFrameID();
-    finalFrontier.header.frame_id = global_frame;
-    finalFrontier.pose.position.x = wx;
-    finalFrontier.pose.position.y = wy;
-    finalFrontier.pose.position.z = 0.0;
-
-    double yaw = getYawToUnknown(costmap_->getIndex(x,y));
-
-    if(frontier_is_valid){
-
-      finalFrontier.pose.orientation = tf::createQuaternionMsgFromYaw(yaw);
-      frontiers.push_back(finalFrontier);
-    }
-
-    // visualization (export to method?)
-    if(visualization_requested){
-      visualization_msgs::Marker marker;
-      marker.header.frame_id = "map";
-      marker.header.stamp = ros::Time();
-      marker.ns = "hector_exploration_planner";
-      marker.id = id++;
-      marker.type = visualization_msgs::Marker::ARROW;
-      marker.action = visualization_msgs::Marker::ADD;
-      marker.pose.position.x = wx;
-      marker.pose.position.y = wy;
-      marker.pose.position.z = 0.0;
-      marker.pose.orientation = tf::createQuaternionMsgFromYaw(yaw);
-      marker.scale.x = 0.2;
-      marker.scale.y = 0.2;
-      marker.scale.z = 0.2;
-      marker.color.a = 1.0;
-
-      if(frontier_is_valid){
-        marker.color.r = 0.0;
-        marker.color.g = 1.0;
-      }else{
-        marker.color.r = 1.0;
-        marker.color.g = 0.0;
-      }
-
-      marker.color.b = 0.0;
-      marker.lifetime = ros::Duration(5,0);
-      visualization_pub_.publish(marker);
-    }
-
-  }
-  return !frontiers.empty();
-}
-
-bool HectorExplorationPlanner::findInnerFrontier(std::vector<geometry_msgs::PoseStamped> &innerFrontier){
-  clearFrontiers();
-
-  // get the trajectory as seeds for the exploration transform
-  hector_nav_msgs::GetRobotTrajectory srv_path;
-  if (path_service_client_.call(srv_path)){
-
-    std::vector<geometry_msgs::PoseStamped>& traj_vector (srv_path.response.trajectory.poses);
-
-    // We push poses of the travelled trajectory to the goals vector for building the exploration transform
-    std::vector<geometry_msgs::PoseStamped> goals;
-
-    size_t size = traj_vector.size();
-    ROS_DEBUG("[hector_exploration_planner] size of trajectory vector %u", (unsigned int)size);
-
-    if(size > 0){
-      geometry_msgs::PoseStamped lastPose = traj_vector[size-1];
-      goals.push_back(lastPose);
-
-      if (size > 1){
-
-        // Allow collision at start in case vehicle is (very) close to wall
-        bool collision_allowed = true;
-
-        for(int i = static_cast<int>(size-2); i >= 0; --i){
-          const geometry_msgs::PoseStamped& pose = traj_vector[i];
-          unsigned int x,y;
-          costmap_->worldToMap(pose.pose.position.x,pose.pose.position.y,x,y);
-          unsigned int m_point = costmap_->getIndex(x,y);
-
-          double dx = lastPose.pose.position.x - pose.pose.position.x;
-          double dy = lastPose.pose.position.y - pose.pose.position.y;
-
-          bool point_in_free_space = isFreeFrontiers(m_point);
-
-          // extract points with 0.5m distance (if free)
-          if(point_in_free_space){
-            if((dx*dx) + (dy*dy) > (0.25*0.25)){
-              goals.push_back(pose);
-              lastPose = pose;
-              collision_allowed = false;
-            }
-          }
-
-          if (!point_in_free_space && !collision_allowed){
-            break;
-          }
-        }
-      }
-
-
-      ROS_DEBUG("[hector_exploration_planner] pushed %u goals (trajectory) for inner frontier-search", (unsigned int)goals.size());
-
-      // make exploration transform
-      tf::Stamped<tf::Pose> robotPose;
-      if(!costmap_ros_->getRobotPose(robotPose)){
-        ROS_WARN("[hector_exploration_planner]: Failed to get RobotPose");
-      }
-      geometry_msgs::PoseStamped robotPoseMsg;
-      tf::poseStampedTFToMsg(robotPose, robotPoseMsg);
-
-      if (!buildexploration_trans_array_(robotPoseMsg, goals, false)){
-        ROS_WARN("[hector_exploration_planner]: Creating exploration transform array in find inner frontier failed, aborting.");
-        return false;
-      }
-
-      inner_vis_->publishVisOnDemand(*costmap_, exploration_trans_array_.get());
-
-      unsigned int x,y;
-      costmap_->worldToMap(robotPoseMsg.pose.position.x,robotPoseMsg.pose.position.y,x,y);
-
-
-
-
-      // get point with maximal distance to trajectory
-      int max_exploration_trans_point = -1;
-      unsigned int max_exploration_trans_val = 0;
-
-      for(unsigned int i = 0; i < num_map_cells_; ++i){
-
-        if(exploration_trans_array_[i] < UINT_MAX){
-          if(exploration_trans_array_[i] > max_exploration_trans_val){
-            if(!isFrontierReached(i)){
-              max_exploration_trans_point = i;
-              max_exploration_trans_val = exploration_trans_array_[i];
-            }
-          }
-        }
-      }
-
-      if (max_exploration_trans_point == 0){
-        ROS_WARN("[hector_exploration_planner]: Couldn't find max exploration transform point for inner exploration, aborting.");
-        return false;
-      }
-
-      geometry_msgs::PoseStamped finalFrontier;
-      unsigned int fx,fy;
-      double wfx,wfy;
-      costmap_->indexToCells(max_exploration_trans_point,fx,fy);
-      costmap_->mapToWorld(fx,fy,wfx,wfy);
-      std::string global_frame = costmap_ros_->getGlobalFrameID();
-      finalFrontier.header.frame_id = global_frame;
-      finalFrontier.pose.position.x = wfx;
-      finalFrontier.pose.position.y = wfy;
-      finalFrontier.pose.position.z = 0.0;
-
-      // assign orientation
-      int dx = fx-x;
-      int dy = fy-y;
-      double yaw_path = std::atan2(dy,dx);
-      finalFrontier.pose.orientation.x = 0.0;
-      finalFrontier.pose.orientation.y = 0.0;
-      finalFrontier.pose.orientation.z = sin(yaw_path*0.5f);
-      finalFrontier.pose.orientation.w = cos(yaw_path*0.5f);
-
-      innerFrontier.push_back(finalFrontier);
-
-      if(visualization_pub_.getNumSubscribers() > 0){
-        visualization_msgs::Marker marker;
-        marker.header.frame_id = "map";
-        marker.header.stamp = ros::Time();
-        marker.ns = "hector_exploration_planner";
-        marker.id = 100;
-        marker.type = visualization_msgs::Marker::ARROW;
-        marker.action = visualization_msgs::Marker::ADD;
-        marker.pose.position.x = wfx;
-        marker.pose.position.y = wfy;
-        marker.pose.position.z = 0.0;
-        marker.pose.orientation = tf::createQuaternionMsgFromYaw(yaw_path);
-        marker.scale.x = 0.2;
-        marker.scale.y = 0.2;
-        marker.scale.z = 0.2;
-        marker.color.a = 1.0;
-        marker.color.r = 0.0;
-        marker.color.g = 0.0;
-        marker.color.b = 1.0;
-        marker.lifetime = ros::Duration(5,0);
-        visualization_pub_.publish(marker);
-      }
-      return true;
-    }
-  }
-  return false;
-}
-
-/*
- * checks if a given point is a frontier cell. a frontier cell is a cell in the occupancy grid
- * that seperates known from unknown space. Therefore the cell has to be free but at least three
- * of its neighbours need to be unknown
- */
-bool HectorExplorationPlanner::isFrontier(int point){
-  if(isFreeFrontiers(point)){
-
-    int adjacentPoints[8];
-    getAdjacentPoints(point,adjacentPoints);
-
-    for(int i = 0; i < 8; ++i){
-      if(isValid(adjacentPoints[i])){
-        if(occupancy_grid_array_[adjacentPoints[i]] == costmap_2d::NO_INFORMATION){
-
-          int no_inf_count = 0;
-          int noInfPoints[8];
-          getAdjacentPoints(adjacentPoints[i],noInfPoints);
-          for(int j = 0; j < 8; j++){
-
-
-            if( isValid(noInfPoints[j]) && occupancy_grid_array_[noInfPoints[j]] == costmap_2d::NO_INFORMATION){
-              ++no_inf_count;
-
-              if(no_inf_count > 2){
-                return true;
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-
-  return false;
-}
-
-
-void HectorExplorationPlanner::resetMaps(){
-  std::fill_n(exploration_trans_array_.get(), num_map_cells_, UINT_MAX);
-  std::fill_n(obstacle_trans_array_.get(), num_map_cells_, UINT_MAX);
-  std::fill_n(is_goal_array_.get(), num_map_cells_, false);
-}
-
-void HectorExplorationPlanner::clearFrontiers(){
-  std::fill_n(frontier_map_array_.get(), num_map_cells_, 0);
-}
-
-inline bool HectorExplorationPlanner::isValid(int point){
-  return (point>=0);
-}
-
-bool HectorExplorationPlanner::isFree(int point){
-
-  if(isValid(point)){
-    // if a point is not inscribed_inflated_obstacle, leathal_obstacle or no_information, its free
-
-
-    if(p_use_inflated_obs_){
-      if(occupancy_grid_array_[point] < costmap_2d::INSCRIBED_INFLATED_OBSTACLE){
-        return true;
-      }
-    } else {
-      if(occupancy_grid_array_[point] <= costmap_2d::INSCRIBED_INFLATED_OBSTACLE){
-        return true;
-      }
-    }
-
-    if(p_plan_in_unknown_){
-      if(occupancy_grid_array_[point] == costmap_2d::NO_INFORMATION){
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-bool HectorExplorationPlanner::isFreeFrontiers(int point){
-
-  if(isValid(point)){
-    // if a point is not inscribed_inflated_obstacle, leathal_obstacle or no_information, its free
-
-
-    if(p_use_inflated_obs_){
-      if(occupancy_grid_array_[point] < costmap_2d::INSCRIBED_INFLATED_OBSTACLE){
-        return true;
-      }
-    } else {
-      if(occupancy_grid_array_[point] <= costmap_2d::INSCRIBED_INFLATED_OBSTACLE){
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-bool HectorExplorationPlanner::isFrontierReached(int point){
-
-  tf::Stamped<tf::Pose> robotPose;
-  if(!costmap_ros_->getRobotPose(robotPose)){
-    ROS_WARN("[hector_exploration_planner]: Failed to get RobotPose");
-  }
-  geometry_msgs::PoseStamped robotPoseMsg;
-  tf::poseStampedTFToMsg(robotPose, robotPoseMsg);
-
-  unsigned int fx,fy;
-  double wfx,wfy;
-  costmap_->indexToCells(point,fx,fy);
-  costmap_->mapToWorld(fx,fy,wfx,wfy);
-
-
-  double dx = robotPoseMsg.pose.position.x - wfx;
-  double dy = robotPoseMsg.pose.position.y - wfy;
-
-  if ( (dx*dx) + (dy*dy) < (p_dist_for_goal_reached_*p_dist_for_goal_reached_)) {
-    ROS_DEBUG("[hector_exploration_planner]: frontier is within the squared range of: %f", p_dist_for_goal_reached_);
-    return true;
-  }
-  return false;
-
-}
-
-bool HectorExplorationPlanner::isSameFrontier(int frontier_point1, int frontier_point2){
-  unsigned int fx1,fy1;
-  unsigned int fx2,fy2;
-  double wfx1,wfy1;
-  double wfx2,wfy2;
-  costmap_->indexToCells(frontier_point1,fx1,fy1);
-  costmap_->indexToCells(frontier_point2,fx2,fy2);
-  costmap_->mapToWorld(fx1,fy1,wfx1,wfy1);
-  costmap_->mapToWorld(fx2,fy2,wfx2,wfy2);
-
-  double dx = wfx1 - wfx2;
-  double dy = wfy1 - wfy2;
-
-  if((dx*dx) + (dy*dy) < (p_same_frontier_dist_*p_same_frontier_dist_)){
-    return true;
-  }
-  return false;
-}
-
-inline unsigned int HectorExplorationPlanner::cellDanger(int point){
-
-  if ((int)obstacle_trans_array_[point] <= p_min_obstacle_dist_){
-    return static_cast<unsigned int>(p_alpha_ * std::pow(p_min_obstacle_dist_ - obstacle_trans_array_[point], 2) + .5);
-  }
-  //ROS_INFO("%d", (int)obstacle_trans_array_[point] );
-  //return 80000u - std::min(80000u, obstacle_trans_array_[point]*40);
-
-  //return (2000u - std::min(2000u, obstacle_trans_array_[point])) / 500u;
-  //std::cout << obstacle_trans_array_[point] << "\n";
-
-  return 0;
-}
-
-float HectorExplorationPlanner::angleDifference(const geometry_msgs::PoseStamped &start, const geometry_msgs::PoseStamped &goal){
-  // setup start positions
-  unsigned int mxs,mys;
-  costmap_->worldToMap(start.pose.position.x,start.pose.position.y,mxs,mys);
-
-  unsigned int gx,gy;
-  costmap_->worldToMap(goal.pose.position.x,goal.pose.position.y,gx,gy);
-
-  int goal_proj_x = gx-mxs;
-  int goal_proj_y = gy-mys;
-
-  float start_angle = tf::getYaw(start.pose.orientation);
-  float goal_angle = std::atan2(goal_proj_y,goal_proj_x);
-
-  float both_angle = 0;
-  if(start_angle > goal_angle){
-    both_angle = start_angle - goal_angle;
-  } else {
-    both_angle = goal_angle - start_angle;
-  }
-
-  if(both_angle > M_PI){
-    both_angle = (M_PI - std::abs(start_angle)) + (M_PI - std::abs(goal_angle));
-  }
-
-  return both_angle;
-}
-
-// Used to generate direction for frontiers
-double HectorExplorationPlanner::getYawToUnknown(int point){
-  int adjacentPoints[8];
-  getAdjacentPoints(point,adjacentPoints);
-
-  int max_obs_idx = 0;
-  unsigned int max_obs_dist = 0;
-
-  for(int i = 0; i < 8; ++i){
-    if(isValid(adjacentPoints[i])){
-      if(occupancy_grid_array_[adjacentPoints[i]] == costmap_2d::NO_INFORMATION){
-        if(obstacle_trans_array_[adjacentPoints[i]] > max_obs_dist){
-          max_obs_idx = i;
-          max_obs_dist = obstacle_trans_array_[adjacentPoints[i]];
-        }
-      }
-    }
-  }
-
-  int orientationPoint = adjacentPoints[max_obs_idx];
-  unsigned int sx,sy,gx,gy;
-  costmap_->indexToCells((unsigned int)point,sx,sy);
-  costmap_->indexToCells((unsigned int)orientationPoint,gx,gy);
-  int x = gx-sx;
-  int y = gy-sy;
-  double yaw = std::atan2(y,x);
-
-  return yaw;
-
-}
-
-unsigned int HectorExplorationPlanner::angleDanger(float angle){
-  float angle_fraction = std::pow(angle,3);///M_PI;
-  unsigned int result = static_cast<unsigned int>(p_goal_angle_penalty_ * angle_fraction);
-  return result;
-}
-
-float HectorExplorationPlanner::getDistanceWeight(const geometry_msgs::PoseStamped &point1, const geometry_msgs::PoseStamped &point2){
-  float distance = std::sqrt(std::pow(point1.pose.position.x - point2.pose.position.x,2) + std::pow(point1.pose.position.y - point2.pose.position.y,2));
-  if(distance < 0.5){
-    return 5.0;
-  } else {
-    return 1;
-  }
-}
-
-/*
- These functions calculate the index of an adjacent point (left,upleft,up,upright,right,downright,down,downleft) to the
- given point. If there is no such point (meaning the point would cause the index to be out of bounds), -1 is returned.
- */
-inline void HectorExplorationPlanner::getStraightPoints(int point, int points[]){
-
-  points[0] = left(point);
-  points[1] = up(point);
-  points[2] = right(point);
-  points[3] = down(point);
-
-}
-
-inline void HectorExplorationPlanner::getDiagonalPoints(int point, int points[]){
-
-  points[0] = upleft(point);
-  points[1] = upright(point);
-  points[2] = downright(point);
-  points[3] = downleft(point);
-
-}
-
-/*
-inline void HectorExplorationPlanner::getStraightAndDiagonalPoints(int point, int straight_points[], int diag_points[]){
-  /
-  // Can go up if index is larger than width
-  bool up = (point >= (int)map_width_);
-
-  // Can go down if
-  bool down = ((point/map_width_) < (map_width_-1));
-
-
-  bool right = ((point + 1) % map_width_ != 0);
-  bool left = ((point % map_width_ != 0));
-
-}
-*/
-
-inline void HectorExplorationPlanner::getAdjacentPoints(int point, int points[]){
-
-  points[0] = left(point);
-  points[1] = up(point);
-  points[2] = right(point);
-  points[3] = down(point);
-  points[4] = upleft(point);
-  points[5] = upright(point);
-  points[6] = downright(point);
-  points[7] = downleft(point);
-
-}
-
-inline int HectorExplorationPlanner::left(int point){
-  // only go left if no index error and if current point is not already on the left boundary
-  if((point % map_width_ != 0)){
-    return point-1;
-  }
-  return -1;
-}
-inline int HectorExplorationPlanner::upleft(int point){
-  if((point % map_width_ != 0) && (point >= (int)map_width_)){
-    return point-1-map_width_;
-  }
-  return -1;
-
-}
-inline int HectorExplorationPlanner::up(int point){
-  if(point >= (int)map_width_){
-    return point-map_width_;
-  }
-  return -1;
-}
-inline int HectorExplorationPlanner::upright(int point){
-  if((point >= (int)map_width_) && ((point + 1) % (int)map_width_ != 0)){
-    return point-map_width_+1;
-  }
-  return -1;
-}
-inline int HectorExplorationPlanner::right(int point){
-  if((point + 1) % map_width_ != 0){
-    return point+1;
-  }
-  return -1;
-
-}
-inline int HectorExplorationPlanner::downright(int point){
-  if(((point + 1) % map_width_ != 0) && ((point/map_width_) < (map_height_-1))){
-    return point+map_width_+1;
-  }
-  return -1;
-
-}
-inline int HectorExplorationPlanner::down(int point){
-  if((point/map_width_) < (map_height_-1)){
-    return point+map_width_;
-  }
-  return -1;
-
-}
-inline int HectorExplorationPlanner::downleft(int point){
-  if(((point/map_width_) < (map_height_-1)) && (point % map_width_ != 0)){
-    return point+map_width_-1;
-  }
-  return -1;
-
-}
-
-//        // visualization (export to another method?)
-//        visualization_msgs::Marker marker;
-//        marker.header.frame_id = "map";
-//        marker.header.stamp = ros::Time();
-//        marker.ns = "hector_exploration_planner";
-//        marker.id = i + 500;
-//        marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
-//        marker.action = visualization_msgs::Marker::ADD;
-//        marker.pose.position = goals[i].pose.position;
-//        marker.scale.x = 0.2;
-//        marker.scale.y = 0.2;
-//        marker.scale.z = 0.2;
-//        marker.color.a = 1.0;
-//        marker.color.r = 0.0;
-//        marker.color.g = 0.0;
-//        marker.color.b = 1.0;
-//        marker.lifetime = ros::Duration(5,0);
-//        marker.text = boost::lexical_cast<std::string>((int)init_cost) + " - " + boost::lexical_cast<std::string>(getDistanceWeight(start,goals[i]));
-//        visualization_pub_.publish(marker);
-
-//void HectorExplorationPlanner::saveMaps(std::string path){
-
-//    char costmapPath[1000];
-//    sprintf(costmapPath,"%s.map",path.data());
-//    char explorationPath[1000];
-//    sprintf(explorationPath,"%s.expl",path.data());
-//    char obstaclePath[1000];
-//    sprintf(obstaclePath,"%s.obs",path.data());
-//    char frontierPath[1000];
-//    sprintf(frontierPath,"%s.front",path.data());
-
-
-//    costmap.saveMap(costmapPath);
-//    FILE *fp_expl = fopen(explorationPath,"w");
-//    FILE *fp_obs = fopen(obstaclePath,"w");
-//    FILE *fp_front = fopen(frontierPath,"w");
-
-//    if (!fp_expl || !fp_obs || !fp_front)
-//    {
-//        ROS_WARN("[hector_exploration_planner] Cannot save maps");
-//        return;
-//    }
-
-//    for(unsigned int y = 0; y < map_height_; ++y){
-//        for(unsigned int x = 0;x < map_width_; ++x){
-//            unsigned int expl = exploration_trans_array_[costmap.getIndex(x,y)];
-//            unsigned int obs = obstacle_trans_array_[costmap.getIndex(x,y)];
-//            int blobVal = frontier_map_array_[costmap.getIndex(x,y)];
-//            fprintf(fp_front,"%d\t", blobVal);
-//            fprintf(fp_expl,"%d\t", expl);
-//            fprintf(fp_obs, "%d\t", obs);
-//        }
-//        fprintf(fp_expl,"\n");
-//        fprintf(fp_obs,"\n");
-//        fprintf(fp_front,"\n");
-//    }
-
-//    fclose(fp_expl);
-//    fclose(fp_obs);
-//    fclose(fp_front);
-//    ROS_INFO("[hector_exploration_planner] Maps have been saved!");
-//    return;
-
-//}
-
-//    // add last point to path (goal point)
-//    for(unsigned int i = 0; i < goals.size(); ++i){
-//        unsigned int mx,my;
-//        costmap.worldToMap(goals[i].pose.position.x,goals[i].pose.position.y,mx,my);
-
-//        if(currentPoint == (int)costmap.getIndex(mx,my)){
-//            plan.push_back(goals[i]);
-//            previous_goal_ = currentPoint;
-//        }
-
-//    }
-

+ 0 - 166
src/hector_path_follower/CMakeLists.txt

@@ -1,166 +0,0 @@
-cmake_minimum_required(VERSION 2.8.3)
-project(hector_path_follower)
-
-## Find catkin macros and libraries
-## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
-## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS
-  nav_msgs
-  roscpp
-  tf
-)
-
-## System dependencies are found with CMake's conventions
-# find_package(Boost REQUIRED COMPONENTS system)
-
-
-## Uncomment this if the package has a setup.py. This macro ensures
-## modules and global scripts declared therein get installed
-## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
-# catkin_python_setup()
-
-################################################
-## Declare ROS messages, services and actions ##
-################################################
-
-## To declare and build messages, services or actions from within this
-## package, follow these steps:
-## * Let MSG_DEP_SET be the set of packages whose message types you use in
-##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
-## * In the file package.xml:
-##   * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
-##   * If MSG_DEP_SET isn't empty the following dependencies might have been
-##     pulled in transitively but can be declared for certainty nonetheless:
-##     * add a build_depend tag for "message_generation"
-##     * add a run_depend tag for "message_runtime"
-## * In this file (CMakeLists.txt):
-##   * add "message_generation" and every package in MSG_DEP_SET to
-##     find_package(catkin REQUIRED COMPONENTS ...)
-##   * add "message_runtime" and every package in MSG_DEP_SET to
-##     catkin_package(CATKIN_DEPENDS ...)
-##   * uncomment the add_*_files sections below as needed
-##     and list every .msg/.srv/.action file to be processed
-##   * uncomment the generate_messages entry below
-##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
-
-## Generate messages in the 'msg' folder
-# add_message_files(
-#   FILES
-#   Message1.msg
-#   Message2.msg
-# )
-
-## Generate services in the 'srv' folder
-# add_service_files(
-#   FILES
-#   Service1.srv
-#   Service2.srv
-# )
-
-## Generate actions in the 'action' folder
-# add_action_files(
-#   FILES
-#   Action1.action
-#   Action2.action
-# )
-
-## Generate added messages and services with any dependencies listed here
-# generate_messages(
-#   DEPENDENCIES
-#   nav_msgs
-# )
-
-###################################
-## catkin specific configuration ##
-###################################
-## The catkin_package macro generates cmake config files for your package
-## Declare things to be passed to dependent projects
-## INCLUDE_DIRS: uncomment this if you package contains header files
-## LIBRARIES: libraries you create in this project that dependent projects also need
-## CATKIN_DEPENDS: catkin_packages dependent projects also need
-## DEPENDS: system dependencies of this project that dependent projects also need
-catkin_package(
-  INCLUDE_DIRS include
-  LIBRARIES ${PROJECT_NAME}
-  CATKIN_DEPENDS nav_msgs roscpp tf
-#  DEPENDS system_lib
-)
-
-###########
-## Build ##
-###########
-
-## Specify additional locations of header files
-## Your package locations should be listed before other locations
-# include_directories(include)
-include_directories(
-  include
-  ${catkin_INCLUDE_DIRS}
-)
-
-## Declare a cpp library
-# add_library(hector_path_follower
-#   src/${PROJECT_NAME}/hector_path_follower.cpp
-# )
-add_library(${PROJECT_NAME} src/hector_path_follower.cpp)
-
-## Declare a cpp executable
-# add_executable(hector_path_follower_node src/hector_path_follower_node.cpp)
-add_executable(hector_path_follower_node src/hector_path_follower_node.cpp src/hector_path_follower.cpp)
-
-## Add cmake target dependencies of the executable/library
-## as an example, message headers may need to be generated before nodes
-# add_dependencies(hector_path_follower_node hector_path_follower_generate_messages_cpp)
-
-## Specify libraries to link a library or executable target against
-target_link_libraries(hector_path_follower_node
-  ${catkin_LIBRARIES}
-)
-
-#############
-## Install ##
-#############
-
-# all install targets should use catkin DESTINATION variables
-# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
-
-## Mark executable scripts (Python etc.) for installation
-## in contrast to setup.py, you can choose the destination
-# install(PROGRAMS
-#   scripts/my_python_script
-#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark executables and/or libraries for installation
-# install(TARGETS hector_path_follower hector_path_follower_node
-#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
-# )
-
-## Mark cpp header files for installation
-# install(DIRECTORY include/${PROJECT_NAME}/
-#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
-#   FILES_MATCHING PATTERN "*.h"
-#   PATTERN ".svn" EXCLUDE
-# )
-
-## Mark other files for installation (e.g. launch and bag files, etc.)
-# install(FILES
-#   # myfile1
-#   # myfile2
-#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
-# )
-
-#############
-## Testing ##
-#############
-
-## Add gtest based cpp test target and link libraries
-# catkin_add_gtest(${PROJECT_NAME}-test test/test_hector_path_follower.cpp)
-# if(TARGET ${PROJECT_NAME}-test)
-#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
-# endif()
-
-## Add folders to be run by python nosetests
-# catkin_add_nosetests(test)

+ 0 - 90
src/hector_path_follower/include/hector_path_follower/hector_path_follower.h

@@ -1,90 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-/*********************************************************************
-* Based heavily on the pose_follower package
-*********************************************************************/
-#ifndef HECTOR_PATH_FOLLOWER_H_
-#define HECTOR_PATH_FOLLOWER_H_
-#include <ros/ros.h>
-#include <tf/tf.h>
-#include <tf/transform_datatypes.h>
-#include <tf/transform_listener.h>
-#include <geometry_msgs/PoseStamped.h>
-#include <geometry_msgs/Twist.h>
-
-namespace pose_follower {
-  class HectorPathFollower
-  {
-    public:
-      HectorPathFollower();
-      void initialize(tf::TransformListener* tf);
-      bool isGoalReached();
-      bool setPlan(const std::vector<geometry_msgs::PoseStamped>& global_plan);
-      bool computeVelocityCommands(geometry_msgs::Twist& cmd_vel);
-
-    private:
-      inline double sign(double n){
-        return n < 0.0 ? -1.0 : 1.0;
-      }
-
-      geometry_msgs::Twist diff2D(const tf::Pose& pose1, const tf::Pose&  pose2);
-      geometry_msgs::Twist limitTwist(const geometry_msgs::Twist& twist);
-      double headingDiff(double pt_x, double pt_y, double x, double y, double heading);
-
-      bool transformGlobalPlan(const tf::TransformListener& tf, const std::vector<geometry_msgs::PoseStamped>& global_plan, const std::string& global_frame,
-          std::vector<geometry_msgs::PoseStamped>& transformed_plan);
-
-      //void odomCallback(const nav_msgs::Odometry::ConstPtr& msg);
-      bool stopped();
-      bool getRobotPose(tf::Stamped<tf::Pose>& global_pose) const;
-
-      tf::TransformListener* tf_;
-
-      double K_trans_, K_rot_, tolerance_trans_, tolerance_rot_;
-      double tolerance_timeout_;
-      double max_vel_lin_, max_vel_th_;
-      double min_vel_lin_, min_vel_th_;
-      double min_in_place_vel_th_, in_place_trans_vel_;
-      bool holonomic_;
-      std::string p_robot_base_frame_;
-      std::string p_global_frame_;
-
-      boost::mutex odom_lock_;
-      ros::Subscriber odom_sub_;
-      //nav_msgs::Odometry base_odom_;
-      double trans_stopped_velocity_, rot_stopped_velocity_;
-      ros::Time goal_reached_time_;
-      unsigned int current_waypoint_;
-      std::vector<geometry_msgs::PoseStamped> global_plan_;
-      //base_local_planner::TrajectoryPlannerROS collision_planner_;
-      int samples_;
-  };
-};
-#endif
-

+ 0 - 61
src/hector_path_follower/package.xml

@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<package>
-  <name>hector_path_follower</name>
-  <version>0.0.0</version>
-  <description>hector_path_follower provides a node that publishes Twist messages, following a path. Based on the pose_follower package</description>
-
-  <!-- One maintainer tag required, multiple allowed, one person per tag --> 
-  <!-- Example:  -->
-  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
-  <maintainer email="kohlbrecher@sim.tu-darmstadt.de">Stefan Kohlbrecher</maintainer>
-
-
-
-  <!-- One license tag required, multiple allowed, one license per tag -->
-  <!-- Commonly used license strings: -->
-  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
-  <license>BSD</license>
-
-
-  <!-- Url tags are optional, but mutiple are allowed, one per tag -->
-  <!-- Optional attribute type can be: website, bugtracker, or repository -->
-  <!-- Example: -->
-  <!-- <url type="website">http://wiki.ros.org/hector_path_follower</url> -->
-
-
-  <!-- Author tags are optional, mutiple are allowed, one per tag -->
-  <!-- Authors do not have to be maintianers, but could be -->
-  <!-- Example: -->
-  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->
-
-
-  <!-- The *_depend tags are used to specify dependencies -->
-  <!-- Dependencies can be catkin packages or system dependencies -->
-  <!-- Examples: -->
-  <!-- Use build_depend for packages you need at compile time: -->
-  <!--   <build_depend>message_generation</build_depend> -->
-  <!-- Use buildtool_depend for build tool packages: -->
-  <!--   <buildtool_depend>catkin</buildtool_depend> -->
-  <!-- Use run_depend for packages you need at runtime: -->
-  <!--   <run_depend>message_runtime</run_depend> -->
-  <!-- Use test_depend for packages you need only for testing: -->
-  <!--   <test_depend>gtest</test_depend> -->
-  <buildtool_depend>catkin</buildtool_depend>
-  <build_depend>nav_msgs</build_depend>
-  <build_depend>roscpp</build_depend>
-  <build_depend>tf</build_depend>
-  <run_depend>nav_msgs</run_depend>
-  <run_depend>roscpp</run_depend>
-  <run_depend>tf</run_depend>
-
-
-  <!-- The export tag contains other, unspecified, tags -->
-  <export>
-    <!-- You can specify that this package is a metapackage here: -->
-    <!-- <metapackage/> -->
-
-    <!-- Other tools can request additional information be placed here -->
-    <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib -lhector_path_follower"/>
-
-  </export>
-</package>

+ 0 - 403
src/hector_path_follower/src/hector_path_follower.cpp

@@ -1,403 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-/*********************************************************************
-* Based heavily on the pose_follower package
-*********************************************************************/
-#include <hector_path_follower/hector_path_follower.h>
-
-
-namespace pose_follower {
-  HectorPathFollower::HectorPathFollower(): tf_(NULL) {}
-
-  void HectorPathFollower::initialize(tf::TransformListener* tf){
-    tf_ = tf;
-    current_waypoint_ = 0;
-    goal_reached_time_ = ros::Time::now();
-    ros::NodeHandle node_private("~/");
-
-    node_private.param("k_trans", K_trans_, 2.0);
-    node_private.param("k_rot", K_rot_, 2.0);
-
-    node_private.param("tolerance_trans", tolerance_trans_, 0.1);
-    node_private.param("tolerance_rot", tolerance_rot_, 0.2);
-    node_private.param("tolerance_timeout", tolerance_timeout_, 0.5);
-
-    node_private.param("holonomic", holonomic_, false);
-
-    node_private.param("samples", samples_, 10);
-
-    node_private.param("max_vel_lin", max_vel_lin_, 0.3);
-    node_private.param("max_vel_th", max_vel_th_, 1.0);
-
-    node_private.param("min_vel_lin", min_vel_lin_, 0.1);
-    node_private.param("min_vel_th", min_vel_th_, 0.1);
-    node_private.param("min_in_place_vel_th", min_in_place_vel_th_, 0.1);
-    node_private.param("in_place_trans_vel", in_place_trans_vel_, 0.1);
-
-    node_private.param("trans_stopped_velocity", trans_stopped_velocity_, 1e-4);
-    node_private.param("rot_stopped_velocity", rot_stopped_velocity_, 1e-4);
-
-    node_private.param("robot_base_frame", p_robot_base_frame_, std::string("robot0"));
-    node_private.param("global_frame", p_global_frame_, std::string("map"));
-
-    //ros::NodeHandle node;
-    //vel_pub_ = node.advertise<geometry_msgs::Twist>("cmd_vel", 10);
-
-    ROS_DEBUG("Initialized");
-  }
-
-  /*
-  void HectorPathFollower::odomCallback(const nav_msgs::Odometry::ConstPtr& msg){
-    //we assume that the odometry is published in the frame of the base
-    boost::mutex::scoped_lock lock(odom_lock_);
-    base_odom_.twist.twist.linear.x = msg->twist.twist.linear.x;
-    base_odom_.twist.twist.linear.y = msg->twist.twist.linear.y;
-    base_odom_.twist.twist.angular.z = msg->twist.twist.angular.z;
-    ROS_DEBUG("In the odometry callback with velocity values: (%.2f, %.2f, %.2f)",
-        base_odom_.twist.twist.linear.x, base_odom_.twist.twist.linear.y, base_odom_.twist.twist.angular.z);
-  }
-  */
-
-  double HectorPathFollower::headingDiff(double x, double y, double pt_x, double pt_y, double heading)
-  {
-    double v1_x = x - pt_x;
-    double v1_y = y - pt_y;
-    double v2_x = cos(heading);
-    double v2_y = sin(heading);
-
-    double perp_dot = v1_x * v2_y - v1_y * v2_x;
-    double dot = v1_x * v2_x + v1_y * v2_y;
-
-    //get the signed angle
-    double vector_angle = atan2(perp_dot, dot);
-
-    return -1.0 * vector_angle;
-  }
-
-  /*
-  bool HectorPathFollower::stopped(){
-    //copy over the odometry information
-    nav_msgs::Odometry base_odom;
-    {
-      boost::mutex::scoped_lock lock(odom_lock_);
-      base_odom = base_odom_;
-    }
-
-    return fabs(base_odom.twist.twist.angular.z) <= rot_stopped_velocity_
-      && fabs(base_odom.twist.twist.linear.x) <= trans_stopped_velocity_
-      && fabs(base_odom.twist.twist.linear.y) <= trans_stopped_velocity_;
-  }
-  */
-
-  bool HectorPathFollower::computeVelocityCommands(geometry_msgs::Twist& cmd_vel){
-
-    if (global_plan_.size() == 0)
-      return false;
-
-    //get the current pose of the robot in the fixed frame
-    tf::Stamped<tf::Pose> robot_pose;
-    if(!this->getRobotPose(robot_pose)){
-      ROS_ERROR("Can't get robot pose");
-      geometry_msgs::Twist empty_twist;
-      cmd_vel = empty_twist;
-      return false;
-    }
-
-
-
-    //we want to compute a velocity command based on our current waypoint
-    tf::Stamped<tf::Pose> target_pose;
-    tf::poseStampedMsgToTF(global_plan_[current_waypoint_], target_pose);
-
-    ROS_DEBUG("HectorPathFollower: current robot pose %f %f ==> %f", robot_pose.getOrigin().x(), robot_pose.getOrigin().y(), tf::getYaw(robot_pose.getRotation()));
-    ROS_DEBUG("HectorPathFollower: target robot pose %f %f ==> %f", target_pose.getOrigin().x(), target_pose.getOrigin().y(), tf::getYaw(target_pose.getRotation()));
-
-    //get the difference between the two poses
-    geometry_msgs::Twist diff = diff2D(target_pose, robot_pose);
-    ROS_DEBUG("HectorPathFollower: diff %f %f ==> %f", diff.linear.x, diff.linear.y, diff.angular.z);
-
-    geometry_msgs::Twist limit_vel = limitTwist(diff);
-
-    geometry_msgs::Twist test_vel = limit_vel;
-    bool legal_traj = true; //collision_planner_.checkTrajectory(test_vel.linear.x, test_vel.linear.y, test_vel.angular.z, true);
-
-    double scaling_factor = 1.0;
-    double ds = scaling_factor / samples_;
-
-    //let's make sure that the velocity command is legal... and if not, scale down
-    if(!legal_traj){
-      for(int i = 0; i < samples_; ++i){
-        test_vel.linear.x = limit_vel.linear.x * scaling_factor;
-        test_vel.linear.y = limit_vel.linear.y * scaling_factor;
-        test_vel.angular.z = limit_vel.angular.z * scaling_factor;
-        test_vel = limitTwist(test_vel);
-        //if(collision_planner_.checkTrajectory(test_vel.linear.x, test_vel.linear.y, test_vel.angular.z, false)){
-          legal_traj = true;
-          break;
-        //}
-        scaling_factor -= ds;
-      }
-    }
-
-    if(!legal_traj){
-      ROS_ERROR("Not legal (%.2f, %.2f, %.2f)", limit_vel.linear.x, limit_vel.linear.y, limit_vel.angular.z);
-      geometry_msgs::Twist empty_twist;
-      cmd_vel = empty_twist;
-      return false;
-    }
-
-    //if it is legal... we'll pass it on
-    cmd_vel = test_vel;
-
-    bool in_goal_position = false;
-    while(fabs(diff.linear.x) <= tolerance_trans_ &&
-          fabs(diff.linear.y) <= tolerance_trans_ &&
-    fabs(diff.angular.z) <= tolerance_rot_)
-    {
-      if(current_waypoint_ < global_plan_.size() - 1)
-      {
-  current_waypoint_++;
-        tf::poseStampedMsgToTF(global_plan_[current_waypoint_], target_pose);
-        diff = diff2D(target_pose, robot_pose);
-      }
-      else
-      {
-        ROS_INFO("Reached goal: %d", current_waypoint_);
-        in_goal_position = true;
-        break;
-      }
-    }
-
-    //if we're not in the goal position, we need to update time
-    if(!in_goal_position)
-      goal_reached_time_ = ros::Time::now();
-
-    //check if we've reached our goal for long enough to succeed
-    if(goal_reached_time_ + ros::Duration(tolerance_timeout_) < ros::Time::now()){
-      geometry_msgs::Twist empty_twist;
-      cmd_vel = empty_twist;
-    }
-
-    return true;
-  }
-
-  bool HectorPathFollower::setPlan(const std::vector<geometry_msgs::PoseStamped>& global_plan){
-    current_waypoint_ = 0;
-    goal_reached_time_ = ros::Time::now();
-    if(!transformGlobalPlan(*tf_, global_plan, p_global_frame_, global_plan_)){
-      ROS_ERROR("Could not transform the global plan to the frame of the controller");
-      return false;
-    }
-    return true;
-  }
-
-  bool HectorPathFollower::isGoalReached(){
-    /*
-    //@TODO: Do something reasonable here
-    if(goal_reached_time_ + ros::Duration(tolerance_timeout_) < ros::Time::now() && stopped()){
-      return true;
-    }
-    */
-    return false;
-  }
-
-  geometry_msgs::Twist HectorPathFollower::diff2D(const tf::Pose& pose1, const tf::Pose& pose2)
-  {
-    geometry_msgs::Twist res;
-    tf::Pose diff = pose2.inverse() * pose1;
-    res.linear.x = diff.getOrigin().x();
-    res.linear.y = diff.getOrigin().y();
-    res.angular.z = tf::getYaw(diff.getRotation());
-
-    if(holonomic_ || (fabs(res.linear.x) <= tolerance_trans_ && fabs(res.linear.y) <= tolerance_trans_))
-      return res;
-
-    //in the case that we're not rotating to our goal position and we have a non-holonomic robot
-    //we'll need to command a rotational velocity that will help us reach our desired heading
-
-    //we want to compute a goal based on the heading difference between our pose and the target
-    double yaw_diff = headingDiff(pose1.getOrigin().x(), pose1.getOrigin().y(),
-        pose2.getOrigin().x(), pose2.getOrigin().y(), tf::getYaw(pose2.getRotation()));
-
-    //we'll also check if we can move more effectively backwards
-    double neg_yaw_diff = headingDiff(pose1.getOrigin().x(), pose1.getOrigin().y(),
-        pose2.getOrigin().x(), pose2.getOrigin().y(), M_PI + tf::getYaw(pose2.getRotation()));
-
-    //check if its faster to just back up
-    if(fabs(neg_yaw_diff) < fabs(yaw_diff)){
-      ROS_DEBUG("Negative is better: %.2f", neg_yaw_diff);
-      yaw_diff = neg_yaw_diff;
-    }
-
-    //compute the desired quaterion
-    tf::Quaternion rot_diff = tf::createQuaternionFromYaw(yaw_diff);
-    tf::Quaternion rot = pose2.getRotation() * rot_diff;
-    tf::Pose new_pose = pose1;
-    new_pose.setRotation(rot);
-
-    diff = pose2.inverse() * new_pose;
-    res.linear.x = diff.getOrigin().x();
-    res.linear.y = diff.getOrigin().y();
-    res.angular.z = tf::getYaw(diff.getRotation());
-    return res;
-  }
-
-
-  geometry_msgs::Twist HectorPathFollower::limitTwist(const geometry_msgs::Twist& twist)
-  {
-    geometry_msgs::Twist res = twist;
-    res.linear.x *= K_trans_;
-    if(!holonomic_)
-      res.linear.y = 0.0;
-    else
-      res.linear.y *= K_trans_;
-    res.angular.z *= K_rot_;
-
-    //make sure to bound things by our velocity limits
-    double lin_overshoot = sqrt(res.linear.x * res.linear.x + res.linear.y * res.linear.y) / max_vel_lin_;
-    double lin_undershoot = min_vel_lin_ / sqrt(res.linear.x * res.linear.x + res.linear.y * res.linear.y);
-    if (lin_overshoot > 1.0)
-    {
-      res.linear.x /= lin_overshoot;
-      res.linear.y /= lin_overshoot;
-    }
-
-    //we only want to enforce a minimum velocity if we're not rotating in place
-    if(lin_undershoot > 1.0)
-    {
-      res.linear.x *= lin_undershoot;
-      res.linear.y *= lin_undershoot;
-    }
-
-    if (fabs(res.angular.z) > max_vel_th_) res.angular.z = max_vel_th_ * sign(res.angular.z);
-    if (fabs(res.angular.z) < min_vel_th_) res.angular.z = min_vel_th_ * sign(res.angular.z);
-
-    //we want to check for whether or not we're desired to rotate in place
-    if(sqrt(twist.linear.x * twist.linear.x + twist.linear.y * twist.linear.y) < in_place_trans_vel_){
-      if (fabs(res.angular.z) < min_in_place_vel_th_) res.angular.z = min_in_place_vel_th_ * sign(res.angular.z);
-      res.linear.x = 0.0;
-      res.linear.y = 0.0;
-    }
-
-    ROS_DEBUG("Angular command %f", res.angular.z);
-    return res;
-  }
-
-  bool HectorPathFollower::transformGlobalPlan(const tf::TransformListener& tf, const std::vector<geometry_msgs::PoseStamped>& global_plan,
-      const std::string& global_frame,
-      std::vector<geometry_msgs::PoseStamped>& transformed_plan){
-    const geometry_msgs::PoseStamped& plan_pose = global_plan[0];
-
-    transformed_plan.clear();
-
-    try{
-      if (!global_plan.size() > 0)
-      {
-        ROS_ERROR("Received plan with zero length");
-        return false;
-      }
-
-      tf::StampedTransform transform;
-      tf.lookupTransform(global_frame, ros::Time(),
-          plan_pose.header.frame_id, plan_pose.header.stamp,
-          plan_pose.header.frame_id, transform);
-
-      tf::Stamped<tf::Pose> tf_pose;
-      geometry_msgs::PoseStamped newer_pose;
-      //now we'll transform until points are outside of our distance threshold
-      for(unsigned int i = 0; i < global_plan.size(); ++i){
-        const geometry_msgs::PoseStamped& pose = global_plan[i];
-        poseStampedMsgToTF(pose, tf_pose);
-        tf_pose.setData(transform * tf_pose);
-        tf_pose.stamp_ = transform.stamp_;
-        tf_pose.frame_id_ = global_frame;
-        poseStampedTFToMsg(tf_pose, newer_pose);
-
-        transformed_plan.push_back(newer_pose);
-      }
-    }
-    catch(tf::LookupException& ex) {
-      ROS_ERROR("No Transform available Error: %s\n", ex.what());
-      return false;
-    }
-    catch(tf::ConnectivityException& ex) {
-      ROS_ERROR("Connectivity Error: %s\n", ex.what());
-      return false;
-    }
-    catch(tf::ExtrapolationException& ex) {
-      ROS_ERROR("Extrapolation Error: %s\n", ex.what());
-      if (global_plan.size() > 0)
-        ROS_ERROR("Global Frame: %s Plan Frame size %d: %s\n", global_frame.c_str(), (unsigned int)global_plan.size(), global_plan[0].header.frame_id.c_str());
-
-      return false;
-    }
-
-    return true;
-  }
-
-
-  bool HectorPathFollower::getRobotPose(tf::Stamped<tf::Pose>& global_pose) const {
-
-    global_pose.setIdentity();
-    tf::Stamped<tf::Pose> robot_pose;
-    robot_pose.setIdentity();
-    robot_pose.frame_id_ = p_robot_base_frame_;
-    robot_pose.stamp_ = ros::Time(0);
-    ros::Time current_time = ros::Time::now(); // save time for checking tf delay later
-
-    //get the global pose of the robot
-    try{
-      tf_->transformPose(p_global_frame_, robot_pose, global_pose);
-    }
-    catch(tf::LookupException& ex) {
-      ROS_ERROR_THROTTLE(1.0, "No Transform available Error looking up robot pose: %s\n", ex.what());
-      return false;
-    }
-    catch(tf::ConnectivityException& ex) {
-      ROS_ERROR_THROTTLE(1.0, "Connectivity Error looking up robot pose: %s\n", ex.what());
-      return false;
-    }
-    catch(tf::ExtrapolationException& ex) {
-      ROS_ERROR_THROTTLE(1.0, "Extrapolation Error looking up robot pose: %s\n", ex.what());
-      return false;
-    }
-    // check global_pose timeout
-
-    /*
-    if (current_time.toSec() - global_pose.stamp_.toSec() > transform_tolerance_) {
-      ROS_WARN_THROTTLE(1.0, "Costmap2DROS transform timeout. Current time: %.4f, global_pose stamp: %.4f, tolerance: %.4f",
-          current_time.toSec() ,global_pose.stamp_.toSec() ,transform_tolerance_);
-      return false;
-    }
-    */
-
-
-    return true;
-  }
-};

+ 0 - 48
src/hector_path_follower/src/hector_path_follower_node.cpp

@@ -1,48 +0,0 @@
-//=================================================================================================
-// Copyright (c) 2012, Stefan Kohlbrecher, TU Darmstadt
-// All rights reserved.
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * 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.
-//     * Neither the name of the Simulation, Systems Optimization and Robotics
-//       group, TU Darmstadt 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 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.
-//=================================================================================================
-
-#include "hector_path_follower/hector_path_follower.h"
-
-#include <ros/ros.h>
-#include <tf/tf.h>
-
-
-
-int main(int argc, char **argv) {
-  ros::init(argc, argv, ROS_PACKAGE_NAME);
-
-  tf::TransformListener* tfl = new tf::TransformListener();
-
-  pose_follower::HectorPathFollower pf;
-  pf.initialize(tfl);
-
-  ros::spin();
-  delete tfl;
-
-  return 0;
-}