Skip to content
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
56 changes: 5 additions & 51 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,13 @@ name: CI
on: [push, pull_request]

jobs:
default:
industrial_ci:
strategy:
fail-fast: false
matrix:
env:
- IMAGE: noetic
CATKIN_LINT: true
CCOV: true
env:
DOCKER_IMAGE: 'moveit/moveit:${{ matrix.env.IMAGE }}-release'
AFTER_RUN_TARGET_TEST: ${{ matrix.env.CCOV && './.ci.prepare_codecov' || '' }}
TARGET_CMAKE_ARGS: >
-DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'RelWithDebInfo' || 'Release'}}
${{ matrix.env.CCOV && '-DCMAKE_CXX_FLAGS="--coverage" --no-warn-unused-cli' || '' }}
CCACHE_DIR: "${{ github.workspace }}/.ccache"
BASEDIR: ${{ github.workspace }}/.work
CACHE_PREFIX: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}"
CLANG_TIDY_BASE_REF: "${{ github.base_ref || github.ref }}"

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' || '' }}"
runs-on: ubuntu-latest
- {ROS_DISTRO: jazzy, ROS_REPO: main}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: cache upstream_ws
uses: rhaschke/cache@main
with:
path: ${{ env.BASEDIR }}/upstream_ws
key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.rosinstall') }}-${{ github.run_id }}
restore-keys: |
upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.rosinstall') }}
env:
GHA_CACHE_SAVE: always
- name: cache ccache
uses: rhaschke/cache@main
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
ccache-${{ env.CACHE_PREFIX }}
env:
GHA_CACHE_SAVE: always
- name: industrial_ci
uses: ros-industrial/industrial_ci@master
env: ${{ matrix.env }}
- name: upload test artifacts (on failure)
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
- name: upload codecov report
uses: codecov/codecov-action@v4
if: ${{ matrix.env.CCOV }}
with:
files: ${{ env.BASEDIR }}/coverage.info
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
16 changes: 4 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -29,7 +29,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black

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

- repo: local
hooks:
Expand All @@ -51,11 +51,3 @@ repos:
language: pygrep
entry: Moveit|MoveIt!
exclude: .pre-commit-config.yaml|README.md

- id: catkin_lint
name: catkin_lint
description: Check package.xml and cmake files
entry: catkin_lint .
language: system
always_run: true
pass_filenames: false
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,32 @@

*Tools for robot arm hand-eye calibration.*

| **Warning to Melodic users** |
| --- |
| 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. |

MoveIt Calibration supports ArUco boards and ChArUco boards as calibration targets. Experiments have demonstrated that a
ChArUco board gives more accurate results, so it is recommended.

This repository has been developed and tested on ROS Melodic and Noetic. It has not been tested on earlier ROS versions.
When building `moveit_calibration` on ROS Melodic, `rviz_visual_tools` must also be built from source.

This package was originally developed by Dr. Yu Yan at Intel, and was originally submitted as a PR to the core MoveIt
repository. For background, see this [Github discussion](https://github.com/ros-planning/moveit/issues/1070).

## Instructions

### Build from Source

```sh
mkdir -p ws_moveit/src
cd ws_moveit
git clone https://github.com/ros-planning/moveit_calibration.git -b ros2 src/moveit_calibration
vcs import src < src/moveit_calibration/moveit_calibration.repos --skip-existing
rosdep install -r --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
```

### Example

<!-- TODO: Update tutorial link for website once available -->
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).

## GitHub Actions - Continuous Integration

