Skip to content

Commit 2989415

Browse files
Add support for building the whole repo as a single CMake project (#27)
2 parents 6127639 + 7974ed2 commit 2989415

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

README.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ source install/setup.bash
6666
6767
## Install
6868
69-
This section describes how to install and build the packages contained in this repository.
69+
To install the project from source, please follow **only one** of the following two sections.
70+
71+
### Install with colcon
7072
7173
In your ROS2 workspace, clone the repo:
7274
@@ -84,6 +86,21 @@ colcon build
8486
source install/setup.bash
8587
```
8688

89+
### Install as a single CMake project
90+
91+
If you want to build this repository as a single CMake project, you can use the `CMakeLists.txt` provided in `xcub_moveit2_all_packages`:
92+
93+
~~~shell
94+
git clone https://github.com/icub-tech-iit/xcub-moveit2/
95+
cd xcub-moveit2/xcub_moveit2_all_packages
96+
cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=<install_prefix>
97+
cmake --build build
98+
cmake --install build
99+
100+
# Make ROS configuration files available in [ament index](https://github.com/ament/ament_index)
101+
export AMENT_PREFIX_PATH=$AMENT_PREFIX_PATH:<install_prefix>
102+
~~~
103+
87104
## Usage on real hardware
88105

89106
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:
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cmake_minimum_required(VERSION 3.22)
2+
project(xcub-moveit2)
3+
4+
# This file is used to easily build the whole xcub-moveit2 repo
5+
# as a single CMake project. To avoid interfering with the existing
6+
# colcon workflows, this CMakeLists.txt is contained in a subfolder
7+
# of the repo called all_packages, that contains a COLCON_IGNORE
8+
# so that it will be excluded automatically by the colcon build command
9+
10+
# The order of inclusion was taken from colcon graph output
11+
add_subdirectory(../ergocub_moveit_config ${CMAKE_CURRENT_BINARY_DIR}/ergocub_moveit_config)
12+
add_subdirectory(../grasp_moveit ${CMAKE_CURRENT_BINARY_DIR}/grasp_moveit)
13+
add_subdirectory(../icub_moveit_config ${CMAKE_CURRENT_BINARY_DIR}/icub_moveit_config)
14+
add_subdirectory(../robot_controller ${CMAKE_CURRENT_BINARY_DIR}/robot_controller)
15+
add_subdirectory(../robot_moveit ${CMAKE_CURRENT_BINARY_DIR}/robot_moveit)
16+
add_subdirectory(../test_controller ${CMAKE_CURRENT_BINARY_DIR}/test_controller)
17+

xcub_moveit2_all_packages/COLCON_IGNORE

Whitespace-only changes.

0 commit comments

Comments
 (0)