Skip to content

Commit

Permalink
Merge branch 'master' into pr-moveit-clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Aug 29, 2024
2 parents edb0c9b + d11a9bd commit f058c67
Show file tree
Hide file tree
Showing 31 changed files with 715 additions and 306 deletions.
2 changes: 1 addition & 1 deletion .ci.prepare_codecov
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lcov --extract coverage.info "$BASEDIR/target_ws/src/$TARGET_REPO_NAME/*" --outp
echo -e "${BLUE}Filter out test files${NOCOLOR}"
lcov --remove coverage.info '*/test/*' --output-file coverage.info

echo -e "${BLUE}Output coverage data for debugging${NOCOLOR}"
echo -e "${BLUE}Output coverage data for debugging${NOCOLOR}"
lcov --list coverage.info

popd
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: CI

on: [push, pull_request]

jobs:
default:
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
steps:
- uses: actions/checkout@v4
- name: cache upstream_ws
uses: actions/cache@v4
with:
save-always: true
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') }}
- name: cache ccache
uses: actions/cache@v4
with:
save-always: true
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 }}
- 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
20 changes: 20 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action

name: Format

on:
workflow_dispatch:
pull_request:
push:

jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install clang-format-10
run: sudo apt-get install clang-format-10
- uses: rhaschke/[email protected]
- uses: pre-commit/[email protected]
20 changes: 0 additions & 20 deletions .github/workflows/format.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/industrial_ci_action.yml

This file was deleted.

11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

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

Expand All @@ -50,3 +51,11 @@ 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
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

*Tools for robot arm hand-eye calibration.*

This repository is still in experiemental status. It has been developed and tested on ROS Melodic. It has not been
tested on earlier ROS versions.
| **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. |

OpenCV 3.2, which is the version in Ubuntu 18.04, has a buggy ArUco board pose detector. It is recommended that you
upgrade to OpenCV 3.4, or use a ChArUco board.
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.

For full discussion of the ongoing effort from Yu Yan @ Intel, see this [Github
discussion](https://github.com/ros-planning/moveit/issues/1070).
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).

## GitHub Actions - Continuous Integration

[![Format](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yml?branch=master) [![BuildAndTest](https://github.com/ros-planning/moveit_calibration/actions/workflows/industrial_ci_action.yml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_calibration/actions/workflows/industrial_ci_action.yml?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=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)
9 changes: 2 additions & 7 deletions moveit_calibration_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
cmake_minimum_required(VERSION 3.1.3)
project(moveit_calibration_gui)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)

if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

find_package(catkin REQUIRED COMPONENTS
class_loader
cv_bridge
Expand All @@ -30,6 +23,8 @@ find_package(catkin REQUIRED COMPONENTS

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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
find_package(OpenCV REQUIRED)
find_package(OpenCV REQUIRED)

set(HEADERS
include/moveit/handeye_calibration_rviz_plugin/handeye_calibration_gui.h
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
Expand All @@ -12,7 +13,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})

# Plugin Source
set(SOURCE_FILES
src/handeye_calibration_gui.cpp
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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, Intel Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/

/* Author: Yu Yan */

#pragma once

// ros
#include <rviz_visual_tools/tf_visual_tools.h>

// local
#include <moveit/handeye_calibration_rviz_plugin/handeye_calibration_frame.h>

#ifndef Q_MOC_RUN
#include <ros/ros.h>
#include <rviz/display.h>
#include <rviz/panel_dock_widget.h>
#include <rviz/properties/property.h>
#include <rviz/properties/float_property.h>
#include <rviz/properties/ros_topic_property.h>
#include <rviz/properties/string_property.h>
#endif

namespace moveit_rviz_plugin
{
class HandEyeCalibrationDisplay : public rviz::Display
{
Q_OBJECT
public:
explicit HandEyeCalibrationDisplay(QWidget* parent = 0);
~HandEyeCalibrationDisplay() override;

void load(const rviz::Config& config) override;
void save(rviz::Config config) const override;

rviz::StringProperty* move_group_ns_property_;
rviz::RosTopicProperty* planning_scene_topic_property_;
rviz::BoolProperty* fov_marker_enabled_property_;
rviz::FloatProperty* fov_marker_alpha_property_;
rviz::FloatProperty* fov_marker_size_property_;

private Q_SLOTS:

// ******************************************************************************************
// Slot Event Functions
// ******************************************************************************************
void fillPlanningGroupNameComboBox();
void updateMarkers();

protected:
void onInitialize() override;

private:
rviz::PanelDockWidget* frame_dock_;
HandEyeCalibrationFrame* frame_;
};

} // namespace moveit_rviz_plugin
Loading

0 comments on commit f058c67

Please sign in to comment.