Примечания к исследованию ROS2: проблемы, возникшие при компиляции ROS2 Navigation2

Сначала загрузите исходный код на github
, не забудьте выбрать соответствующую версию
вставьте сюда описание изображения
и поместить ее в файл src в рабочей области
1. Решите проблему зависимости

rosdep install -i --from-path src --rosdistro eloquent -y

Появляется сообщение об ошибке:

gym@gym:~/wheeltec_robot_ros2$ rosdep install -i --from-path src --rosdistro eloquen -y
WARNING: given --rosdistro eloquen but ROS_DISTRO is "eloquent". Ignoring environment.
WARNING: ROS_PYTHON_VERSION is unset. Defaulting to 2
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
nav2_behavior_tree: Cannot locate rosdep definition for [behaviortree_cpp_v3]
nav2_system_tests: Cannot locate rosdep definition for [launch_testing]
nav2_map_server: Cannot locate rosdep definition for [launch_testing]
nav2_amcl: Cannot locate rosdep definition for [launch_testing]
nav2_bringup: Cannot locate rosdep definition for [launch_testing]
nav2_core: Cannot locate rosdep definition for [launch_testing]
nav2_bt_navigator: Cannot locate rosdep definition for [behaviortree_cpp_v3]
nav2_util: Cannot locate rosdep definition for [test_msgs]
nav2_costmap_2d: Cannot locate rosdep definition for [launch_testing]

Решение:
добавьте параметр -r, проигнорируйте ошибку и переустановите зависимости

rosdep install -i --from-path src --rosdistro eloquent -y -r

2. Скомпилируйте:

colcon build

Все еще получаю ошибку:

CMake Error at test/CMakeLists.txt:4 (find_package):
  By not providing "Findtest_msgs.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "test_msgs", but CMake did not find one.

  Could not find a package configuration file provided by "test_msgs" with
  any of the following names:

    test_msgsConfig.cmake
    test_msgs-config.cmake

  Add the installation prefix of "test_msgs" to CMAKE_PREFIX_PATH or set
  "test_msgs_DIR" to a directory containing one of the above files.  If
  "test_msgs" provides a separate development package or SDK, be sure it has
  been installed.

---
 

Решение. Установите зависимые пакеты вручную.
Вместе установлено несколько похожих зависимых пакетов.

sudo apt install ros-eloquent-test-msgs
sudo apt install ros-eloquent-behaviortree-cpp-v3
sudo apt install ros-eloquent-gazebo-rospkgsr

Вот хитрость для установки пакета зависимостей: если вы не знаете имя пакета зависимостей в этой версии, например, test-msgs, вы можете сначала ввести ros-eloquent-test, а затем дважды щелкнуть клавишу Tab, чтобы найти соответствующий пакет. .
Перекомпиляция прошла успешно.

Supongo que te gusta

Origin blog.csdn.net/Feizhai2/article/details/114119003
Recomendado
Clasificación