diff --git a/CMakeLists.txt b/CMakeLists.txt index 92945cf0dfae6d5a618821fbd29701da1265b399..70b4a09b819e2014ac25bb7fb8d29d2ee501ecda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ set(dependencies nav2_dwb_controller pluginlib nav2_util + nav2_costmap_2d ) add_library(air_navigation SHARED @@ -44,6 +45,11 @@ add_library(air_navigation SHARED src/python_trajectory_generator.cpp) target_compile_definitions(air_navigation PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") target_link_libraries(air_navigation ${PYTHON_LIBRARY} ) +target_include_directories(air_navigation + PUBLIC + /opt/ros/humble/include/nav_2d_msgs + /opt/ros/humble/include/dwb_msgs +) ament_target_dependencies(air_navigation ${dependencies} ) diff --git a/include/air_navigation/python_controller.h b/include/air_navigation/python_controller.h index ceaf903b7aed9ca86045430eed6e4e2d88c34e5f..5cd41a1b271c5243ecbf6566a5b76dcd553087b4 100644 --- a/include/air_navigation/python_controller.h +++ b/include/air_navigation/python_controller.h @@ -23,8 +23,8 @@ public: void configure( const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, - std::string name, const std::shared_ptr<tf2_ros::Buffer> & tf, - const std::shared_ptr<nav2_costmap_2d::Costmap2DROS> & costmap_ros); + std::string name, std::shared_ptr<tf2_ros::Buffer> tf, + std::shared_ptr<nav2_costmap_2d::Costmap2DROS> costmap_ros); void cleanup() override; diff --git a/package.xml b/package.xml index 80607f12605391388a54868f8317c83de8d6993d..821197992b8eecb0cc02e50b653b571893b54db5 100644 --- a/package.xml +++ b/package.xml @@ -10,6 +10,7 @@ <buildtool_depend>ament_cmake</buildtool_depend> <depend>nav2_dwb_controller</depend> + <depend>nav2_costmap_2d</depend> <test_depend>ament_lint_auto</test_depend> <test_depend>ament_lint_common</test_depend> diff --git a/src/python_controller.cpp b/src/python_controller.cpp index 5961d31b5defbf05e4676f3b2bcd9ada029ec519..ca3cee5324cff736f2ba0809765e714adfdddbcd 100644 --- a/src/python_controller.cpp +++ b/src/python_controller.cpp @@ -15,8 +15,8 @@ using namespace air_navigation; void PythonController::configure( const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, - std::string name, const std::shared_ptr<tf2_ros::Buffer> &, - const std::shared_ptr<nav2_costmap_2d::Costmap2DROS> &) + std::string name, std::shared_ptr<tf2_ros::Buffer>, + std::shared_ptr<nav2_costmap_2d::Costmap2DROS>) { auto node = parent.lock(); RCLCPP_ERROR_STREAM(node->get_logger(), "Configuring Python controller");