diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9c22531 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,40 @@ +name: drake colcon ws + +on: + push: + +jobs: + build_testing: + runs-on: ubuntu-22.04 + steps: + - uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: humble + - uses: ros-tooling/action-ros-ci@v0.3 + with: + package-name: drake + target-ros2-distro: humble + skip-tests: true + # Remove cmake-target after https://github.com/RobotLocomotion/ros-drake-vendor/issues/10 + colcon-defaults: | + { + "build": { + "cmake-target": "install", + "merge-install": true + } + } + - name: checkout + uses: actions/checkout@v4 + with: + repository: RobotLocomotion/drake-external-examples + ref: main + path: ros_ws/src + - name: build tests + shell: bash + working-directory: ros_ws + run: | + # gflags is required by drake_cmake_installed + sudo apt-get update && sudo apt-get install -y libgflags-dev + . /opt/ros/humble/setup.bash + . install/setup.bash + colcon build --merge-install --packages-select drake_cmake_installed drake_ament_cmake_installed --event-handlers console_direct+ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0ac9230 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.10) +project(drake CXX) + +find_package(ament_cmake REQUIRED) +find_package(ament_cmake_vendor_package REQUIRED) + +ament_vendor(drake + VCS_URL https://github.com/RobotLocomotion/drake + VCS_VERSION v1.26.0 + CMAKE_ARGS +# At the moment, closed-source dependencies are disabled. + -DWITH_GUROBI:BOOL=OFF + -DWITH_MOSEK:BOOL=OFF + -DWITH_SNOPT:BOOL=OFF +# Drake should use the Ament version of these dependencies found by CMake, +# not the Ubuntu version found in /usr/include. + -DWITH_USER_EIGEN:BOOL=ON + -DWITH_USER_FMT:BOOL=ON + -DWITH_USER_SPDLOG:BOOL=ON + GLOBAL_HOOK +) + +ament_package(CONFIG_EXTRAS drake-extras.cmake) diff --git a/README.md b/README.md index 5378719..12fe904 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ -# ros-drake-vendor -Maintainer scripts that package Drake in the ROS build farm +# Drake installation for ROS environments + +The repository contains the sources for installing the +[Drake toolbox](http://drake.mit.edu) inside the [ROS](http://ros.org) +ecosystem. These sources are ready to be installed using the ROS +Buildfarm or any other ROS related build process. + +These sources specifically install the Drake Toolbox software. It's important +to note that this is distinct from other code installations that may involve +ROS helpers or ROS wrappers for Drake. + +# Installation process + +The repository defines a ROS package named drake, which facilitates the +download of the Drake sources from its official repository. Subsequently, it +invokes the CMake build system within these sources to facilitate the +generation of a system installation for the toolbox. diff --git a/drake-extras.cmake b/drake-extras.cmake new file mode 100644 index 0000000..ee5b6eb --- /dev/null +++ b/drake-extras.cmake @@ -0,0 +1,21 @@ +# The code will search for the upstream drake-config.cmake file +# installed under the root of the ROS installation + /opt/drake +# (i.e /opt/ros/rolling/opt/drake ). +# +# Long explanation of how this file works can be found in: +# https://github.com/RobotLocomotion/ros-drake-vendor/issues/7#issuecomment-1979757703 + +# drake_DIR will return the absolute path to the ROS package +# of drake (share/drake/cmake under the ROS root installation) +# The relative path should drive us to the root of the drake +# upstream installation done under ROS. +set(_drake_path "${drake_DIR}/../../../opt/drake") + +# Since the upstream installation has the same CMake module name +# than the ROS package we need to unset the cache variable +# that points to the ROS package to be sure to force the +# find_package to find the drake config module under the +# paths +unset(drake_DIR CACHE) + +find_package(drake PATHS ${_drake_path} NO_DEFAULT_PATH) diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..b07df20 --- /dev/null +++ b/package.xml @@ -0,0 +1,61 @@ + + + + drake + 1.26.0 + + The drake package provides a ROS installation for the Drake project: + https://drake.mit.edu/. The package uses ament_vendor to + download and build a given Drake version. + + Drake Users + BSD + + ament_cmake + ament_cmake_vendor_package + clang + file + gfortran + git + lsb-release + nasm + opencl-headers + patchelf + pkg-config + coinor-libipopt-dev + java + libclang-dev + libjchart2d-java + libglib-dev + liblapack-dev + libx11-dev + ocl-icd-opencl-dev + opengl + python3-dev + python3-distutils + python3-matplotlib + qtbase5-dev + zlib + + eigen + fmt + spdlog +