Skip to content

Commit

Permalink
custom workspace example (#12)
Browse files Browse the repository at this point in the history
This adds an example how you would setup your own robot cell using the ur_description and ur_robot_driver packages.

---------

Co-authored-by: Felix Exner <[email protected]>
  • Loading branch information
fdurchdewald and fmauch authored Apr 29, 2024
1 parent 2b3e091 commit 380fe42
Show file tree
Hide file tree
Showing 74 changed files with 2,377 additions and 1,047 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ name: pre-commit
on:
pull_request:
jobs:
pre-commits:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9.7
- name: "Install dependencies"
run: |
python -m pip install catkin_lint
- uses: pre-commit/[email protected]
python-version: "3.10"
- uses: actions/cache@v4
with:
extra_args: --all-files --hook-stage manual
path: ~/.cache/pre-commit
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/[email protected]
16 changes: 13 additions & 3 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ammaraskar/sphinx-action@master
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
docs-folder: "./ur_documentation/docs"
python-version: '3.10'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement ur_documentation/requirements.txt
shell: bash
- name: Build documentation using sphinx
run: |
TZ=UTC sphinx-build ur_documentation/docs/source _build
26 changes: 3 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
Expand All @@ -12,34 +12,14 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 24.4.0
hooks:
- id: black
args: ["--line-length=100"]
# Cmake hooks
- repo: local
hooks:
- id: ament_lint_cmake
name: ament_lint_cmake
description: Check format of CMakeLists.txt files.
stages: [commit]
entry: ament_lint_cmake
language: system
files: CMakeLists.txt$

# Copyright
- repo: local
hooks:
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
stages: [commit]
entry: ament_copyright
language: system
# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
rev: v2.2.6
hooks:
- id: codespell
args: ['--write-changes']
Expand Down
17 changes: 17 additions & 0 deletions my_robot_cell/my_robot_cell_control/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.8)
project(my_robot_cell_control)

find_package(ament_cmake REQUIRED)

install(
DIRECTORY launch config urdf
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
kinematics:
shoulder:
x: 0
y: 0
z: 0.23630000000000001
roll: -0
pitch: 0
yaw: -0
upper_arm:
x: 0
y: 0
z: 0
roll: 1.570796327
pitch: 0
yaw: -0
forearm:
x: -0.86199999999999999
y: 0
z: 0
roll: -0
pitch: 0
yaw: -0
wrist_1:
x: -0.72870000000000001
y: 0
z: 0.20100000000000001
roll: -0
pitch: 0
yaw: -0
wrist_2:
x: 0
y: -0.1593
z: -3.2672976162492252e-11
roll: 1.570796327
pitch: 0
yaw: -0
wrist_3:
x: 0
y: 0.15429999999999999
z: -3.1647459019915597e-11
roll: 1.5707963265897931
pitch: 3.1415926535897931
yaw: 3.1415926535897931
hash: calib_4890363623803256388
94 changes: 94 additions & 0 deletions my_robot_cell/my_robot_cell_control/config/ros2_controllers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
controller_manager:
ros__parameters:
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

io_and_status_controller:
type: ur_controllers/GPIOController

speed_scaling_state_broadcaster:
type: ur_controllers/SpeedScalingStateBroadcaster

force_torque_sensor_broadcaster:
type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster

scaled_joint_trajectory_controller:
type: ur_controllers/ScaledJointTrajectoryController

forward_velocity_controller:
type: velocity_controllers/JointGroupVelocityController

forward_position_controller:
type: position_controllers/JointGroupPositionController


speed_scaling_state_broadcaster:
ros__parameters:
state_publish_rate: 100.0
tf_prefix: "ur20_"

io_and_status_controller:
ros__parameters:
tf_prefix: "ur20_"

force_torque_sensor_broadcaster:
ros__parameters:
sensor_name: ur20_tcp_fts_sensor
state_interface_names:
- force.x
- force.y
- force.z
- torque.x
- torque.y
- torque.z
frame_id: ur20_tool0
topic_name: ft_data

scaled_joint_trajectory_controller:
ros__parameters:
joints:
- ur20_shoulder_pan_joint
- ur20_shoulder_lift_joint
- ur20_elbow_joint
- ur20_wrist_1_joint
- ur20_wrist_2_joint
- ur20_wrist_3_joint
command_interfaces:
- position
state_interfaces:
- position
- velocity
state_publish_rate: 100.0
action_monitor_rate: 20.0
allow_partial_joints_goal: false
constraints:
stopped_velocity_tolerance: 0.2
goal_time: 0.0
ur20_shoulder_pan_joint: { trajectory: 0.2, goal: 0.1 }
ur20_shoulder_lift_joint: { trajectory: 0.2, goal: 0.1 }
ur20_elbow_joint: { trajectory: 0.2, goal: 0.1 }
ur20_wrist_1_joint: { trajectory: 0.2, goal: 0.1 }
ur20_wrist_2_joint: { trajectory: 0.2, goal: 0.1 }
ur20_wrist_3_joint: { trajectory: 0.2, goal: 0.1 }
speed_scaling_interface_name: ur20_speed_scaling/speed_scaling_factor

forward_velocity_controller:
ros__parameters:
joints:
- ur20_shoulder_pan_joint
- ur20_shoulder_lift_joint
- ur20_elbow_joint
- ur20_wrist_1_joint
- ur20_wrist_2_joint
- ur20_wrist_3_joint
interface_name: velocity

forward_position_controller:
ros__parameters:
joints:
- ur20_shoulder_pan_joint
- ur20_shoulder_lift_joint
- ur20_elbow_joint
- ur20_wrist_1_joint
- ur20_wrist_2_joint
- ur20_wrist_3_joint
3 changes: 3 additions & 0 deletions my_robot_cell/my_robot_cell_control/config/update_rate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
controller_manager:
ros__parameters:
update_rate: 500 # Hz
Loading

0 comments on commit 380fe42

Please sign in to comment.