How would you separate global and local planner?
My goal is to separate the global path planner from the navigation stack. The idea is to have the regular navigation stack with local planner on the robot while calculating the global plan from a pc.
I've experimented a bit with ROS2 since it has better performance with multi robot systems. The tutorials I've tried from here do not work, however, and I'm tempted to go back to ROS1.
The problem with the tutorials is that I can't build the cloned github and I get the following error message:
Starting >>> nav2_costmap_filters_demo
Starting >>> nav2_gradient_costmap_plugin
Starting >>> nav2_sms_recovery
Starting >>> nav2_straightline_planner
Starting >>> sam_bot_description
Finished <<< nav2_costmap_filters_demo [0.28s]
Finished <<< sam_bot_description [0.26s]
--- stderr: nav2_gradient_costmap_plugin
/home/william/dev_ws/src/navigation2_tutorials/nav2_gradient_costmap_plugin/src/gradient_layer.cpp: In member function ‘virtual void nav2_gradient_costmap_plugin::GradientLayer::onInitialize()’:
/home/william/dev_ws/src/navigation2_tutorials/nav2_gradient_costmap_plugin/src/gradient_layer.cpp:70:21: error: ‘using SharedPtr = class std::shared_ptr<rclcpp_lifecycle::LifecycleNode>’ {aka ‘class std::shared_ptr<rclcpp_lifecycle::LifecycleNode>’} has no member named ‘lock’
70 | auto node = node_.lock();
| ^~~~
make[2]: *** [CMakeFiles/nav2_gradient_costmap_plugin_core.dir/build.make:63: CMakeFiles/nav2_gradient_costmap_plugin_core.dir/src/gradient_layer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/nav2_gradient_costmap_plugin_core.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< nav2_gradient_costmap_plugin [2.64s, exited with code 2]
Aborted <<< nav2_straightline_planner [3.36s]
Aborted <<< nav2_sms_recovery [5.00s]
Summary: 2 packages finished [5.18s]
1 package failed: nav2_gradient_costmap_plugin
2 packages aborted: nav2_sms_recovery nav2_straightline_planner
3 packages had stderr output: nav2_gradient_costmap_plugin nav2_sms_recovery nav2_straightline_planner
After a complete removal of foxy and re-installation, I get another error:
Starting >>> nav2_costmap_filters_demo
Starting >>> nav2_gradient_costmap_plugin
Starting >>> nav2_sms_recovery
Starting >>> nav2_straightline_planner
Starting >>> sam_bot_description
Finished <<< nav2_costmap_filters_demo [1.19s]
Finished <<< sam_bot_description [1.20s]
--- stderr: nav2_gradient_costmap_plugin
CMake Error at CMakeLists.txt:26 (find_package):
By not providing "Findnav2_costmap_2d.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"nav2_costmap_2d", but CMake did not find one.
Could not find a package configuration file provided by "nav2_costmap_2d"
with any of the following names:
nav2_costmap_2dConfig.cmake
nav2_costmap_2d-config.cmake
Add the installation prefix of "nav2_costmap_2d" to CMAKE_PREFIX_PATH or
set "nav2_costmap_2d_DIR" to a directory containing one of the above files.
If "nav2_costmap_2d" provides a separate development package or SDK, be
sure it has been installed.
---
Failed <<< nav2_gradient_costmap_plugin [1.69s, exited with code 1]
Aborted <<< nav2_sms_recovery [1.84s]
Aborted <<< nav2_straightline_planner [1.88s]
Summary: 2 packages finished [2.06s]
1 package failed: nav2_gradient_costmap_plugin
2 packages aborted: nav2_sms_recovery nav2_straightline_planner
3 packages had stderr output: nav2_gradient_costmap_plugin nav2_sms_recovery nav2_straightline_planner