4
解析nav2_controller
source link: https://charon-cheung.github.io/2022/06/23/ROS/ROS2/%E8%A7%A3%E6%9E%90nav2_controller/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
解析nav2_controller | 沉默杀手
nav2_controller主要是实现了一个中间件的功能,具体的工作还是各种插件完成的,统一了接口,固定了流程,使得开发变得规范
nav2_controller/main.cpp
int main(int argc, char ** argv)
{
rclcpp::init(argc, argv);
auto node = std::make_shared<nav2_controller::ControllerServer>();
rclcpp::spin(node->get_node_base_interface());
rclcpp::shutdown();
return 0;
}
主要看
ControllerServer
的构造函数单独开了一个cost_map的线程
rclcpp_lifecycle::LifecyclePublisher::on_activate
auto node = shared_from_this();
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK