Skip to content

Commit

Permalink
[debian] Implement ROS2 packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Feb 16, 2024
1 parent 0a78e16 commit 5c4be17
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 41 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ jobs:
uses: jrl-umi3218/github-actions/.github/workflows/package-project.yml@master
with:
with-ros: true
latest-cmake: true
matrix: |
{
"dist": ["bionic", "focal"],
"dist": ["bionic", "focal", "jammy"],
"arch": ["amd64"]
}
secrets:
Expand Down
9 changes: 6 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ Vcs-git: https://github.com/jrl-umi3218/mc_rtc_msgs
Vcs-Browser: https://github.com/jrl-umi3218/mc_rtc_msgs
Build-Depends: debhelper (>= 9),
cmake,
qt5-default,
qtbase5-dev | qt5-default,
libqwt-qt5-dev,
# ros-@ROS_DISTRO@-mc-rtc-plugin,
# ros-@ROS_DISTRO@-rviz,
# ros-@ROS_DISTRO@-tf,
#ROS1 ros-@ROS_DISTRO@-rviz,
#ROS1 ros-@ROS_DISTRO@-tf,
#ROS2 ros-@ROS_DISTRO@-rviz2,
#ROS2 ros-@ROS_DISTRO@-tf2,
#ROS2 ros-@ROS_DISTRO@-visualization-msgs,
libmc-rtc-dev
12 changes: 2 additions & 10 deletions debian/control.ros
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Architecture: any
Section: science
Depends: ${mic:Depends},
${shlibs:Depends},
ros-@ROS_DISTRO@-rviz
#ROS1 ros-@ROS_DISTRO@-rviz
#ROS2 ros-@ROS_DISTRO@-rviz2
Description: mc-rtc - RViZ panel
RViZ plugin implementing mc_rtc GUI

Expand All @@ -16,15 +17,6 @@ Depends: ${misc:Depends},
Description: mc-rtc - ROS ticker
mc_rtc interface implementation using ROS for kinematic simulations

Package: ros-@ROS_DISTRO@-mc-surfaces-visualization
Architecture: any
Section: science
Depends: ${misc:Depends},
${shlibs:Depends},
ros-@ROS_DISTRO@-rviz
Description: mc-rtc - Surfaces visualization
RViZ based tools to visualize surfaces

