Skip to content

Commit a13d64d

Browse files
authored
Merge pull request #1 from TalTech-IVAR-Lab/release/v1.1.7
Release Robot Programming v1.1.7
2 parents 91f2259 + a1157df commit a13d64d

7 files changed

Lines changed: 142 additions & 118 deletions

File tree

‎.github/workflows/publish_package.yml‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎.github/workflows/release.yml‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Publish Git package release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
concurrency:
12+
group: release-${{ github.repository }}-${{ github.ref }}
13+
cancel-in-progress: false
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 5
19+
steps:
20+
- name: Validate tag against package metadata
21+
env:
22+
GH_TOKEN: ${{ github.token }}
23+
run: |
24+
set -euo pipefail
25+
26+
package_json="$({
27+
gh api \
28+
-H "Accept: application/vnd.github.raw+json" \
29+
"/repos/${GITHUB_REPOSITORY}/contents/package.json?ref=${GITHUB_SHA}"
30+
})"
31+
package_name="$(jq -er '.name' <<<"${package_json}")"
32+
package_version="$(jq -er '.version' <<<"${package_json}")"
33+
expected_tag="v${package_version}"
34+
35+
semver_pattern='^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(\.(0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$'
36+
if [[ ! "${package_version}" =~ ${semver_pattern} ]]; then
37+
echo "Package ${package_name} has invalid SemVer version ${package_version}." >&2
38+
exit 1
39+
fi
40+
41+
if [[ "${GITHUB_REF_NAME}" != "${expected_tag}" ]]; then
42+
echo "Tag ${GITHUB_REF_NAME} does not match ${package_name} version ${package_version}." >&2
43+
exit 1
44+
fi
45+
46+
- name: Create GitHub release
47+
env:
48+
GH_TOKEN: ${{ github.token }}
49+
run: |
50+
set -euo pipefail
51+
52+
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
53+
echo "Release ${GITHUB_REF_NAME} already exists."
54+
exit 0
55+
fi
56+
57+
release_options=(
58+
--repo "${GITHUB_REPOSITORY}"
59+
--verify-tag
60+
--generate-notes
61+
--title "${GITHUB_REF_NAME}"
62+
)
63+
version_without_build="${GITHUB_REF_NAME%%+*}"
64+
if [[ "${version_without_build}" == *-* ]]; then
65+
release_options+=(--prerelease)
66+
fi
67+
68+
gh release create "${GITHUB_REF_NAME}" "${release_options[@]}"

‎.releaserc.yml‎

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎README.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
# Unity ROS Robot Programming
22

33
Collection of scripts to record and play back trajectories on connected ROS Robots.
4+
5+
## Installation
6+
7+
Add the package and its TalTech dependencies directly to the Unity project's
8+
`Packages/manifest.json`:
9+
10+
```json
11+
{
12+
"dependencies": {
13+
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=/src/UniTask/Assets/Plugins/UniTask#2.3.1",
14+
"ee.taltech.ivar.robotics.moveit": "https://github.com/TalTech-IVAR-Lab/Unity-MoveIt-Integration.git#v1.3.0",
15+
"ee.taltech.ivar.robotics.ros-industrial": "https://github.com/TalTech-IVAR-Lab/Unity-ROS-Industrial-Integration.git#v1.3.1",
16+
"ee.taltech.ivar.robotics.ros-robot-programming": "https://github.com/TalTech-IVAR-Lab/Unity-ROS-Robot-Programming.git#v1.1.7",
17+
"io.extendreality.zinnia.unity": "https://github.com/ExtendRealityLtd/Zinnia.Unity.git#v2.0.0"
18+
}
19+
}
20+
```
21+
22+
Unity does not resolve version-only transitive dependencies from Git. Keep all
23+
five entries in the project manifest unless another package source provides them.

