Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Initial ROS drake package and repository information #6

Merged
merged 23 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
44d1a08
Initial ROS drake package and repository information
j-rivero Jan 12, 2024
d4c3525
Added a Dockerfile for testing
j-rivero Jan 16, 2024
9d1dd34
Use Drake real version in package.xml
j-rivero Jan 16, 2024
3b21e0a
Use upstream Drake v1.25.0. Drop clang patch
j-rivero Jan 18, 2024
4f0e964
DRAKE_IS_BUILDING_DOCUMENTATION is a no-op. Removed
j-rivero Jan 18, 2024
0ec7427
Simplify the bash prompt call
j-rivero Jan 18, 2024
98052d3
Remove unused line
j-rivero Jan 18, 2024
a4cd6a9
Added comments on CMAKE_ARGS
j-rivero Jan 18, 2024
659473c
Remove empty line and retab comment
j-rivero Jan 25, 2024
2a80ac7
Replace GLOBAL_HOOK by CONFIG_EXTRAS to provide integration
j-rivero Jan 25, 2024
826e713
Rename the project to drake_vendor
j-rivero Jan 25, 2024
e807355
Use libjchart2d-java from rosdistro and remove custom patch
j-rivero Jan 26, 2024
0044fbd
Back to use drake name for the ROS package
j-rivero Feb 28, 2024
6ce67e4
Improve comment formatting
j-rivero Mar 6, 2024
9d53a2d
Add buildtool depend on lsb-release
j-rivero Mar 6, 2024
f1ce9c5
Patch drake-extras.cmake with comments in #7
j-rivero Mar 6, 2024
9a79d00
Use latest version 1.26.0
j-rivero Mar 6, 2024
e31f5a3
Implement GitHub action testing and remove Dockerfile manual procedure
j-rivero Mar 6, 2024
607c226
Remove dockerfile script
j-rivero Mar 14, 2024
81a91ee
Include reference to the license issue in package.xml
j-rivero Mar 14, 2024
94257a9
Remove drake_cmake_installed_apt from the GitHub testing
j-rivero Mar 14, 2024
b44b5be
Add a comment about the workaround of the install target
j-rivero Mar 14, 2024
6562fe9
Use humble instead of rolling
j-rivero Mar 15, 2024
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
9 changes: 9 additions & 0 deletions .entrypoint-cmake-make-with-dpkgbuildflags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

. /opt/ros/rolling/setup.sh

mkdir src/ros-drake-vendor/build
cd src/ros-drake-vendor/build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_PREFIX_PATH=/opt/ros/rolling -DAMENT_PREFIX_PATH=/opt/ros/rolling -DCMAKE_INSTALL_PREFIX=/opt/ros/rolling -DCMAKE_BUILD_TYPE=None
make -j1 || true
exec "$@"
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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.25.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
PATCHES patches
GLOBAL_HOOK
)

ament_package()
49 changes: 49 additions & 0 deletions Dockerfile.cmake_dpkg_flags
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM ubuntu:jammy
LABEL maintainer="Jose Luis Rivero <[email protected]>"
ARG DEBIAN_FRONTEND=noninteractive

