Skip to content

Commit 3f9d48e

Browse files
iconner22AndyZe
andauthored
Updates for building on ROS 2 Jazzy (#151)
* Updates for building on ROS2 Jazzy; built and tested * Adjust CI for jazzy --------- Co-authored-by: AndyZe <[email protected]>
1 parent a883ec2 commit 3f9d48e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1368
-1438
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,13 @@ name: CI
66
on: [push, pull_request]
77

88
jobs:
9-
default:
9+
industrial_ci:
1010
strategy:
11-
fail-fast: false
1211
matrix:
1312
env:
14-
- IMAGE: noetic
15-
CATKIN_LINT: true
16-
CCOV: true
17-
env:
18-
DOCKER_IMAGE: 'moveit/moveit:${{ matrix.env.IMAGE }}-release'
19-
AFTER_RUN_TARGET_TEST: ${{ matrix.env.CCOV && './.ci.prepare_codecov' || '' }}
20-
TARGET_CMAKE_ARGS: >
21-
-DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'RelWithDebInfo' || 'Release'}}
22-
${{ matrix.env.CCOV && '-DCMAKE_CXX_FLAGS="--coverage" --no-warn-unused-cli' || '' }}
23-
CCACHE_DIR: "${{ github.workspace }}/.ccache"
24-
BASEDIR: ${{ github.workspace }}/.work
25-
CACHE_PREFIX: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}"
26-
CLANG_TIDY_BASE_REF: "${{ github.base_ref || github.ref }}"
27-
28-
name: "${{ matrix.env.IMAGE }}${{ matrix.env.CATKIN_LINT && ' + catkin_lint' || ''}}${{ matrix.env.CCOV && ' + ccov' || ''}}${{ matrix.env.IKFAST_TEST && ' + ikfast' || ''}}${{ matrix.env.CLANG_TIDY && ' + clang-tidy' || '' }}"
29-
runs-on: ubuntu-latest
13+
- {ROS_DISTRO: jazzy, ROS_REPO: main}
14+
runs-on: ubuntu-24.04
3015
steps:
3116
- uses: actions/checkout@v4
32-
- name: cache upstream_ws
33-
uses: rhaschke/cache@main
34-
with:
35-
path: ${{ env.BASEDIR }}/upstream_ws
36-
key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.rosinstall') }}-${{ github.run_id }}
37-
restore-keys: |
38-
upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.rosinstall') }}
39-
env:
40-
GHA_CACHE_SAVE: always
41-
- name: cache ccache
42-
uses: rhaschke/cache@main
43-
with:
44-
path: ${{ env.CCACHE_DIR }}
45-
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
46-
restore-keys: |
47-
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
48-
ccache-${{ env.CACHE_PREFIX }}
49-
env:
50-
GHA_CACHE_SAVE: always
51-
- name: industrial_ci
52-
uses: ros-industrial/industrial_ci@master
53-
env: ${{ matrix.env }}
54-
- name: upload test artifacts (on failure)
55-
uses: actions/upload-artifact@v4
56-
if: failure()
57-
with:
58-
name: test-results
59-
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
60-
- name: upload codecov report
61-
uses: codecov/codecov-action@v4
62-
if: ${{ matrix.env.CCOV }}
63-
with:
64-
files: ${{ env.BASEDIR }}/coverage.info
17+
- uses: 'ros-industrial/industrial_ci@master'
18+
env: ${{matrix.env}}

.pre-commit-config.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
repos:
1616
# Standard hooks
1717
- repo: https://github.com/pre-commit/pre-commit-hooks
18-
rev: v3.4.0
18+
rev: v4.4.0
1919
hooks:
2020
- id: check-added-large-files
2121
- id: check-case-conflict
@@ -29,7 +29,7 @@ repos:
2929
- id: trailing-whitespace
3030

3131
- repo: https://github.com/psf/black
32-
rev: 22.3.0
32+
rev: 23.3.0
3333
hooks:
3434
- id: black
3535

@@ -38,10 +38,10 @@ repos:
3838
- id: clang-format
3939
name: clang-format
4040
description: Format files with ClangFormat.
41-
entry: clang-format-10
41+
entry: clang-format
4242
language: system
4343
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
44-
args: ['-fallback-style=none', '-i']
44+
args: ["-fallback-style=none", "-i"]
4545