‎Runtime/PathExecutor.cs‎

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,62 @@ public async UniTaskVoid ExecuteSelectedPath()
4949
{
5050
IsExecuting = true;
5151

52-
var pathPoses = pathSelector.SelectedPath.pointsPose;
53-
54-
Debug.Log($"Starting executing '{pathSelector.SelectedPath}'...");
55-
56-
for (var i = 0; i < pathPoses.Count; i++)
52+
try
5753
{
58-
var pose = pathPoses[i];
54+
var pathPoses = pathSelector.SelectedPath.pointsPose;
5955

60-
// Convert pose back to world space before using it in the request
61-
var worldPose = new Pose
62-
{
63-
position = pathCoordinateSpaceOrigin.TransformPoint(pose.position),
64-
rotation = pathCoordinateSpaceOrigin.rotation * pose.rotation
65-
};
56+
Debug.Log($"Starting executing '{pathSelector.SelectedPath}'...");
6657

67-
Debug.Log($"Starting motion to point {i + 1}/{pathPoses.Count}...");
68-
69-
bool motionSuccessful = await robotController.MoveCartesian(worldPose);
70-
71-
if (!motionSuccessful)
58+
for (var i = 0; i < pathPoses.Count; i++)
7259
{
73-
Debug.LogError($"Motion to point {i + 1} failed. Please check the logs to identify the issue.\n" +
74-
$"Aborting the rest of the trajectory execution.");
75-
break;
60+
var pose = pathPoses[i];
61+
62+
// Convert pose back to world space before using it in the request
63+
var worldPose = new Pose
64+
{
65+
position = pathCoordinateSpaceOrigin.TransformPoint(pose.position),
66+
rotation = pathCoordinateSpaceOrigin.rotation * pose.rotation
67+
};
68+
69+
Debug.Log($"PathExecutor point {i + 1}/{pathPoses.Count}: savedLocalPos={pose.position} savedLocalRot={pose.rotation.eulerAngles} " +
70+
$"origin={pathCoordinateSpaceOrigin.name} originWorldPos={pathCoordinateSpaceOrigin.position} originWorldRot={pathCoordinateSpaceOrigin.rotation.eulerAngles} " +
71+
$"executedWorldPos={worldPose.position} executedWorldRot={worldPose.rotation.eulerAngles}", this);
72+
73+
Debug.Log($"Starting motion to point {i + 1}/{pathPoses.Count}...");
74+
75+
bool motionSuccessful;
76+
77+
if (i == 0)
78+
{
79+
// The first move is an approach from the robot's arbitrary current pose to the start of the
80+
// programmed path. It is not a visible path segment in the VR program, so do not force it to be
81+
// a Cartesian LIN move. LIN is preserved for all programmed point-to-point segments below.
82+
motionSuccessful = await robotController.MoveCartesianPtp(worldPose);
83+
}
84+
else
85+
{
86+
motionSuccessful = await robotController.MoveCartesian(worldPose);
87+
}
88+
89+
if (!motionSuccessful)
90+
{
91+
Debug.LogError($"Motion to point {i + 1} failed. Please check the logs to identify the issue.\n" +
92+
$"Aborting the rest of the trajectory execution.");
93+
break;
94+
}
95+
96+
Debug.Log($"Moved to point {i + 1}/{pathPoses.Count}.");
7697
}
77-
78-
Debug.Log($"Moved to point {i + 1}/{pathPoses.Count}.");
79-
}
8098

81-
Debug.Log($"Finished executing path '{pathSelector.SelectedPath}'.");
82-
83-
IsExecuting = false;
99+
Debug.Log($"Finished executing path '{pathSelector.SelectedPath}'.");
100+
}
101+
finally
102+
{
103+
IsExecuting = false;
104+
}
84105
}
85106

107+
86108
#endregion
87109
}
88110
}

‎Runtime/PathTracingTool.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public void AddPointToSelectedPath()
5252
rotation = Quaternion.Inverse(pathCoordinateSpaceOrigin.rotation) * tool.rotation
5353
};
5454

55+
Debug.Log($"PathTracingTool save: toolWorldPos={tool.position} toolWorldRot={tool.rotation.eulerAngles} " +
56+
$"origin={pathCoordinateSpaceOrigin.name} originWorldPos={pathCoordinateSpaceOrigin.position} originWorldRot={pathCoordinateSpaceOrigin.rotation.eulerAngles} " +
57+
$"savedLocalPos={pathPointPose.position} savedLocalRot={pathPointPose.rotation.eulerAngles}", this);
58+
5559
// Save to path
5660
SelectedPath.pointsPose.Add(pathPointPose);
5761
PathFileHandler.SavePathToDefaultLocation(SelectedPath);

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ee.taltech.ivar.robotics.ros-robot-programming",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"displayName": "ROS Robot Programming",
55
"description": "Collection of scripts to record and play back trajectories on connected ROS Robots.",
66
"unity": "2020.3",
@@ -17,7 +17,7 @@
1717
"url": "https://gitlab.com/JGroxz"
1818
},
1919
"dependencies": {
20-
"ee.taltech.ivar.robotics.moveit": "1.2.10",
20+
"ee.taltech.ivar.robotics.moveit": "1.3.0",
2121
"io.extendreality.zinnia.unity": "2.0.0"
2222
},
2323
"samples": [],

0 commit comments

Comments
 (0)