Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building the whole repo as a single CMake project #27

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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=<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:<install_prefix>
~~~

## 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:
Expand Down
17 changes: 17 additions & 0 deletions xcub_moveit2_all_packages/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Empty file.
Loading