# setup timezone
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apt-get update && \
apt-get install -q -y --no-install-recommends tzdata && \
rm -rf /var/lib/apt/lists/*
# install packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
&& rm -rf /var/lib/apt/lists/*
# setup keys
RUN set -eux; \
key='C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \
mkdir -p /usr/share/keyrings; \
gpg --batch --export "$key" > /usr/share/keyrings/ros2-latest-archive-keyring.gpg; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME"
# setup sources.list
RUN echo "deb [ signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg ] http://packages.ros.org/ros2/ubuntu jammy main" > /etc/apt/sources.list.d/ros2-latest.list

# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_DISTRO rolling

RUN apt-get update && apt-get install -y \
build-essential \
python3-rosdep \
python3-colcon-common-extensions \
vim

RUN mkdir -p /tmp/ws/src/ros-drake-vendor
WORKDIR /tmp/ws/src
COPY . ros-drake-vendor/

RUN rosdep init \
&& rosdep update \
&& rosdep install --from-paths . --ignore-src -r -y -i --rosdistro ${ROS_DISTRO}

WORKDIR /tmp/ws
COPY .entrypoint-cmake-make-with-dpkgbuildflags.sh ./entrypoint-cmake-make-with-dpkgbuildflags.sh
ENTRYPOINT [ "./entrypoint-cmake-make-with-dpkgbuildflags.sh"]
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# 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.

# Docker testing

The `Dockerfile.cmake_dpkg_flags` can be used to simulate the build that the
ros_buildfarm will perform using calling the CMake building system with the
dpkg-buildflags typically used in the ROS build environment. To test it:

```
docker build -f Dockefile.cmake_dpkg_flags -t ros_drake_vendor_cmake .
docker run -i -t ros_drake_vendor_cmake /bin/bash
```
60 changes: 60 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>drake</name>
<version>1.24.0</version>
<description>
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.
</description>
<maintainer email="[email protected]">Drake Users</maintainer>
<license>BSD</license>

<!--
Missing Ubuntu dependencies in rosdistro from the list:
https://github.com/RobotLocomotion/drake/blob/v1.24.0/setup/ubuntu/source_distribution/packages-jammy.txt

- libg-dev (installed indirectly by opengl)
- libglx-dev (installed indirectly by qtbase5-dev)
- libmumps-seq-dev (installed indirectly, dependecy of coinor-libipopt-dev)
- patch (core dependency for any jammy system)
- python3-all-dev (equivalent to python3-dev)
Deb packages depends:
- python3 (python3-dev rosdep)
- libpython3-all-dev (python3-dev rosdep via libpython3-dev dep)
- python3-all:
Deb packages depends:
- python3 (python3-dev rosdep)
- python3-distutils (python3-dev rosdep)
- python3-dev (python3-dev rosdep)
- python3.8-dev (python3-dev rosdep)
-->
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_vendor_package</buildtool_depend>
<buildtool_depend>clang</buildtool_depend>
<buildtool_depend>file</buildtool_depend>
<buildtool_depend>gfortran</buildtool_depend>
<buildtool_depend>git</buildtool_depend>
<buildtool_depend>nasm</buildtool_depend>
<buildtool_depend>opencl-headers</buildtool_depend>
<buildtool_depend>patchelf</buildtool_depend>
<buildtool_depend>pkg-config</buildtool_depend>
<depend>coinor-libipopt-dev</depend>
<depend>java</depend>
<depend>libclang-dev</depend>
<depend>libglib-dev</depend>
<depend>liblapack-dev</depend>
<depend>libx11-dev</depend>
<depend>ocl-icd-opencl-dev</depend>
<depend>opengl</depend>
<depend>python3-dev</depend>
<depend>python3-distutils</depend>
<depend>python3-matplotlib</depend>
<depend>qtbase5-dev</depend>
<depend>zlib</depend>
<!-- External dependencies supported by CMake -->
<buildtool_depend>eigen</buildtool_depend>
<depend>fmt</depend>
<depend>spdlog</depend>
</package>
19 changes: 19 additions & 0 deletions patches/0001-use-internal-java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: Force the local build of libjchart2d-java
The libjchart2d-java package is not available on the rosdistro
registry. To workaround the problem, this patch force the
download and install of the java library.
Origin: https://github.com/RobotLocomotion/ros-drake-vendor/issues/3

diff --git a/tools/workspace/java.bzl b/tools/workspace/java.bzl
index a6b8372772..e412bf1933 100644
--- a/tools/workspace/java.bzl
+++ b/tools/workspace/java.bzl
@@ -14,7 +14,7 @@ def _impl(repo_ctx):
build_content = """\
package(default_visibility = ["//visibility:public"])
"""
- if os_result.target in repo_ctx.attr.local_os_targets:
+ if False:
is_local = True
filename = basename(repo_ctx.attr.local_jar)
repo_ctx.symlink(