Skip to content
Snippets Groups Projects
Commit 57922168 authored by Steven Macenski's avatar Steven Macenski
Browse files

first stab at nav2_core

parent 39ab506d
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 3.5)
project(nav2_core)
find_package(ament_cmake REQUIRED)
find_package(nav2_costmap_2d REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
install(DIRECTORY include/${PROJECT_NAME}/
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
ament_package()
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, Samsung Research America
* 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 copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NAV2_CORE_GLOBAL_PLANNER_H_
#define NAV2_CORE_GLOBAL_PLANNER_H_
#include <string>
#include "nav2_msgs/msg/path.h"
#include "geometry_msgs/msg/pose_stamped.h"
namespace nav2_core
{
/**
* @class GlobalPlanner
* @brief Abstract interface for global planners to adhere to with pluginlib
*/
class GlobalPlanner
{
public:
/**
* @brief Virtual destructor
*/
virtual ~GlobalPlanner() {}
/**
* @param parent pointer to user's node
* @param name The name of this planner
* @param tf A pointer to a TF buffer
* @param costmap_ros A pointer to the costmap
*/
virtual void configure(const rclcpp::Node* parent,
const std::string& name, tf2::Buffer * tf,
nav2_costmap_2d::Costmap2DROS * costmap_ros) = 0;
/**
* @brief Method to cleanup resources used on shutdown.
*/
virtual void cleanup() = 0;
/**
* @brief Method to active planner and any threads involved in execution.
*/
virtual void activate() = 0;
/**
* @brief Method to deactive planner and any threads involved in execution.
*/
virtual void deactivate() = 0;
/**
* @brief Method create the plan from a starting and ending goal.
* @param start The starting pose of the robot
* @param goal The goal pose of the robot
* @return The sequence of poses to get from start to goal, if any
*/
virtual nav2_msgs::Path createPlan(
const geometry_msgs::msg::PoseStamped & start,
const geometry_msgs::msg::PoseStamped & goal) = 0;
};
} // namespace nav2_core
#endif // NAV2_CORE_GLOBAL_PLANNER_H_
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, Samsung Research America
* 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 copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NAV2_CORE_GLOBAL_PLANNER_H_
#define NAV2_CORE_GLOBAL_PLANNER_H_
#include <string>
#include "nav2_msgs/msg/path.h"
#include "geometry_msgs/msg/pose_stamped.h"
namespace nav2_core
{
/**
* @class GlobalPlanner
* @brief Abstract interface for recoveries to adhere to with pluginlib
*/
class Recovery
{
public:
/**
* @brief Virtual destructor
*/
virtual ~Recovery() {}
/**
* @param parent pointer to user's node
* @param name The name of this planner
* @param tf A pointer to a TF buffer
* @param costmap_ros A pointer to the costmap
*/
virtual void configure(const rclcpp::Node* parent,
const std::string& name, tf2::Buffer * tf,
nav2_costmap_2d::Costmap2DROS * costmap_ros) = 0;
/**
* @brief Method to cleanup resources used on shutdown.
*/
virtual void cleanup() = 0;
/**
* @brief Method to active recovery and any threads involved in execution.
*/
virtual void activate() = 0;
/**
* @brief Method to deactive recovery and any threads involved in execution.
*/
virtual void deactivate() = 0;
/**
* @brief Method Execute recovery behavior
* @param name The name of this planner
* @return true if successful, false is failed to execute fully
*/
virtual bool executeRecovery(
const nav2_msgs::RecoveryRequest & req) = 0;
};
} // namespace nav2_core
#endif // NAV2_CORE_GLOBAL_PLANNER_H_
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>nav2_core</name>
<version>0.2.2</version>
<description>A set of headers for plugins core to the navigation2 stack</description>
<maintainer email="stevenmacenski@gmail.com">Steve Macenski</maintainer>
<license>BSD-3-Clause</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>nav2_costmap_2d</depend>
<depend>geometry_msgs</depend>
<depend>std_msgs</depend>
<depend>tf2_ros</depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
......@@ -15,6 +15,7 @@ rosidl_generate_interfaces(${PROJECT_NAME}
"msg/Costmap.msg"
"msg/CostmapMetaData.msg"
"msg/Path.msg"
"msg/RecoveryRequest.msg"
"msg/VoxelGrid.msg"
"srv/GetCostmap.srv"
"srv/ClearCostmapExceptRegion.srv"
......
geometry_msgs/PoseStamped starting
geometry_msgs/PoseStamped goal
std_msgs/String[] arguments
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment