@43996173 空间构建错误:
tingbo@DESKTOP-NHH5E05:~/chapt8/chapt8_ws$ colcon build
Starting >>> autopatrol_interfaces
Starting >>> autopatrol_robot
Starting >>> fishbot_application
Starting >>> fishbot_description
Starting >>> fishbot_navigation2
Starting >>> nav2_custom_planner
Finished <<< fishbot_description [2.74s]
Finished <<< fishbot_navigation2 [2.75s]
Finished <<< autopatrol_interfaces [5.11s]
Finished <<< fishbot_application [8.58s]
Finished <<< autopatrol_robot [8.63s]
--- stderr: nav2_custom_planner
/home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp: In member function ‘virtual void nav2_custom_planner::CustomPlanner::configure(const WeakPtr&, std::string, std::shared_ptr<tf2_ros::Buffer>, std::shared_ptr<nav2_costmap_2d::Costmap2DROS>)’:
/home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp:19:57: error: no matching function for call to ‘declare_parameter_if_not_declared(rclcpp_lifecycle::LifecycleNode::SharedPtr&, std::string&, const char*, rclcpp::ParameterValue)’
19 | nav2_util::declare_parameter_if_not_declared(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
20 | node_, name_, + ".interpolation_resolution",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 | rclcpp::ParameterValue(0.1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp:1:
/opt/ros/humble/include/nav2_util/node_utils.hpp:92:6: note: candidate: ‘template<class NodeT> void nav2_util::declare_parameter_if_not_declared(NodeT, const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&)’
92 | void declare_parameter_if_not_declared(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/humble/include/nav2_util/node_utils.hpp:92:6: note: template argument deduction/substitution failed:
/home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp:20:31: note: cannot convert ‘+(const char*)".interpolation_resolution"’ (type ‘const char*’) to type ‘const rclcpp::ParameterValue&’
20 | node_, name_, + ".interpolation_resolution",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp:1:
/opt/ros/humble/include/nav2_util/node_utils.hpp:113:6: note: candidate: ‘template<class NodeT> void nav2_util::declare_parameter_if_not_declared(NodeT, const string&, const rclcpp::ParameterType&, const ParameterDescriptor&)’
113 | void declare_parameter_if_not_declared(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/humble/include/nav2_util/node_utils.hpp:113:6: note: template argument deduction/substitution failed:
/home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp:20:31: note: cannot convert ‘+(const char*)".interpolation_resolution"’ (type ‘const char*’) to type ‘const rclcpp::ParameterType&’
20 | node_, name_, + ".interpolation_resolution",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp: In member function ‘virtual nav_msgs::msg::Path nav2_custom_planner::CustomPlanner::createPlan(const PoseStamped&, const PoseStamped&)’:
/home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp:40:70: warning: unused parameter ‘start’ [-Wunused-parameter]
40 | CustomPlanner::createPlan(const geometry_msgs::msg::PoseStamped &start,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/home/tingbo/chapt8/chapt8_ws/src/nav2_custom_planner/src/nav2_custom_planner.cpp:41:63: warning: unused parameter ‘goal’ [-Wunused-parameter]
41 | const geometry_msgs::msg::PoseStamped &goal) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
gmake[2]: *** [CMakeFiles/nav2_custom_planner_Plugin.dir/build.make:76:CMakeFiles/nav2_custom_planner_Plugin.dir/src/nav2_custom_planner.cpp.o] 错误 1
gmake[1]: *** [CMakeFiles/Makefile2:137:CMakeFiles/nav2_custom_planner_Plugin.dir/all] 错误 2
gmake: *** [Makefile:146:all] 错误 2
---
Failed <<< nav2_custom_planner [25.2s, exited with code 2]
Summary: 5 packages finished [31.0s]
1 package failed: nav2_custom_planner
1 package had stderr output: nav2_custom_planner