Skip to content

Commit

Permalink
feat(arcor2_ur): calibration file
Browse files Browse the repository at this point in the history
  • Loading branch information
ZdenekM committed Oct 1, 2024
1 parent cc5490a commit a5baf1c
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 31 deletions.
13 changes: 13 additions & 0 deletions compose-files/ur-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# UR Demo

To use with simulator, run:

```bash
docker compose -f docker-compose.yml -f docker-compose.sim.yml up
```

For the real robot, use the following command:

```bash
docker compose -f docker-compose.yml -f docker-compose.lab.yml up
```
7 changes: 4 additions & 3 deletions compose-files/ur-demo/docker-compose.lab.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
ur-demo-robot-api:
ports:
- "50002:50002" # robot connects to this port
environment:
- ROBOT_CONTAINER_NAME=ur-20245500974
- ROBOT_IP=192.168.104.149
volumes:
- ./robot_calibration.yaml:/root/robot_calibration.yaml
network_mode: host # ObjectType has to connect to localhost:5012
32 changes: 32 additions & 0 deletions compose-files/ur-demo/docker-compose.sim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
services:
ur-demo-ursim:
image: universalrobots/ursim_e-series:5.17.2
container_name: ur-demo-ursim
ports: # network_mode: host can't be (easily) used as ursim starts its own X server
- "5900:5900" # VNC port
- "6080:6080" # web VNC
# - "30001:30001"
# - "30002:30002"
# - "30004:30004"
# - "29999:29999"
networks:
- ur-demo-network
environment:
- ROBOT_MODEL=UR5
volumes:
- ursim-gui-cache:/ursim/GUI
- urcap-build-cache:/ursim/.urcaps
- ursim-programs:/ursim/programs
ur-demo-robot-api:
environment:
- ROBOT_IP=ur-demo-ursim
- SLEEP=10
networks:
- ur-demo-network # ObjectType has to connect to ur-demo-ursim:5012

volumes:
ursim-gui-cache:
urcap-build-cache:
ursim-programs:
ur-demo-asset:
ur-demo-execution:
23 changes: 2 additions & 21 deletions compose-files/ur-demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
services:
ur-demo-ursim:
image: universalrobots/ursim_e-series:5.17.2
container_name: ur-demo-ursim
ports:
- "5900:5900" # VNC port
- "6080:6080" # web VNC
networks:
- ur-demo-network
environment:
- ROBOT_MODEL=UR5
volumes:
- ursim-gui-cache:/ursim/GUI
- urcap-build-cache:/ursim/.urcaps
- ursim-programs:/ursim/programs
ur-demo-robot-api:
image: arcor2/arcor2_ur:1.2.1
image: arcor2/arcor2_ur:1.3.0
container_name: ur-demo-robot-api
ports:
- "5012:5012"
# environment:
# - ARCOR2_UR_DEBUG=1
networks: # TODO use network_mode: "host" for the real robot
- ur-demo-network
restart: always # the service tends to crash when calling PUT /state/stop
cap_add:
- SYS_NICE
Expand Down Expand Up @@ -162,7 +146,7 @@ services:
- ur-demo-asset

ur-demo-upload-object-types:
image: arcor2/arcor2_ur_ot:1.2.1
image: arcor2/arcor2_ur_ot:1.3.0
container_name: "ur-demo-upload-object-types"
depends_on:
ur-demo-project:
Expand Down Expand Up @@ -190,9 +174,6 @@ services:
- ARCOR2_ASSET_SERVICE_URL=http://ur-demo-asset:10040

volumes:
ursim-gui-cache:
urcap-build-cache:
ursim-programs:
ur-demo-asset:
ur-demo-execution:

