diff --git a/nav2_dwb_controller/nav2_controller_example/CHANGELOG.rst b/nav2_dwb_controller/nav2_controller_example/CHANGELOG.rst deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/nav2_dwb_controller/nav2_controller_example/CMakeLists.txt b/nav2_dwb_controller/nav2_controller_example/CMakeLists.txt deleted file mode 100644 index 8f5a1d96538309aa04498f835477aa703153c396..0000000000000000000000000000000000000000 --- a/nav2_dwb_controller/nav2_controller_example/CMakeLists.txt +++ /dev/null @@ -1,71 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(nav2_controller_example) - -# Default to C++14 -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) -endif() - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic -Werror) -endif() - -find_package(ament_cmake REQUIRED) -find_package(rclcpp REQUIRED) -find_package(std_msgs REQUIRED) -find_package(nav2_tasks REQUIRED) -find_package(nav2_robot REQUIRED) -find_package(nav2_msgs REQUIRED) - -include_directories( - include -) - -set(executable_name dwa_controller) - -add_executable(${executable_name} - src/main.cpp -) - -set(library_name ${executable_name}_core) - -add_library(${library_name} - src/dwa_controller.cpp -) - -set(dependencies - rclcpp - std_msgs - nav2_tasks - nav2_robot - nav2_msgs -) - -ament_target_dependencies(${executable_name} - ${dependencies} -) - -target_link_libraries(${executable_name} ${library_name}) - -ament_target_dependencies(${library_name} - ${dependencies} -) - -install(TARGETS ${executable_name} ${library_name} - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION lib/${PROJECT_NAME} -) - -install(DIRECTORY include/ - DESTINATION include/ -) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - ament_lint_auto_find_test_dependencies() -endif() - -ament_export_include_directories(include) - -ament_package() diff --git a/nav2_dwb_controller/nav2_controller_example/README.md b/nav2_dwb_controller/nav2_controller_example/README.md deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/nav2_dwb_controller/nav2_controller_example/doc/.gitignore b/nav2_dwb_controller/nav2_controller_example/doc/.gitignore deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/nav2_dwb_controller/nav2_controller_example/include/nav2_controller_example/dwa_controller.hpp b/nav2_dwb_controller/nav2_controller_example/include/nav2_controller_example/dwa_controller.hpp deleted file mode 100644 index a376eba2f37ef5849b4cf9ff28b88620309bb154..0000000000000000000000000000000000000000 --- a/nav2_dwb_controller/nav2_controller_example/include/nav2_controller_example/dwa_controller.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2018 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef NAV2_CONTROLLER_EXAMPLE__DWA_CONTROLLER_HPP_ -#define NAV2_CONTROLLER_EXAMPLE__DWA_CONTROLLER_HPP_ - -#include <memory> -#include <string> -#include "nav2_tasks/follow_path_task.hpp" -#include "geometry_msgs/msg/twist.hpp" - -namespace nav2_controller_example -{ - -class DwaController : public nav2_tasks::FollowPathTaskServer -{ -public: - DwaController(); - ~DwaController(); - - nav2_tasks::TaskStatus execute(const nav2_tasks::FollowPathCommand::SharedPtr path) override; - -protected: - void sendVelocity(double speed); - - using CmdVel = geometry_msgs::msg::Twist; - std::shared_ptr<rclcpp::Publisher<CmdVel>> vel_pub_; -}; - -} // namespace nav2_controller_example - -#endif // NAV2_CONTROLLER_EXAMPLE__DWA_CONTROLLER_HPP_ diff --git a/nav2_dwb_controller/nav2_controller_example/package.xml b/nav2_dwb_controller/nav2_controller_example/package.xml deleted file mode 100644 index 546f99f6b6fb929e0351b4d381f0c198ca09ddc6..0000000000000000000000000000000000000000 --- a/nav2_dwb_controller/nav2_controller_example/package.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> -<package format="3"> - <name>nav2_controller_example</name> - <version>0.1.0</version> - <description>TODO</description> - <maintainer email="carl.r.delsey@intel.com">Carl Delsey</maintainer> - <license>Apache License 2.0</license> - - <buildtool_depend>ament_cmake</buildtool_depend> - - <build_depend>rclcpp</build_depend> - <build_depend>std_msgs</build_depend> - <build_depend>nav2_tasks</build_depend> - <build_depend>nav2_robot</build_depend> - <build_depend>nav2_msgs</build_depend> - - <exec_depend>rclcpp</exec_depend> - <exec_depend>std_msgs</exec_depend> - <exec_depend>nav2_msgs</exec_depend> - - <test_depend>ament_lint_common</test_depend> - <test_depend>ament_lint_auto</test_depend> - - <export> - <build_type>ament_cmake</build_type> - </export> -</package> diff --git a/nav2_dwb_controller/nav2_controller_example/src/dwa_controller.cpp b/nav2_dwb_controller/nav2_controller_example/src/dwa_controller.cpp deleted file mode 100644 index e9c1207065fb6bab1dc74ac0ad2cfbdae6b10855..0000000000000000000000000000000000000000 --- a/nav2_dwb_controller/nav2_controller_example/src/dwa_controller.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2018 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include <string> -#include <chrono> -#include "nav2_controller_example/dwa_controller.hpp" - -using namespace std::chrono_literals; -using nav2_tasks::TaskStatus; - -namespace nav2_controller_example -{ - -DwaController::DwaController() -: nav2_tasks::FollowPathTaskServer("FollowPathNode") -{ - RCLCPP_INFO(get_logger(), "Initializing DwaController"); - vel_pub_ = this->create_publisher<CmdVel>("/mobile_base/commands/velocity", 1); -} - -DwaController::~DwaController() -{ - RCLCPP_INFO(get_logger(), "Shutting down DwaController"); -} - -TaskStatus -DwaController::execute(const nav2_tasks::FollowPathCommand::SharedPtr command) -{ - RCLCPP_INFO(get_logger(), "DwaController: Received a new path to follow of" - " size %i ending at (%.2f, %.2f)", (int)command->poses.size(), command->poses.back().position.x, - command->poses.back().position.y); - - // Spin here for a bit to fake out some processing time - for (int i = 0; i < 10; i++) { - // Do a bit of the task - const double cmd_vel = 0.1; - sendVelocity(cmd_vel); - std::this_thread::sleep_for(250ms); - - // Before we loop again to do more work, check if we've been canceled - if (cancelRequested()) { - RCLCPP_INFO(get_logger(), "DwaController: Follow task has been canceled."); - setCanceled(); - return TaskStatus::CANCELED; - } - } - - sendVelocity(0); - // We've successfully completed the task, so return the result - RCLCPP_INFO(get_logger(), "DwaController: Follow task has been completed."); - - nav2_tasks::FollowPathResult result; - setResult(result); - - return TaskStatus::SUCCEEDED; -} - -void DwaController::sendVelocity(double speed) -{ - RCLCPP_DEBUG(get_logger(), "DwaController::sendVelocity: %f", speed); - - CmdVel v; - v.linear.x = speed; - v.linear.y = 0; - v.linear.z = 0; - v.angular.x = 0; - v.angular.y = 0; - v.angular.z = 0; - vel_pub_->publish(v); -} - -} // namespace nav2_controller_example diff --git a/nav2_dwb_controller/nav2_controller_example/src/main.cpp b/nav2_dwb_controller/nav2_controller_example/src/main.cpp deleted file mode 100644 index 2af9a10d2b96732073017e2dbcea0202c466c055..0000000000000000000000000000000000000000 --- a/nav2_dwb_controller/nav2_controller_example/src/main.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2018 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include <memory> -#include "rclcpp/rclcpp.hpp" -#include "nav2_controller_example/dwa_controller.hpp" - -int main(int argc, char ** argv) -{ - rclcpp::init(argc, argv); - rclcpp::spin(std::make_shared<nav2_controller_example::DwaController>()); - rclcpp::shutdown(); - - return 0; -} diff --git a/nav2_dwb_controller/nav2_controller_example/test/.gitignore b/nav2_dwb_controller/nav2_controller_example/test/.gitignore deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000