Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4197aa2
.github: Fix included branch glob
zultron Feb 3, 2021
5c92ccb
Use the first matching COMP_DIR instance when searching LD_LIBRARY_PATH
Dec 29, 2020
2be7a5e
Add __pycache__ to gitignore
Nov 19, 2020
0f5b36c
hal_hw_interface: Don't hide GenericHWInterface init function
Nov 20, 2020
08b1bf8
Make shutdown configurable with callbacks in python components
zultron Jan 30, 2021
0ad15df
Remove duplicate rospy.get_param wrapper
zultron Jan 30, 2021
2f53077
hal_hw_interface: Rework RedisStoreHalPin
zultron Jan 30, 2021
ed8cef9
ros_hal_pin.py: Fix publisher
zultron May 18, 2021
b9e10b6
.pre-commit-config: Tweaks & update
zultron May 18, 2021
f42f02e
Run auto-formatters & fix problems
zultron May 18, 2021
da1b7c6
Silence CMake CMP0048 warnings
zultron May 19, 2021
66a41e2
Add CMake & python to build and load HAL comps from other packages
zultron May 21, 2021
e34bf5d
hal_hw_interface: Move code out of constructor & check for failures
zultron May 18, 2021
bd8ab26
.github: Migrate to industrial_ci
zultron Sep 18, 2021
65d8642
hal_hw_interface: Add `python3-mock` test dep to packaging
zultron Sep 20, 2021
8cbb280
hal_hw_interface: Fix unit tests
zultron Sep 20, 2021
8050fcc
Fix `catkin lint` errors
zultron Sep 20, 2021
d3f8bcb
Fix CI on Melodic
zultron Sep 20, 2021
f7253df
Add changes from pre-commit hooks
zultron Sep 20, 2021
91cad7c
Update formatter rules
zultron Sep 20, 2021
141853c
Commit changes after formatter rule adjustment
zultron Sep 20, 2021
ec1a869
hal_mgr: Log missing HAL files as errors
zultron Oct 26, 2021
3583249
hal_rrbot_control: Remove `xacro --inorder` arg
zultron Oct 26, 2021
2e7b56d
Fix shfmt formatter installation
zultron Oct 26, 2021
227db47
Fix log string formatting
zultron Nov 5, 2021
e7a9fcc
Change include paths to new mk-hal cmake structure
the-snowwhite Jan 8, 2023
b3faace
change python module import paths to new cmake paths
the-snowwhite Jan 8, 2023
aeffeaa
change python module import paths to new cmake paths
the-snowwhite Jan 8, 2023
3b90bd9
Merge branch 'noetic-devel' of github.com:the-snowwhite/hal_ros_contr…
the-snowwhite Jan 9, 2023
9eff4d7
remedy for missing config module
the-snowwhite Jan 9, 2023
2d10095
Merge branch 'noetic-devel' of github.com:the-snowwhite/hal_ros_contr…
the-snowwhite Jan 9, 2023
54b8673
Fix import hal paths
the-snowwhite Jan 10, 2023
10ec5e5
fix typo
the-snowwhite Jan 10, 2023
1943ccd
update readme
the-snowwhite Jan 10, 2023
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
4 changes: 1 addition & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
Expand Down Expand Up @@ -51,7 +50,7 @@ SpaceAfterCStyleCast: false
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
BraceWrapping:
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
Expand All @@ -62,5 +61,4 @@ BraceWrapping: {
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
...
11 changes: 2 additions & 9 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
[flake8]
# E501: line-length checking, handled by black
# E203: space after :, not PEP8 compliant
# W503: no operator after line break, not PEP8 compliant
ignore = E501, E203, W503
exclude =
# ignore templates
src/robot_ui/src/pathpilot/robot/program/templates/*
# ignore example programs
src/robot_command/examples/programs/*
# ignore playground files
src/robot_command/playground/*
ignore = E203, W503
max-line-length = 80
22 changes: 11 additions & 11 deletions .github/docker/script_pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ ROS_DISTRO=noetic
# Add package repos needed to build linuxcnc-ethercat
# - IgH EtherLab Master
curl -1sLf \
'https://dl.cloudsmith.io/public/zultron/etherlabmaster/cfg/setup/bash.deb.sh' \
| bash
'https://dl.cloudsmith.io/public/zultron/etherlabmaster/cfg/setup/bash.deb.sh' |
bash
# - redis_store
curl -1sLf \
'https://dl.cloudsmith.io/public/zultron/hal_ros_control/cfg/setup/bash.deb.sh' \
| bash
'https://dl.cloudsmith.io/public/zultron/hal_ros_control/cfg/setup/bash.deb.sh' |
bash
# - Machinekit
curl -1sLf \
'https://dl.cloudsmith.io/public/machinekit/machinekit-hal/cfg/setup/bash.deb.sh' \
| bash
'https://dl.cloudsmith.io/public/machinekit/machinekit-hal/cfg/setup/bash.deb.sh' |
bash

# Bootstrap ROS installation
# http://wiki.ros.org/noetic/Installation/Source

echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" \
> /etc/apt/sources.list.d/ros-latest.list
>/etc/apt/sources.list.d/ros-latest.list
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' \
--recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt-get update

pip3 install -U \
vcstool \
rosdep \
rosinstall-generator \
rosinstall-generator

apt-get install -y \
build-essential

# Custom rosdep keys
mkdir -p /etc/ros/rosdep/sources.list.d
cat > /etc/ros/rosdep/machinekit-rosdep.yaml <<EOF
cat >/etc/ros/rosdep/machinekit-rosdep.yaml <<EOF
machinekit:
debian: [machinekit-hal]
ubuntu: [machinekit-hal]
Expand All @@ -55,7 +55,7 @@ redis_store:
debian: [ros-$ROS_DISTRO-redis-store]
ubuntu: [ros-$ROS_DISTRO-redis-store]
EOF
cat > /etc/ros/rosdep/sources.list.d/10-local.list <<EOF
cat >/etc/ros/rosdep/sources.list.d/10-local.list <<EOF
yaml file:///etc/ros/rosdep/machinekit-rosdep.yaml
EOF

Expand All @@ -64,7 +64,7 @@ rosdep update

# https://gist.github.com/awesomebytes/196eab972a94dd8fcdd69adfe3bd1152
pip3 install -U \
bloom
bloom
source /etc/os-release
mv files/hal_hw_interface/package.xml .
bloom-generate rosdebian --os-name $ID --os-version $VERSION_CODENAME \
Expand Down
5 changes: 1 addition & 4 deletions .github/local-env-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
#
# DO NOT COMMIT THIS TO GIT. It stores sensitive secrets.

# GitHub user/organization and repository name
DOCKER_REGISTRY_USER: my_github_id
DOCKER_REGISTRY_REPO: my_github_repo

# Docker registry settings
#
# docker.pkg.github.com registry needs API key
# https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages
DOCKER_REGISTRY_URL: https://docker.pkg.github.com
DOCKER_REGISTRY_USER: my_github_id
DOCKER_REGISTRY_REPO: my_github_repo
# DANGER: Putting a password in this script is dangerous! Look for a
# more secure way to set this environment variable.
#DOCKER_REGISTRY_PASSWORD: adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/catkin_tools_devel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Custome BUILDER to build in devel-space only

BUILDER=catkin_tools ici_source_builder

function ici_extend_space {
echo "$1/devel"
}

function _catkin_config {
local extend=$1
shift
local ws=$1
shift
ici_exec_in_workspace "$extend" "$ws" catkin config --init
}
196 changes: 79 additions & 117 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,130 +1,92 @@
name: Build CI
# 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:
branches:
- '*'
workflow_dispatch:
pull_request:
push:
branches:
- '*'
- master
- "*-devel"

jobs:

######################################################################################
prepareState:
name: Prepare build inputs
runs-on: ubuntu-latest
outputs:
GithubRegistryURL: ${{ steps.build_inputs.outputs.GithubRegistryURL }}
HasCloudsmithAPIKey: ${{ steps.build_inputs.outputs.HasCloudsmithAPIKey }}
MainMatrix: ${{ steps.build_inputs.outputs.MainMatrix }}
Timestamp: ${{ steps.build_inputs.outputs.Timestamp }}

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Install Python for build scripts
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install script dependencies
uses: zultron/machinekit_ci/actions/initDeps@v1

- name: Prepare build inputs
id: build_inputs
uses: zultron/machinekit_ci/actions/prepareState@v1
with:
CloudsmithAPIKey: ${{ secrets.CLOUDSMITH_API_KEY }}

######################################################################################
buildPackages:
name: >
Package ${{ matrix.vendor }} ${{ matrix.codename }}, ${{ matrix.architecture }}
runs-on: ubuntu-latest
needs: prepareState
default:
strategy:
matrix: ${{ fromJson(needs.prepareState.outputs.MainMatrix) }}
fail-fast: false

steps:
- name: Clone git repository
uses: actions/checkout@v2

- name: Prepare specific Python version for build scripts
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install script dependencies
uses: zultron/machinekit_ci/actions/initDeps@v1

- name: Pull or build Docker image
id: docker_image
uses: zultron/machinekit_ci/actions/dockerImage@v1
with:
codename: ${{ matrix.codename }}
architecture: ${{ matrix.architecture }}
dockerRegistryURL: ${{ needs.prepareState.outputs.GithubRegistryURL }}
dockerRegistryRepo: ${{ github.event.repository.name }}
dockerRegistryUser: ${{ github.actor }}
dockerRegistryPassword: ${{ secrets.GITHUB_TOKEN }}

- name: Build and sign packages
id: build_packages
uses: zultron/machinekit_ci/actions/buildPackages@v1
with:
codename: ${{ matrix.codename }}
architecture: ${{ matrix.architecture }}
dockerRegistryURL: ${{ needs.prepareState.outputs.GithubRegistryURL }}
dockerRegistryRepo: ${{ github.event.repository.name }}
dockerRegistryUser: ${{ github.actor }}
packageSigningKey: ${{ secrets.PACKAGE_SIGNING_KEY }}
uploadDirectory: ${{ github.event.repository.name }}-${{ matrix.vendorLower }}

- name: >
Upload package artifacts ${{ matrix.vendor }}
${{ matrix.codename}}, ${{ matrix.architecture }}
uses: actions/upload-artifact@v2
env:
NAME_BASE: ${{ matrix.artifactNameBase }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REPO: ${{ github.event.repository.name }}
TIMESTAMP: ${{ needs.prepareState.outputs.Timestamp }}
with:
name: ${{ env.NAME_BASE }}-${{ env.GITHUB_SHA }}-${{ env.TIMESTAMP }}
path: ${{ github.event.repository.name }}-${{ matrix.vendorLower }}
if-no-files-found: error

######################################################################################
uploadDebianPackagesToCloudsmith:
name: Push packages to Cloudsmith
matrix:
env:
- IMAGE: noetic-ci
BUILDER: .github/workflows/catkin_tools_devel.sh
- IMAGE: noetic-ci-shadow-fixed
CATKIN_LINT: true
CLANG_TIDY: pedantic
env:
DOCKER_IMAGE: moveit/moveit:${{ matrix.env.IMAGE }}
UPSTREAM_WORKSPACE: .github/workflows/upstream.rosinstall
BEFORE_SETUP_UPSTREAM_WORKSPACE: .github/workflows/upstream_install.sh

TARGET_CMAKE_ARGS: >
-DCMAKE_BUILD_TYPE=Release'
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS"
CCACHE_DIR: ${{ github.workspace }}/.ccache
BASEDIR: ${{ github.workspace }}/.work
CLANG_TIDY_BASE_REF: ${{ github.base_ref || github.ref }}
BEFORE_CLANG_TIDY_CHECKS: (cd $TARGET_REPO_PATH; clang-tidy --list-checks)
BUILDER: ${{ matrix.env.BUILDER || 'catkin_tools' }}
CC: ${{ matrix.env.CLANG_TIDY && 'clang' }}
CXX: ${{ matrix.env.CLANG_TIDY && 'clang++' }}

name: "${{ matrix.env.IMAGE }}${{ matrix.env.CATKIN_LINT && ' + catkin_lint' || ''}}${{ matrix.env.CLANG_TIDY && ' + clang-tidy' || '' }}"
runs-on: ubuntu-latest
if: >
needs.prepareState.outputs.HasCloudsmithAPIKey == 'true' &&
github.event_name == 'push'
needs: [prepareState, buildPackages]

steps:
- name: Clone git repository
uses: actions/checkout@v2

- name: Prepare specific Python version for Cloudsmith CLI
uses: actions/setup-python@v2
- uses: actions/checkout@v2
- name: cache upstream workspace
uses: pat-s/always-upload-cache@v2.1.5
with:
python-version: '3.8'

- name: Install script dependencies
uses: zultron/machinekit_ci/actions/initDeps@v1

- name: Download all built artifacts from GitHub storage
uses: actions/download-artifact@v2
path: ${{ env.BASEDIR }}/upstream_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
env:
CACHE_PREFIX: upstream_ws-${{ matrix.env.IMAGE }}-${{ hashFiles('.github/workflows/upstream.rosinstall', '.github/workflows/ci.yaml') }}
# The target directory cache doesn't include the source directory because
# that comes from the checkout. See "prepare target_ws for cache" task below
- name: cache target workspace
uses: pat-s/always-upload-cache@v2.1.5
with:
path: ./artifacts

- name: Upload packages to Cloudsmith
uses: zultron/machinekit_ci/actions/pushCloudsmith@v1
path: ${{ env.BASEDIR }}/target_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
env:
CACHE_PREFIX: target_ws-${{ matrix.env.IMAGE }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml', '.github/workflows/ci.yaml') }}
- name: cache ccache
uses: pat-s/always-upload-cache@v2.1.5
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
${{ env.CACHE_PREFIX }}-${{ github.sha }}
${{ env.CACHE_PREFIX }}
env:
CACHE_PREFIX: ccache-${{ matrix.env.IMAGE }}

- id: industrial_ci
uses: ros-industrial/industrial_ci@master
env: ${{ matrix.env }}

- name: upload test artifacts (on failure)
uses: actions/upload-artifact@v2
if: steps.industrial_ci.outcome != 'success'
with:
cloudsmithAPIKey: ${{ secrets.CLOUDSMITH_API_KEY }}
artifactDirectory: ./artifacts
name: test-results-${{ matrix.env.IMAGE }}
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
- name: prepare target_ws for cache
if: ${{ always() }}
run: |
du -sh ${{ env.BASEDIR }}/target_ws
sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
du -sh ${{ env.BASEDIR }}/target_ws
Loading