Package: ros-@ROS_DISTRO@-mc-rtc-tools
Architecture: any
Section: science
Expand Down
9 changes: 7 additions & 2 deletions debian/ros-ROS_DISTRO-mc-rtc-rviz-panel.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
opt/ros/@ROS_DISTRO@/lib/libmc_rtc_rviz_panel.so
opt/ros/@ROS_DISTRO@/lib/mc_rtc_rviz_panel/mc_rtc_gui
opt/ros/@ROS_DISTRO@/lib/pkgconfig/mc_rtc_rviz_panel.pc
#ROS1 opt/ros/@ROS_DISTRO@/lib/mc_rtc_rviz_panel/mc_rtc_gui
#ROS1 opt/ros/@ROS_DISTRO@/lib/pkgconfig/mc_rtc_rviz_panel.pc
#ROS2 opt/ros/@ROS_DISTRO@/bin/mc_rtc_gui
#ROS2 opt/ros/@ROS_DISTRO@/share/ament_index/resource_index/package_run_dependencies/mc_rtc_rviz_panel
#ROS2 opt/ros/@ROS_DISTRO@/share/ament_index/resource_index/packages/mc_rtc_rviz_panel
#ROS2 opt/ros/@ROS_DISTRO@/share/ament_index/resource_index/parent_prefix_path/mc_rtc_rviz_panel
#ROS2 opt/ros/@ROS_DISTRO@/share/ament_index/resource_index/rviz_common__pluginlib__plugin/mc_rtc_rviz_panel
opt/ros/@ROS_DISTRO@/share/mc_rtc_rviz_panel/*
5 changes: 4 additions & 1 deletion debian/ros-ROS_DISTRO-mc-rtc-ticker.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
opt/ros/@ROS_DISTRO@/lib/pkgconfig/mc_rtc_ticker.pc
#ROS1 opt/ros/@ROS_DISTRO@/lib/pkgconfig/mc_rtc_ticker.pc
#ROS2 opt/ros/@ROS_DISTRO@/share/ament_index/resource_index/package_run_dependencies/mc_rtc_ticker
#ROS2 opt/ros/@ROS_DISTRO@/share/ament_index/resource_index/packages/mc_rtc_ticker
#ROS2 opt/ros/@ROS_DISTRO@/share/ament_index/resource_index/parent_prefix_path/mc_rtc_ticker
opt/ros/@ROS_DISTRO@/share/mc_rtc_ticker/*
52 changes: 28 additions & 24 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
#!/usr/bin/make -f
# -*- makefile -*-

SRC:=$(CURDIR)
TMP:=$(CURDIR)/debian/tmp

export ROS_DISTRO=@ROS_DISTRO@
ifeq (${ROS_DISTRO},)
export CMAKE_OPTIONS=
export EXTRA_STEPS=
export ROS_DISTRO:=@ROS_DISTRO@
export ROS_VERSION:=$(shell . /opt/ros/${ROS_DISTRO}/setup.sh && echo $$ROS_VERSION)
export ROS_PYTHON_VERSION:=$(shell . /opt/ros/${ROS_DISTRO}/setup.sh && echo $$ROS_PYTHON_VERSION)
ifeq (${ROS_PYTHON_VERSION}, 3)
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python3/dist-packages:${PYTHONPATH}
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python$(shell python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}');")/site-packages:${PYTHONPATH}
export PYTHON_EXECUTABLE:=/usr/bin/python3
else
export ROS_VERSION:=$(shell . /opt/ros/${ROS_DISTRO}/setup.sh && echo $$ROS_VERSION)
export ROS_PYTHON_VERSION:=$(shell . /opt/ros/${ROS_DISTRO}/setup.sh && echo $$ROS_PYTHON_VERSION)
ifeq (${ROS_PYTHON_VERSION}, 3)
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python3/dist-packages:${PYTHONPATH}
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python$(shell python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}');")/site-packages:${PYTHONPATH}
export PYTHON_EXECUTABLE=/usr/bin/python3
else
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python2.7/dist-packages:${PYTHONPATH}
export PYTHON_EXECUTABLE=/usr/bin/python
endif
export PKG_CONFIG_PATH=/opt/ros/${ROS_DISTRO}/lib/pkgconfig:$PKG_CONFIG_PATH
export ROS_MASTER_URI=http://localhost:11311
export ROS_PACKAGE_PATH=/opt/ros/${ROS_DISTRO}/share
export LD_LIBRARY_PATH:=/opt/ros/${ROS_DISTRO}/lib:$LD_LIBRARY_PATH
export CMAKE_PREFIX_PATH=/opt/ros/${ROS_DISTRO}:$CMAKE_PREFIX_PATH
export CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=/opt/ros/${ROS_DISTRO} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python2.7/dist-packages:${PYTHONPATH}
export PYTHON_EXECUTABLE:=/usr/bin/python
endif
export PKG_CONFIG_PATH:=/opt/ros/${ROS_DISTRO}/lib/pkgconfig:$PKG_CONFIG_PATH
export ROS_MASTER_URI:=http://localhost:11311
export ROS_PACKAGE_PATH:=/opt/ros/${ROS_DISTRO}/share
export LD_LIBRARY_PATH:=/opt/ros/${ROS_DISTRO}/lib:$LD_LIBRARY_PATH
export CMAKE_PREFIX_PATH:=/opt/ros/${ROS_DISTRO}:$CMAKE_PREFIX_PATH
# Default CMake options for Debian packaging
export CMAKE_OPTIONS:=-DCMAKE_BUILD_TYPE=None -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_AUTOGEN_VERBOSE=ON
export CMAKE_OPTIONS:=${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=/opt/ros/${ROS_DISTRO} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}


%:
dh $@

override_dh_auto_configure:
cp $(CURDIR)/debian/CMakeLists.txt $(CURDIR)/
dh_auto_configure -- ${CMAKE_OPTIONS}
cmake -S $(SRC)/mc_rtc_ticker -B $(SRC)/build/mc_rtc_ticker ${CMAKE_OPTIONS}
cmake -S $(SRC)/mc_rtc_rviz_panel -B $(SRC)/build/mc_rtc_rviz_panel ${CMAKE_OPTIONS}

override_dh_auto_build:
cmake --build $(SRC)/build/mc_rtc_ticker
cmake --build $(SRC)/build/mc_rtc_rviz_panel

override_dh_auto_install:
dh_auto_install --destdir=$(TMP)
${EXTRA_STEPS}
cd $(SRC)/build/mc_rtc_ticker && make -j1 install DESTDIR=$(TMP) AM_UPDATE_INFO_DIR=no
cd $(SRC)/build/mc_rtc_rviz_panel && make -j1 install DESTDIR=$(TMP) AM_UPDATE_INFO_DIR=no

override_dh_auto_test:

0 comments on commit 5c4be17

Please sign in to comment.