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
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@ on: [push, pull_request]

jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
env:
- DOCKER_RUN_OPTS: --network static_test_net
- 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'
CTEST_OUTPUT_ON_FAILURE: 1
URSIM_VERSION: 3.14.1.1031110
- DOCKER_RUN_OPTS: --network static_test_net
ROBOT_MODEL: 'ur5'
URSIM_VERSION: '3.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/cb3'
- 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'
CTEST_OUTPUT_ON_FAILURE: 1
URSIM_VERSION: 5.8.0.10253
ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '5.5.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'

steps:
- uses: actions/checkout@v1
- name: start ursim
run: |
tests/resources/dockerursim/build_and_run_docker_ursim.sh $URSIM_VERSION
scripts/start_ursim.sh -m $ROBOT_MODEL -v $URSIM_VERSION -p $PROGRAM_FOLDER -d
env: ${{matrix.env}}
- name: install gtest
run: sudo apt-get install -y libgtest-dev
Expand All @@ -36,6 +41,8 @@ jobs:
run: cmake --build build --config Debug
- name: test
run: cd build && ctest --output-on-failure
- name: run examples
run: run-parts -v --exit-on-error -a "192.168.56.101" -a "1" ./build/examples
- name: install gcovr
run: sudo apt-get install -y gcovr
- name: gcovr
Expand All @@ -59,11 +66,11 @@ jobs:
--exclude-dir=CMakeModules \
--exclude=tcp_socket.cpp \
--exclude-dir=debian \
--exclude=real_time.md
--exclude=real_time.md \
--exclude=start_ursim.sh

rosdoc_lite_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./.github/actions/rosdoc_lite_action

38 changes: 25 additions & 13 deletions .github/workflows/industrial-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,67 @@ jobs:
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 static_test_net
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.8.0.10253
URSIM_VERSION: '5.5.1'
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 static_test_net
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.8.0.10253
URSIM_VERSION: '5.5.1'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROS_DISTRO: foxy
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#foxy"
DOCKER_RUN_OPTS: --network static_test_net
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.8.0.10253
URSIM_VERSION: '5.5.1'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
NOT_TEST_DOWNSTREAM: true
- ROS_DISTRO: galactic
ROS_REPO: main
IMMEDIATE_TEST_OUTPUT: true
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#galactic"
DOCKER_RUN_OPTS: --network static_test_net
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.8.0.10253
URSIM_VERSION: '5.5.1'
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#main https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS2_Driver/main/Universal_Robots_ROS2_Driver-not-released.humble.repos"
DOCKER_RUN_OPTS: --network static_test_net
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.8.0.10253
URSIM_VERSION: '5.5.1'
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 static_test_net
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.8.0.10253
URSIM_VERSION: '5.5.1'
ROBOT_MODEL: 'ur5e'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
NOT_TEST_DOWNSTREAM: true

steps:
- uses: actions/checkout@v1
- name: start ursim
run: |
tests/resources/dockerursim/build_and_run_docker_ursim.sh $URSIM_VERSION
scripts/start_ursim.sh -m $ROBOT_MODEL -v $URSIM_VERSION -p $PROGRAM_FOLDER -d
env: ${{matrix.env}}
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ add_library(urcl SHARED
src/ur/calibration_checker.cpp
src/ur/dashboard_client.cpp
src/ur/tool_communication.cpp
src/ur/version_information.cpp
src/rtde/rtde_writer.cpp
src/default_log_handler.cpp
src/log.cpp
Expand Down
18 changes: 14 additions & 4 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.0.2)
project(ur_driver_examples)

#find_package(ur_client_library REQUIRED)
# find_package(ur_client_library REQUIRED)

##
## Check C++11 support / enable global pedantic and Wall
##
# #
# # Check C++11 support / enable global pedantic and Wall
# #
include(DefineCXX17CompilerFlag)
DEFINE_CXX_17_COMPILER_FLAG(CXX17_FLAG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
Expand All @@ -20,7 +20,17 @@ add_executable(primary_pipeline_example
target_compile_options(primary_pipeline_example PUBLIC ${CXX17_FLAG})
target_link_libraries(primary_pipeline_example ur_client_library::urcl)

add_executable(primary_pipeline_calibration_example
primary_pipeline_calibration.cpp)
target_compile_options(primary_pipeline_calibration_example PUBLIC ${CXX17_FLAG})
target_link_libraries(primary_pipeline_calibration_example ur_client_library::urcl)

add_executable(rtde_client_example
rtde_client.cpp)
target_compile_options(rtde_client_example PUBLIC ${CXX17_FLAG})
target_link_libraries(rtde_client_example ur_client_library::urcl)

add_executable(dashboard_example
dashboard_example.cpp)
target_compile_options(dashboard_example PUBLIC ${CXX17_FLAG})
target_link_libraries(dashboard_example ur_client_library::urcl)
124 changes: 124 additions & 0 deletions examples/dashboard_example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-

// -- BEGIN LICENSE BLOCK ----------------------------------------------
// Copyright 2022 Universal Robots A/S
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// -- END LICENSE BLOCK ------------------------------------------------

#include <ur_client_library/log.h>
#include <ur_client_library/ur/dashboard_client.h>

#include <iostream>
#include <memory>
#include <thread>

using namespace urcl;

// In a real-world example it would be better to get those values from command line parameters / a
// better configuration system such as Boost.Program_options
const std::string DEFAULT_ROBOT_IP = "192.168.56.101";

// We need a callback function to register. See UrDriver's parameters for details.

int main(int argc, char* argv[])
{
urcl::setLogLevel(urcl::LogLevel::DEBUG);

// Parse the ip arguments if given
std::string robot_ip = DEFAULT_ROBOT_IP;
if (argc > 1)
{
robot_ip = std::string(argv[1]);
}

// Making the robot ready for the program by:
// Connect the the robot Dashboard
std::unique_ptr<DashboardClient> my_dashboard;
my_dashboard.reset(new DashboardClient(robot_ip));
if (!my_dashboard->connect())
{
URCL_LOG_ERROR("Could not connect to dashboard");
return 1;
}

if (!my_dashboard->commandPowerOff())
{
URCL_LOG_ERROR("Could not send power off");
return 1;
}

my_dashboard->commandCloseSafetyPopup();

// Power it on
if (!my_dashboard->commandPowerOn())
{
URCL_LOG_ERROR("Could not send Power on command");
return 1;
}

// Release the brakes
if (!my_dashboard->commandBrakeRelease())
{
URCL_LOG_ERROR("Could not send BrakeRelease command");
return 1;
}

// Load existing program
const std::string program_file_name_to_be_loaded("wait_program.urp");
if (!my_dashboard->commandLoadProgram(program_file_name_to_be_loaded))
{
URCL_LOG_ERROR("Could not load %s program", program_file_name_to_be_loaded.c_str());
return 1;
}

// Play loaded program
if (!my_dashboard->commandPlay())
{
URCL_LOG_ERROR("Could not play program");
return 1;
}

// Pause running program
if (!my_dashboard->commandPause())
{
URCL_LOG_ERROR("Could not pause program");
return 1;
}

// Play loaded program
if (!my_dashboard->commandPlay())
{
URCL_LOG_ERROR("Could not play program");
return 1;
}

// Stop program
if (!my_dashboard->commandStop())
{
URCL_LOG_ERROR("Could not stop program");
return 1;
}

// Power it off
if (!my_dashboard->commandPowerOff())
{
URCL_LOG_ERROR("Could not send Power off command");
return 1;
}

// Now the robot is ready to receive a program

return 0;
}
Loading