[![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)
[![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)
[![codecov](https://codecov.io/gh/ros-planning/moveit_calibration/branch/master/graph/badge.svg?token=W7uHKcY0ly)](https://codecov.io/gh/ros-planning/moveit_calibration)
[![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)
[![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)
[![codecov](https://codecov.io/gh/ros-planning/moveit_calibration/branch/ros2/graph/badge.svg?token=W7uHKcY0ly)](https://codecov.io/gh/ros-planning/moveit_calibration)
10 changes: 9 additions & 1 deletion moveit_calibration_gui/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog for package moveit_calibration_gui
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.1.0 (forthcoming)
2.0.0 (forthcoming)
-----------
* First public release for ROS 2

0.1.1
-----------
* Calculate and report reprojection error

0.1.0
-----------
* First public release for Noetic
110 changes: 43 additions & 67 deletions moveit_calibration_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,83 +1,59 @@
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.10.2)

# Silence CMP0167 warnings from downstream packages (MoveIt, geometric_shapes, etc.)
if(POLICY CMP0167)
cmake_policy(SET CMP0167 OLD)
endif()

project(moveit_calibration_gui)

find_package(catkin REQUIRED COMPONENTS
class_loader
# Common cmake code applied to all moveit packages
find_package(moveit_common REQUIRED)
moveit_package()

# find dependencies
find_package(ament_cmake_ros REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(eigen3_cmake_module REQUIRED)
find_package(image_geometry REQUIRED)
find_package(image_transport REQUIRED)
find_package(moveit_calibration_plugins REQUIRED)
find_package(moveit_ros_visualization REQUIRED)
find_package(moveit_ros_planning_interface REQUIRED)
find_package(moveit_visual_tools REQUIRED)
find_package(OpenCV REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rviz_common REQUIRED)
find_package(rviz_visual_tools REQUIRED)
find_package(tf2_eigen REQUIRED)

set(THIS_PACKAGE_INCLUDE_DEPENDS
cv_bridge
geometric_shapes
Eigen3
image_geometry
image_transport
moveit_calibration_plugins
moveit_core
moveit_ros_perception
moveit_ros_planning
moveit_ros_planning_interface
moveit_ros_visualization
moveit_ros_planning_interface
moveit_visual_tools
pluginlib
rosconsole
roscpp
rviz
rclcpp
rviz_common
rviz_visual_tools
tf2_eigen
)

find_package(Eigen3 REQUIRED)

moveit_build_options()

# Qt Stuff
if(rviz_QT_VERSION VERSION_LESS "5")
find_package(Qt4 ${rviz_QT_VERSION} REQUIRED QtCore QtGui)
include(${QT_USE_FILE})
macro(qt_wrap_ui)
qt4_wrap_ui(${ARGN})
endmacro()
else()
find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets)
set(QT_LIBRARIES Qt5::Widgets)
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
add_definitions(-DQT_NO_KEYWORDS)

catkin_package(
LIBRARIES
moveit_handeye_calibration_rviz_plugin_core
INCLUDE_DIRS
handeye_calibration_rviz_plugin/include
CATKIN_DEPENDS
moveit_calibration_plugins
moveit_core
moveit_ros_perception
moveit_ros_planning
moveit_ros_planning_interface
moveit_visual_tools
roscpp
rviz
rviz_visual_tools
DEPENDS
EIGEN3
)

include_directories(
handeye_calibration_rviz_plugin/include
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS})

include_directories(SYSTEM
${EIGEN3_INCLUDE_DIRS}
${QT_INCLUDE_DIR})

# Add project sub-libraries
add_subdirectory(handeye_calibration_rviz_plugin)

install(FILES
# Export plugin descriptions to register with pluginlib
pluginlib_export_plugin_description_file(
rviz_common
handeye_calibration_rviz_plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
)

if (CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
endif()
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
Original file line number Diff line number Diff line change
@@ -1,37 +1,72 @@
find_package(OpenCV REQUIRED)

set(MOVEIT_LIB_NAME moveit_handeye_calibration_rviz_plugin)
set(HEADERS
include/moveit/handeye_calibration_rviz_plugin/handeye_calibration_display.h
include/moveit/handeye_calibration_rviz_plugin/handeye_calibration_frame.h
include/moveit/handeye_calibration_rviz_plugin/handeye_target_widget.h
include/moveit/handeye_calibration_rviz_plugin/handeye_context_widget.h
include/moveit/handeye_calibration_rviz_plugin/handeye_control_widget.h
include/moveit/handeye_calibration_rviz_plugin/handeye_target_widget.h
)

#catkin_lint: ignore_once missing_directory
include_directories(${CMAKE_CURRENT_BINARY_DIR})

# Plugin Source
set(SOURCE_FILES
set(SOURCE_FILES_CORE
src/handeye_calibration_display.cpp
src/handeye_calibration_frame.cpp
src/handeye_target_widget.cpp
src/handeye_context_widget.cpp
src/handeye_control_widget.cpp
src/handeye_target_widget.cpp
)
set(SOURCE_FILES_PLUGINS
src/plugin_init.cpp
)

set(MOVEIT_LIB_NAME moveit_handeye_calibration_rviz_plugin)
add_library(${MOVEIT_LIB_NAME}_core ${SOURCE_FILES} ${HEADERS})
# Qt Stuff
find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets)
set(QT_LIBRARIES Qt5::Widgets)
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_definitions(-DQT_NO_KEYWORDS)

# Core library
# TODO: Remove headers from moveit_handeye_calibration_rviz_plugin library compilation
add_library(${MOVEIT_LIB_NAME}_core SHARED ${SOURCE_FILES_CORE} ${HEADERS})
set_target_properties(${MOVEIT_LIB_NAME}_core PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
target_link_libraries(${MOVEIT_LIB_NAME}_core
${catkin_LIBRARIES} ${OpenCV_LIBS} ${rviz_DEFAULT_PLUGIN_LIBRARIES} ${OGRE_LIBRARIES} ${QT_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(${MOVEIT_LIB_NAME}_core ${OpenCV_LIBS})
target_include_directories(${MOVEIT_LIB_NAME}_core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(
${MOVEIT_LIB_NAME}_core
${THIS_PACKAGE_INCLUDE_DEPENDS}
)

add_library(${MOVEIT_LIB_NAME} src/plugin_init.cpp)
# Plugin library
add_library(${MOVEIT_LIB_NAME} SHARED ${SOURCE_FILES_PLUGINS})
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
target_link_libraries(${MOVEIT_LIB_NAME} ${MOVEIT_LIB_NAME}_core ${catkin_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(${MOVEIT_LIB_NAME} ${MOVEIT_LIB_NAME}_core)
target_include_directories(${MOVEIT_LIB_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(
${MOVEIT_LIB_NAME}
pluginlib
)

install(DIRECTORY include/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})
install(DIRECTORY include/ DESTINATION include)
install(
TARGETS ${MOVEIT_LIB_NAME}_core ${MOVEIT_LIB_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

install(TARGETS ${MOVEIT_LIB_NAME} ${MOVEIT_LIB_NAME}_core
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
ament_export_include_directories(
include
)
ament_export_libraries(
{MOVEIT_LIB_NAME}_core {MOVEIT_LIB_NAME}
)
Loading
Loading