Expand Down
44 changes: 44 additions & 0 deletions compose-files/ur-demo/robot_calibration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
kinematics:
shoulder:
x: 0
y: 0
z: 0.16253268591029907
roll: -0
pitch: 0
yaw: -3.9706105474032749e-07
upper_arm:
x: 5.9721945474714789e-05
y: 0
z: 0
roll: 1.5694161246097016
pitch: 0
yaw: 3.8856764585994165e-07
forearm:
x: -0.42536553582483921
y: 0
z: 0
roll: 3.1411247028186096
pitch: 3.1406202190734502
yaw: 3.141591474472873
wrist_1:
x: -0.39236572259516306
y: -0.00038526533421009263
z: 0.13417899372885142
roll: 0.0028712711637521563
pitch: 3.3546609413013983e-05
yaw: 1.2608447936119974e-06
wrist_2:
x: 5.7243914837099386e-05
y: -0.099710274078176342
z: 5.5554929734187943e-05
roll: 1.5702391633079928
pitch: 0
yaw: 4.5241975821577735e-07
wrist_3:
x: 9.4768738018291456e-05
y: 0.099660684607093819
z: 3.0152958512421488e-05
roll: 1.5710988829905641
pitch: 3.1415926535897931
yaw: 3.1415926477648899
hash: calib_15111234226826911485
2 changes: 1 addition & 1 deletion src/docker/arcor2_ur/BUILD
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
shell_source(name="start.sh", source="start.sh")
docker_image(name="arcor2_ur", repository="arcor2/arcor2_ur", dependencies=[":start.sh", "build-support:install_ur_dependencies.sh"], image_tags=["1.2.1"])
docker_image(name="arcor2_ur", repository="arcor2/arcor2_ur", dependencies=[":start.sh", "build-support:install_ur_dependencies.sh"], image_tags=["1.3.0"])
13 changes: 9 additions & 4 deletions src/docker/arcor2_ur/start.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#!/bin/bash

set -e

# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash

: "${UR_TYPE:=ur5e}"
: "${ROBOT_CONTAINER_NAME:=ur-demo-ursim}"

ROBOT_CONTAINER_IP=$(getent hosts "$ROBOT_CONTAINER_NAME" | awk '{ print $1 }')
# simulator needs some time to get running...
if [[ -n "$SLEEP" && "$SLEEP" =~ ^[0-9]+$ ]]; then
echo "Waiting for $SLEEP seconds..."
sleep $SLEEP
fi

sleep 10s # TODO find a way how to detect that the robot is up and running (test if some port is opened?)
cp --update=none "$(ros2 pkg prefix --share ur_description)/config/$UR_TYPE/default_kinematics.yaml" /root/robot_calibration.yaml

ros2 launch ur_robot_driver ur_control.launch.py ur_type:="$UR_TYPE" robot_ip:="$ROBOT_CONTAINER_IP" launch_rviz:=false &
ros2 launch ur_robot_driver ur_control.launch.py ur_type:="$UR_TYPE" robot_ip:="$ROBOT_IP" launch_rviz:=false kinematics_params_file:="/root/robot_calibration.yaml" &

PEX_EXTRA_SYS_PATH=/opt/ros/jazzy/lib/python3.12/site-packages PYTHONOPTIMIZE=1 /bin/app/pex
2 changes: 1 addition & 1 deletion src/docker/arcor2_ur_ot/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker_image(name="arcor2_ur_ot", repository="arcor2/arcor2_ur_ot", image_tags=["1.2.1"])
docker_image(name="arcor2_ur_ot", repository="arcor2/arcor2_ur_ot", image_tags=["1.3.0"])
7 changes: 7 additions & 0 deletions src/python/arcor2_ur/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [1.3.0] - 2024-10-01

### Changed

- Docker image now checks for a robot calibration file at `/root/robot_calibration.yaml`. If not given, a default one is used.
- `ROBOT_CONTAINER_IP` was changed to `ROBOT_IP`.

## [1.2.1] - 2024-09-30

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/python/arcor2_ur/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.3.0

0 comments on commit a5baf1c

Please sign in to comment.