Skip to content

Commit

Permalink
Rebase from 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch committed Jun 3, 2024
1 parent 5df9cc2 commit e36262b
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 112 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest
name: build (${{matrix.env.URSIM_VERSION}}-${{matrix.env.ROBOT_MODEL}})
strategy:
matrix:
env:
Expand Down Expand Up @@ -34,9 +35,9 @@ jobs:
- name: configure
run: mkdir build && cd build && cmake .. -DBUILDING_TESTS=1 -DINTEGRATION_TESTS=1 -DWITH_ASAN=ON
env:
CXXFLAGS: -g -O2 -fprofile-arcs -ftest-coverage
CFLAGS: -g -O2 -fprofile-arcs -ftest-coverage
LDFLAGS: -fprofile-arcs -ftest-coverage
CXXFLAGS: -g -O2 -fprofile-arcs -ftest-coverage
CFLAGS: -g -O2 -fprofile-arcs -ftest-coverage
LDFLAGS: -fprofile-arcs -ftest-coverage
- name: build
run: cmake --build build --config Debug
- name: Create folder for test artifacts
Expand Down
113 changes: 22 additions & 91 deletions .github/workflows/industrial-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,100 +2,31 @@ name: ROS industrial ci
on: [push, pull_request]

jobs:
build:
industrial_ci:
name: ${{matrix.ROS_DISTRO.NAME}}, ${{matrix.ROS_REPO}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
- ROS_DISTRO: melodic
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS_Driver#master https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS_Driver/master/.melodic.rosinstall"
DOCKER_RUN_OPTS: --network ursim_net
BEFORE_INIT: 'apt-get update -qq && apt-get install -y iproute2 iputils-ping && ip addr && ping -c5 192.168.56.101'
URSIM_VERSION: '5.9.4'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROS_DISTRO: noetic
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS_Driver#master https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS_Driver/master/.noetic.rosinstall"
BUILDER: catkin_tools
DOCKER_RUN_OPTS: --network ursim_net
BEFORE_INIT: 'apt-get update -qq && apt-get install -y iproute2 iputils-ping && ip addr && ping -c5 192.168.56.101'
URSIM_VERSION: '5.9.4'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROS_DISTRO: galactic
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#galactic"
DOCKER_RUN_OPTS: --network ursim_net
BEFORE_INIT: 'apt-get update -qq && apt-get install -y iproute2 iputils-ping && ip addr && ping -c5 192.168.56.101'
URSIM_VERSION: '5.9.4'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
NOT_TEST_DOWNSTREAM: true
- ROS_DISTRO: humble
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#humble https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS2_Driver/humble/Universal_Robots_ROS2_Driver-not-released.humble.repos"
DOCKER_RUN_OPTS: --network ursim_net
BEFORE_INIT: 'apt-get update -qq && apt-get install -y iproute2 iputils-ping && ip addr && ping -c5 192.168.56.101'
URSIM_VERSION: '5.9.4'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
NOT_TEST_DOWNSTREAM: true
- ROS_DISTRO: iron
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#iron https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS2_Driver/iron/Universal_Robots_ROS2_Driver-not-released.iron.repos"
DOCKER_RUN_OPTS: --network ursim_net
BEFORE_INIT: 'apt-get update -qq && apt-get install -y iproute2 iputils-ping && ip addr && ping -c5 192.168.56.101'
URSIM_VERSION: '5.9.4'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
NOT_TEST_DOWNSTREAM: true
- ROS_DISTRO: rolling
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS2_Driver/main/Universal_Robots_ROS2_Driver-not-released.rolling.repos"
DOCKER_RUN_OPTS: --network ursim_net
BEFORE_INIT: 'apt-get update -qq && apt-get install -y iproute2 iputils-ping && ip addr && ping -c5 192.168.56.101'
URSIM_VERSION: '5.9.4'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
NOT_TEST_DOWNSTREAM: true

ROS_DISTRO:
- {NAME: noetic, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS_Driver#master https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS_Driver/master/.noetic.rosinstall"}
- {NAME: humble, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#humble"}
- {NAME: iron, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#iron"}
- {NAME: jazzy, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main"}
- {NAME: rolling, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main"}
ROS_REPO:
- main
- testing
env:
DOCKER_RUN_OPTS: '-v /var/run/docker.sock:/var/run/docker.sock --network ursim_net'
steps:
- uses: actions/checkout@v1
- name: start ursim
run: |
scripts/start_ursim.sh -m $ROBOT_MODEL -v $URSIM_VERSION -p $PROGRAM_FOLDER -d
env: ${{matrix.env}}
- uses: actions/checkout@v4
- run: docker network create --subnet=192.168.56.0/24 ursim_net
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
- name: Generate URSim log files
if: always()
run: |
nc -q 1 192.168.56.101 29999 <<END
saveLog
END
mkdir -p ursim_logs
docker cp ursim:/ursim/URControl.log ursim_logs/URControl.log
docker cp ursim:/ursim/polyscope.log ursim_logs/polyscope.log
docker cp ursim:/ursim/log_history.txt ursim_logs/log_history.txt
- name: Copy flight reports
if: failure()
run: |
mkdir -p ursim_logs/flightreports
docker cp ursim:/ursim/flightreports/. ursim_logs/flightreports/
- name: Upload logfiles
uses: actions/upload-artifact@v3
if: always()
with:
name: ${{matrix.env.ROS_DISTRO}}_${{matrix.env.URSIM_VERSION}}_URSim_Logs
path: ursim_logs
if-no-files-found: error
retention-days: 10
env:
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_CMAKE_ARGS: -DUR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS=ON
ADDITIONAL_DEBS: docker.io netcat-openbsd # Needed for integration tests
DOWNSTREAM_WORKSPACE: ${{matrix.ROS_DISTRO.DOWNSTREAM_WORKSPACE}}
ROS_DISTRO: ${{matrix.ROS_DISTRO.NAME}}
ROS_REPO: ${{matrix.ROS_REPO}}
10 changes: 8 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [humble, iron, rolling]
OS_VERSION: [jammy]
include:
- ROS_DISTRO: melodic
OS_VERSION: bionic
- ROS_DISTRO: noetic
OS_VERSION: focal
- ROS_DISTRO: humble
OS_VERSION: jammy
- ROS_DISTRO: iron
OS_VERSION: jammy
- ROS_DISTRO: jazzy
OS_VERSION: noble
- ROS_DISTRO: rolling
OS_VERSION: noble

steps:
- uses: actions/checkout@v1
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
Changelog for package ur_client_library
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.3.7 (2024-06-03)
------------------
* [ci] Update CI
* Run downstream tests for ICI
* Correctly name jobs
* Test Jazzy driver
* [start_ursim] Add program directory at correct location also when no model is provided
* [start_ursim] Always check ursim version for compatibility
* [start_ursim] Use a program folder per model
* [ci] Update distros for prerelease test
* Contributors: Felix Exner, Vincenzo Di Pentima

1.3.6 (2024-04-04)
------------------
* Changed spline interpolation to use the last commanded joint velocity… (`#195 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/195>`_)
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ur_client_library</name>
<version>1.3.6</version>
<version>1.3.7</version>
<description>Standalone C++ library for accessing Universal Robots interfaces. This has been forked off the ur_robot_driver.</description>
<author>Thomas Timm Andersen</author>
<author>Simon Rasmussen</author>
Expand Down
45 changes: 30 additions & 15 deletions scripts/start_ursim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,17 @@ help()
See https://hub.docker.com/r/universalrobots/ursim_e-series/tags
for available versions. Defaults to 'latest'"
echo " -p <folder> Location from which programs are read / to which programs are written.
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/programs"
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/${ROBOT_MODEL}/programs"
echo " -u <folder> Location from which URCaps are read / to which URCaps are written.
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/urcaps"
echo " -d Detached mode - start in backgound"
echo " -h Print this Help."
echo
}

ROBOT_MODEL=UR5
ROBOT_MODEL=ur5e
ROBOT_SERIES=e-series
URSIM_VERSION=latest
URCAP_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/urcaps"
PROGRAM_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/programs"
DETACHED=false


Expand All @@ -80,6 +78,8 @@ validate_model()
exit
;;
esac
URCAP_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/urcaps"
PROGRAM_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/${ROBOT_MODEL}/programs"
}

verlte()
Expand All @@ -89,7 +89,15 @@ verlte()

validate_ursim_version()
{
[ $URSIM_VERSION == "latest" ] && return 0
local IMAGE_URSIM_VERSION
# Inspect the image's URSim version if the image is locally available. This is especially
# important when we use the "latest" tag, as we don't know the version hiding behind this and it
# could be potentially older.
IMAGE_URSIM_VERSION=$(docker image inspect universalrobots/ursim_"${ROBOT_SERIES}":"$URSIM_VERSION" 2>/dev/null | grep -Po '"build_version": "URSim Version: \K[^"]*') || true
if [ -z "$IMAGE_URSIM_VERSION" ]; then
IMAGE_URSIM_VERSION="$URSIM_VERSION"
fi
[ "$IMAGE_URSIM_VERSION" == "latest" ] && return 0
local MIN_CB3="3.14.3"
local MIN_E_SERIES="5.9.4"
local MIN_UR20="5.14.0"
Expand All @@ -100,25 +108,25 @@ validate_ursim_version()

case $ROBOT_SERIES in
cb3)
verlte "4.0.0" $URSIM_VERSION && echo "$URSIM_VERSION is no valid CB3 version!" && exit
verlte $MIN_CB3 $URSIM_VERSION && return 0
verlte "4.0.0" "$IMAGE_URSIM_VERSION" && echo "$IMAGE_URSIM_VERSION is no valid CB3 version!" && exit
verlte "$MIN_CB3" "$IMAGE_URSIM_VERSION" && return 0
MIN_VERSION=$MIN_CB3
;;
e-series)
if [[ $ROBOT_MODEL == "UR20" ]]; then
verlte $MIN_UR20 $URSIM_VERSION && return 0
verlte "$MIN_UR20" "$IMAGE_URSIM_VERSION" && return 0
MIN_VERSION=$MIN_UR20
elif [[ $ROBOT_MODEL == "UR30" ]]; then
verlte $MIN_UR30 $URSIM_VERSION && return 0
verlte "$MIN_UR30" "$IMAGE_URSIM_VERSION" && return 0
MIN_VERSION=$MIN_UR30
else
verlte $MIN_E_SERIES $URSIM_VERSION && return 0
verlte "$MIN_E_SERIES" "$URSIM_VERSION" && return 0
MIN_VERSION=$MIN_E_SERIES
fi
;;
esac

echo "Illegal version given. Version must be greater or equal to $MIN_VERSION. Given version: $URSIM_VERSION."
echo "Illegal version given. For $ROBOT_SERIES $ROBOT_MODEL the software version must be greater or equal to $MIN_VERSION. Given version: $IMAGE_URSIM_VERSION."
exit
}

Expand All @@ -130,17 +138,15 @@ while getopts ":hm:v:p:u:d" option; do
exit;;
m) # robot model
ROBOT_MODEL=${OPTARG}
validate_model
;;
v) # ursim_version
URSIM_VERSION=${OPTARG}
validate_ursim_version
;;
p) # program_folder
PROGRAM_STORAGE=${OPTARG}
PROGRAM_STORAGE_ARG=${OPTARG}
;;
u) # urcaps_folder
URCAP_STORAGE=${OPTARG}
URCAP_STORAGE_ARG=${OPTARG}
;;
d) # detached mode
DETACHED=true
Expand All @@ -151,6 +157,15 @@ while getopts ":hm:v:p:u:d" option; do
exit;;
esac
done
validate_model
validate_ursim_version

if [ -n "$PROGRAM_STORAGE_ARG" ]; then
PROGRAM_STORAGE="$PROGRAM_STORAGE_ARG"
fi
if [ -n "$URCAP_STORAGE_ARG" ]; then
URCAP_STORAGE="$URCAP_STORAGE_ARG"
fi

# Create local storage for programs and URCaps
mkdir -p "${URCAP_STORAGE}"
Expand Down

0 comments on commit e36262b

Please sign in to comment.