TechmanRobotInc / tmr_ros2

TM Robots supporting ROS2 drivers and some extended external applications. (experimental) (not support the new TM S-Series)
Other
37 stars 21 forks source link

Colcon Build Error #26

Closed Sam-Seaberry closed 1 year ago

Sam-Seaberry commented 1 year ago

Automation Engineer, USA Ubuntu 20.04, ROS2 Foxy.

Getting a CMake error when trying to build in tmr_ros2 workspace. This happens with ROS sourced in ./bashrc and when done explicitly with source /opt/ros/foxy/setup.bash. ROS turtle sim works fine and so does the talker/listener referenced in the ROS setup guide. ROS Domain ID is set to 1 as well.

result of colcon build:

`Starting >>> tm_description Starting >>> tm_msgs Starting >>> techman_robot_msgs Starting >>> tm_get_status Starting >>> tm_mod_urdf Starting >>> tm_moveit_cpp_demo --- stderr: tm_description
CMake Error at CMakeLists.txt:4 (find_package): By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ament_cmake", but CMake did not find one.

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

ament_cmakeConfig.cmake
ament_cmake-config.cmake

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


Failed <<< tm_description [0.32s, exited with code 1] --- stderr: tm_msgs CMake Error at CMakeLists.txt:19 (find_package): By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ament_cmake", but CMake did not find one.

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

ament_cmakeConfig.cmake
ament_cmake-config.cmake

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


Failed <<< tm_msgs [0.32s, exited with code 1] Aborted <<< techman_robot_msgs [0.31s] Aborted <<< tm_moveit_cpp_demo [0.30s] Aborted <<< tm_mod_urdf [0.53s]
Aborted <<< tm_get_status [0.54s]

Summary: 0 packages finished [0.70s] 2 packages failed: tm_description tm_msgs 4 packages aborted: techman_robot_msgs tm_get_status tm_mod_urdf tm_moveit_cpp_demo 4 packages had stderr output: techman_robot_msgs tm_description tm_moveit_cpp_demo tm_msgs 12 packages not processed `

Sam-Seaberry commented 1 year ago

SOLVED run as root source /opt/ros/foxy/setup.bash && colcon build --symlink-install

okvik commented 1 year ago

Building ROS packages with root isn't and shouldn't be required. Something is very wrong with your setup.

Have you tried building some other, perhaps simpler, package from source? This should at least confirm that the problem isn't with this repository but on your side.

Sam-Seaberry commented 1 year ago

Yes, there is. I forgot to mention this is Ubuntu 20.04 running inside a virtual machine on Hyper-v.

From what I've read this is an issue with file permissions. Without running/sourcing as root I cannot access the necessary make files, as can be seen from that error above it failed at the first package it was looking for (ament-cmake in this case). I have tried elevating non-root users read/write access using chmod 740 and the feared 'chmod 777' but colcon still throws the above error.