4646
- repo: local
4747
hooks:
@@ -51,11 +51,3 @@ repos:
5151
language: pygrep
5252
entry: Moveit|MoveIt!
5353
exclude: .pre-commit-config.yaml|README.md
54-
55-
- id: catkin_lint
56-
name: catkin_lint
57-
description: Check package.xml and cmake files
58-
entry: catkin_lint .
59-
language: system
60-
always_run: true
61-
pass_filenames: false

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,32 @@
22

33
*Tools for robot arm hand-eye calibration.*
44

5-
| **Warning to Melodic users** |
6-
| --- |
7-
| OpenCV 3.2, which is the version in Ubuntu 18.04, has a buggy ArUco board pose detector. Do not expect adequate results if you are using an ArUco board with OpenCV 3.2. |
8-
95
MoveIt Calibration supports ArUco boards and ChArUco boards as calibration targets. Experiments have demonstrated that a
106
ChArUco board gives more accurate results, so it is recommended.
117

12-
This repository has been developed and tested on ROS Melodic and Noetic. It has not been tested on earlier ROS versions.
13-
When building `moveit_calibration` on ROS Melodic, `rviz_visual_tools` must also be built from source.
14-
158
This package was originally developed by Dr. Yu Yan at Intel, and was originally submitted as a PR to the core MoveIt
169
repository. For background, see this [Github discussion](https://github.com/ros-planning/moveit/issues/1070).
1710

11+
## Instructions
12+
13+
### Build from Source
14+
15+
```sh
16+
mkdir -p ws_moveit/src
17+
cd ws_moveit
18+
git clone https://github.com/ros-planning/moveit_calibration.git -b ros2 src/moveit_calibration
19+
vcs import src < src/moveit_calibration/moveit_calibration.repos --skip-existing
20+
rosdep install -r --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y
21+
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
22+
```
23+
24+
### Example
25+
26+
<!-- TODO: Update tutorial link for website once available -->
27+
For examples, please follow [Hand-Eye Calibration tutorial](https://github.com/ros-planning/moveit2_tutorials/blob/main/doc/examples/hand_eye_calibration/hand_eye_calibration_tutorial.rst) from [moveit2_tutorials](https://github.com/ros-planning/moveit2_tutorials).
28+
1829
## GitHub Actions - Continuous Integration
1930

20-
[![Format](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yaml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yaml?branch=master)
21-
[![BuildAndTest](https://github.com/ros-planning/moveit_calibration/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_calibration/actions/workflows/ci.yaml?branch=master)
22-
[![codecov](https://codecov.io/gh/ros-planning/moveit_calibration/branch/master/graph/badge.svg?token=W7uHKcY0ly)](https://codecov.io/gh/ros-planning/moveit_calibration)
31+
[![Format](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yaml/badge.svg?branch=ros2)](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yaml?branch=ros2)
32+
[![BuildAndTest](https://github.com/ros-planning/moveit_calibration/actions/workflows/ci.yaml/badge.svg?branch=ros2)](https://github.com/ros-planning/moveit_calibration/actions/workflows/ci.yaml?branch=ros2)
33+
[![codecov](https://codecov.io/gh/ros-planning/moveit_calibration/branch/ros2/graph/badge.svg?token=W7uHKcY0ly)](https://codecov.io/gh/ros-planning/moveit_calibration)

moveit_calibration_gui/CHANGELOG.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
Changelog for package moveit_calibration_gui
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5-
0.1.0 (forthcoming)
5+
2.0.0 (forthcoming)
6+
-----------
7+
* First public release for ROS 2
8+
9+
0.1.1
10+
-----------
11+
* Calculate and report reprojection error
12+
13+
0.1.0
614
-----------
715
* First public release for Noetic
Lines changed: 43 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,59 @@
1-
cmake_minimum_required(VERSION 3.1.3)
1+
cmake_minimum_required(VERSION 3.10.2)
2+
3+
# Silence CMP0167 warnings from downstream packages (MoveIt, geometric_shapes, etc.)
4+
if(POLICY CMP0167)
5+
cmake_policy(SET CMP0167 OLD)
6+
endif()
7+
28
project(moveit_calibration_gui)
39

4-
find_package(catkin REQUIRED COMPONENTS
5-
class_loader
10+
# Common cmake code applied to all moveit packages
11+
find_package(moveit_common REQUIRED)
12+
moveit_package()
13+
14+
# find dependencies
15+
find_package(ament_cmake_ros REQUIRED)
16+
find_package(cv_bridge REQUIRED)
17+
find_package(Eigen3 REQUIRED)
18+
find_package(eigen3_cmake_module REQUIRED)
19+
find_package(image_geometry REQUIRED)
20+
find_package(image_transport REQUIRED)
21+
find_package(moveit_calibration_plugins REQUIRED)
22+
find_package(moveit_ros_visualization REQUIRED)
23+
find_package(moveit_ros_planning_interface REQUIRED)
24+
find_package(moveit_visual_tools REQUIRED)
25+
find_package(OpenCV REQUIRED)
26+
find_package(pluginlib REQUIRED)
27+
find_package(rclcpp REQUIRED)
28+
find_package(rviz_common REQUIRED)
29+
find_package(rviz_visual_tools REQUIRED)
30+
find_package(tf2_eigen REQUIRED)
31+
32+
set(THIS_PACKAGE_INCLUDE_DEPENDS
633
cv_bridge
7-
geometric_shapes
34+
Eigen3
835
image_geometry
36+
image_transport
937
moveit_calibration_plugins
10-
moveit_core
11-
moveit_ros_perception
12-
moveit_ros_planning
13-
moveit_ros_planning_interface
1438
moveit_ros_visualization
39+
moveit_ros_planning_interface
1540
moveit_visual_tools
1641
pluginlib
17-
rosconsole
18-
roscpp
19-
rviz
42+
rclcpp
43+
rviz_common
2044
rviz_visual_tools
2145
tf2_eigen
2246
)
2347

24-
find_package(Eigen3 REQUIRED)
25-
26-
moveit_build_options()
27-
28-
# Qt Stuff
29-
if(rviz_QT_VERSION VERSION_LESS "5")
30-
find_package(Qt4 ${rviz_QT_VERSION} REQUIRED QtCore QtGui)
31-
include(${QT_USE_FILE})
32-
macro(qt_wrap_ui)
33-
qt4_wrap_ui(${ARGN})
34-
endmacro()
35-
else()
36-
find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets)
37-
set(QT_LIBRARIES Qt5::Widgets)
38-
macro(qt_wrap_ui)
39-
qt5_wrap_ui(${ARGN})
40-
endmacro()
41-
endif()
42-
43-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
44-
set(CMAKE_AUTOMOC ON)
45-
add_definitions(-DQT_NO_KEYWORDS)
46-
47-
catkin_package(
48-
LIBRARIES
49-
moveit_handeye_calibration_rviz_plugin_core
50-
INCLUDE_DIRS
51-
handeye_calibration_rviz_plugin/include
52-
CATKIN_DEPENDS
53-
moveit_calibration_plugins
54-
moveit_core
55-
moveit_ros_perception
56-
moveit_ros_planning
57-
moveit_ros_planning_interface
58-
moveit_visual_tools
59-
roscpp
60-
rviz
61-
rviz_visual_tools
62-
DEPENDS
63-
EIGEN3
64-
)
65-
66-
include_directories(
67-
handeye_calibration_rviz_plugin/include
68-
${Boost_INCLUDE_DIRS}
69-
${catkin_INCLUDE_DIRS})
70-
71-
include_directories(SYSTEM
72-
${EIGEN3_INCLUDE_DIRS}
73-
${QT_INCLUDE_DIR})
74-
48+
# Add project sub-libraries
7549
add_subdirectory(handeye_calibration_rviz_plugin)
7650

77-
install(FILES
51+
# Export plugin descriptions to register with pluginlib
52+
pluginlib_export_plugin_description_file(
53+
rviz_common
7854
handeye_calibration_rviz_plugin_description.xml
79-
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
55+
)
8056

81-
if (CATKIN_ENABLE_TESTING)
82-
find_package(rostest REQUIRED)
83-
endif()
57+
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
58+
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
59+
ament_package()
Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,72 @@
1-
find_package(OpenCV REQUIRED)
2-
1+
set(MOVEIT_LIB_NAME moveit_handeye_calibration_rviz_plugin)
32
set(HEADERS
43
include/moveit/handeye_calibration_rviz_plugin/handeye_calibration_display.h
54
include/moveit/handeye_calibration_rviz_plugin/handeye_calibration_frame.h
6-
include/moveit/handeye_calibration_rviz_plugin/handeye_target_widget.h
75
include/moveit/handeye_calibration_rviz_plugin/handeye_context_widget.h
86
include/moveit/handeye_calibration_rviz_plugin/handeye_control_widget.h
7+
include/moveit/handeye_calibration_rviz_plugin/handeye_target_widget.h
98
)
10-
11-
#catkin_lint: ignore_once missing_directory
12-
include_directories(${CMAKE_CURRENT_BINARY_DIR})
13-
14-
# Plugin Source
15-
set(SOURCE_FILES
9+
set(SOURCE_FILES_CORE
1610
src/handeye_calibration_display.cpp
1711
src/handeye_calibration_frame.cpp
18-
src/handeye_target_widget.cpp
1912
src/handeye_context_widget.cpp
2013
src/handeye_control_widget.cpp
14+
src/handeye_target_widget.cpp
15+
)
16+
set(SOURCE_FILES_PLUGINS
17+
src/plugin_init.cpp
2118
)
2219

23-
set(MOVEIT_LIB_NAME moveit_handeye_calibration_rviz_plugin)
24-
add_library(${MOVEIT_LIB_NAME}_core ${SOURCE_FILES} ${HEADERS})
20+
# Qt Stuff
21+
find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets)
22+
set(QT_LIBRARIES Qt5::Widgets)
23+
macro(qt_wrap_ui)
24+
qt5_wrap_ui(${ARGN})
25+
endmacro()
26+
27+
set(CMAKE_AUTOMOC ON)
28+
set(CMAKE_AUTOUIC ON)
29+
set(CMAKE_AUTORCC ON)
30+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
31+
add_definitions(-DQT_NO_KEYWORDS)
32+
33+
# Core library
34+
# TODO: Remove headers from moveit_handeye_calibration_rviz_plugin library compilation
35+
add_library(${MOVEIT_LIB_NAME}_core SHARED ${SOURCE_FILES_CORE} ${HEADERS})
2536
set_target_properties(${MOVEIT_LIB_NAME}_core PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
26-
target_link_libraries(${MOVEIT_LIB_NAME}_core
27-
${catkin_LIBRARIES} ${OpenCV_LIBS} ${rviz_DEFAULT_PLUGIN_LIBRARIES} ${OGRE_LIBRARIES} ${QT_LIBRARIES} ${Boost_LIBRARIES})
37+
target_link_libraries(${MOVEIT_LIB_NAME}_core ${OpenCV_LIBS})
38+
target_include_directories(${MOVEIT_LIB_NAME}_core PUBLIC
39+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
40+
$<INSTALL_INTERFACE:include>)
41+
ament_target_dependencies(
42+
${MOVEIT_LIB_NAME}_core
43+
${THIS_PACKAGE_INCLUDE_DEPENDS}
44+
)
2845

29-
add_library(${MOVEIT_LIB_NAME} src/plugin_init.cpp)
46+
# Plugin library
47+
add_library(${MOVEIT_LIB_NAME} SHARED ${SOURCE_FILES_PLUGINS})
3048
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
31-
target_link_libraries(${MOVEIT_LIB_NAME} ${MOVEIT_LIB_NAME}_core ${catkin_LIBRARIES} ${Boost_LIBRARIES})
49+
target_link_libraries(${MOVEIT_LIB_NAME} ${MOVEIT_LIB_NAME}_core)
50+
target_include_directories(${MOVEIT_LIB_NAME} PUBLIC
51+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
52+
$<INSTALL_INTERFACE:include>)
53+
ament_target_dependencies(
54+
${MOVEIT_LIB_NAME}
55+
pluginlib
56+
)
3257

33-
install(DIRECTORY include/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})
58+
install(DIRECTORY include/ DESTINATION include)
59+
install(
60+
TARGETS ${MOVEIT_LIB_NAME}_core ${MOVEIT_LIB_NAME}
61+
EXPORT export_${PROJECT_NAME}
62+
ARCHIVE DESTINATION lib
63+
LIBRARY DESTINATION lib
64+
RUNTIME DESTINATION bin
65+
)
3466

35-
install(TARGETS ${MOVEIT_LIB_NAME} ${MOVEIT_LIB_NAME}_core
36-
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
37-
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
67+
ament_export_include_directories(
68+
include
69+
)
70+
ament_export_libraries(
71+
{MOVEIT_LIB_NAME}_core {MOVEIT_LIB_NAME}
72+
)

0 commit comments

Comments
 (0)