diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60652b3..cb0055c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 diff --git a/.github/workflows/industrial-ci.yml b/.github/workflows/industrial-ci.yml index 3a080a9..28c3c07 100644 --- a/.github/workflows/industrial-ci.yml +++ b/.github/workflows/industrial-ci.yml @@ -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 <`_) diff --git a/package.xml b/package.xml index b1ed11c..6f63fbe 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ ur_client_library - 1.3.6 + 1.3.7 Standalone C++ library for accessing Universal Robots interfaces. This has been forked off the ur_robot_driver. Thomas Timm Andersen Simon Rasmussen diff --git a/scripts/start_ursim.sh b/scripts/start_ursim.sh index 349e430..0da735a 100755 --- a/scripts/start_ursim.sh +++ b/scripts/start_ursim.sh @@ -43,7 +43,7 @@ help() See https://hub.docker.com/r/universalrobots/ursim_e-series/tags for available versions. Defaults to 'latest'" echo " -p 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 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" @@ -51,11 +51,9 @@ 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 @@ -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() @@ -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" @@ -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 } @@ -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 @@ -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}"