diff --git a/README.md b/README.md index 757fa6b..0619268 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,9 @@ source install/setup.bash ## Install -This section describes how to install and build the packages contained in this repository. +To install the project from source, please follow **only one** of the following two sections. + +### Install with colcon In your ROS2 workspace, clone the repo: @@ -84,6 +86,21 @@ colcon build source install/setup.bash ``` +### Install as a single CMake project + +If you want to build this repository as a single CMake project, you can use the `CMakeLists.txt` provided in `xcub_moveit2_all_packages`: + +~~~shell +git clone https://github.com/icub-tech-iit/xcub-moveit2/ +cd xcub-moveit2/xcub_moveit2_all_packages +cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX= +cmake --build build +cmake --install build + +# Make ROS configuration files available in [ament index](https://github.com/ament/ament_index) +export AMENT_PREFIX_PATH=$AMENT_PREFIX_PATH: +~~~ + ## Usage on real hardware If you want to control a yarp-based robot (like iCub) using the proposed framework, you have to make sure that your machine is in communication with the robot one on which ros2 is installed. For this reason, be sure that your laptop and the robot machine are on the same network: diff --git a/xcub_moveit2_all_packages/CMakeLists.txt b/xcub_moveit2_all_packages/CMakeLists.txt new file mode 100644 index 0000000..59585ff --- /dev/null +++ b/xcub_moveit2_all_packages/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.22) +project(xcub-moveit2) + +# This file is used to easily build the whole xcub-moveit2 repo +# as a single CMake project. To avoid interfering with the existing +# colcon workflows, this CMakeLists.txt is contained in a subfolder +# of the repo called all_packages, that contains a COLCON_IGNORE +# so that it will be excluded automatically by the colcon build command + +# The order of inclusion was taken from colcon graph output +add_subdirectory(../ergocub_moveit_config ${CMAKE_CURRENT_BINARY_DIR}/ergocub_moveit_config) +add_subdirectory(../grasp_moveit ${CMAKE_CURRENT_BINARY_DIR}/grasp_moveit) +add_subdirectory(../icub_moveit_config ${CMAKE_CURRENT_BINARY_DIR}/icub_moveit_config) +add_subdirectory(../robot_controller ${CMAKE_CURRENT_BINARY_DIR}/robot_controller) +add_subdirectory(../robot_moveit ${CMAKE_CURRENT_BINARY_DIR}/robot_moveit) +add_subdirectory(../test_controller ${CMAKE_CURRENT_BINARY_DIR}/test_controller) + diff --git a/xcub_moveit2_all_packages/COLCON_IGNORE b/xcub_moveit2_all_packages/COLCON_IGNORE new file mode 100644 index 0000000..e69de29