Skip to content

Commit d324209

Browse files
Merge pull request #324 from Unity-Technologies/dev
Release 0.6.0
2 parents e019bbf + 4cdeeed commit d324209

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+524
-547
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ jobs:
1515
python-version: 3.7.x
1616
- uses: actions/setup-dotnet@v1
1717
with:
18-
dotnet-version: '3.1.x'
18+
dotnet-version: '6.0.x'
19+
include-prerelease: true
1920
- uses: pre-commit/action@v2.0.0

.github/workflows/stale.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Stale issue handler'
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 17 * * *' # 17:00 UTC; 10:00 PDT
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
stale:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/stale@v4.0.0
15+
id: stale
16+
with:
17+
stale-issue-label: 'stale'
18+
stale-issue-message: 'This issue has been marked stale because it has been open for 14 days with no activity. Please remove the stale label or comment on this issue, or the issue will be automatically closed in the next 14 days.'
19+
days-before-stale: 14
20+
days-before-pr-stale: -1
21+
days-before-close: 14
22+
days-before-pr-close: -1
23+
exempt-issue-labels: 'blocked,must,should,keep,pinned,work-in-progress,request,announcement'
24+
close-issue-message: 'This issue has been marked stale for 14 days and will now be closed. If this issue is still valid, please ping a maintainer.'
25+
- name: Print outputs
26+
run: echo ${{ join(steps.stale.outputs.*, ',') }}
27+

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ repos:
2626

2727

2828
- repo: https://github.com/dotnet/format
29-
rev: "7e343070a0355c86f72bdee226b5e19ffcbac931"
29+
rev: v5.1.225507
3030
hooks:
3131
- id: dotnet-format
32+
entry: dotnet-format whitespace
3233
args: [--folder, --include]

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## Unreleased
88

9+
Fixed the ROS-Unity Integration tutorial `robo_demo.launch` to be up-to-date with file paths, and updated Pick-and-Place Part 2 ROS Settings screenshot.
10+
11+
Add the [Close Stale Issues](https://github.com/marketplace/actions/close-stale-issues) action
12+
13+
Updated Pick-and-Place scripts for style conformity, updated custom msg formats and made according script and tutorial changes.
14+
915
### Upgrade Notes
1016

1117
### Known Issues
@@ -20,6 +26,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
2026

2127
### Fixed
2228

29+
Fixed dotnet format
30+
31+
Fixed Source Destination topic on the ROS side
32+
2333
## v0.5.1
2434

2535
### Changed

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Unity Robotics Hub
44

5-
[![Version](https://img.shields.io/github/v/tag/Unity-Technologies/Unity-Robotics-Hub)](https://github.com/Unity-Technologies/Unity-Robotics-Hub/releases)
5+
<!-- [![Version](https://img.shields.io/github/v/tag/Unity-Technologies/Unity-Robotics-Hub)](https://github.com/Unity-Technologies/Unity-Robotics-Hub/releases) -->
66
[![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE.md)
77
![ROS](https://img.shields.io/badge/ros-melodic-brightgreen)
88
![ROS](https://img.shields.io/badge/ros-noetic-brightgreen)
@@ -13,6 +13,12 @@ This is a central repository for tools, tutorials, resources, and documentation
1313

1414
> The contents of this repository are in active development. Its features and API are subject to significant change as development progresses.
1515
16+
---
17+
18+
We're currently working on lots of things! Please take a short moment fill out our [survey](https://unitysoftware.co1.qualtrics.com/jfe/form/SV_0ojVkDVW0nNrHkW) to help us identify what products and packages to build next.
19+
20+
---
21+
1622
## Introduction
1723

1824
Simulation plays an important role in robotics development, and we’re here to ensure that roboticists can use Unity for these simulations. We're starting off with a set of tools to make it easier to use Unity with existing ROS-based workflows. Try out some of our samples below to get started quickly.
@@ -36,21 +42,22 @@ A robot simulation demonstrating Unity's new physics solver (no ROS dependency).
3642

3743
### [**New!**] [Navigation 2 SLAM Example](https://github.com/Unity-Technologies/Robotics-Nav2-SLAM-Example)
3844

39-
An example simulation environment, integrated with ROS 2, which enables the exercise of ROS 2's Navigation 2 and slam_toolbox packages using a simulated Turtlebot 3.
45+
An example simulation environment, integrated with ROS 2 and **[New!] Visualizations**, which enables the exercise of ROS 2's Navigation 2 and slam_toolbox packages using a simulated Turtlebot 3.
4046

4147
## Documentation
4248

4349
| Tutorial | Description |
4450
|---|---|
4551
| [ROS–Unity Integration](tutorials/ros_unity_integration/README.md) | A set of component-level tutorials showing how to set up communication between ROS and Unity |
4652
| [URDF Importer](tutorials/urdf_importer/urdf_tutorial.md) | Steps on using the Unity package for loading [URDF](http://wiki.ros.org/urdf) files |
53+
| [**New!**] [Visualizations](https://github.com/Unity-Technologies/ROS-TCP-Connector/blob/main/com.unity.robotics.visualizations/Documentation~/README.md) | Usage instructions for adding visualizations for incoming and outgoing ROS messages |
4754

4855
## Component Repos
4956

5057
| Repo | Functionality |
5158
|---|---|
5259
| [ROS TCP Endpoint](https://github.com/Unity-Technologies/ROS-TCP-Endpoint) | ROS node for sending/receiving messages from Unity |
53-
| [ROS TCP Connector](https://github.com/Unity-Technologies/ROS-TCP-Connector) | Unity package for sending/receiving messages from ROS |
60+
| [ROS TCP Connector](https://github.com/Unity-Technologies/ROS-TCP-Connector) | Unity package for sending, receiving, and visualizing messages from ROS |
5461
| [URDF Importer](https://github.com/Unity-Technologies/URDF-Importer) | Unity package for loading [URDF](http://wiki.ros.org/urdf) files |
5562

5663

@@ -59,7 +66,8 @@ An example simulation environment, integrated with ROS 2, which enables the exer
5966

6067
### Blog Posts and Talks
6168

62-
- [**New!**] (August 13, 2021) Advance your robot autonomy with ROS 2 and Unity [blog post](https://blog.unity.com/manufacturing/advance-your-robot-autonomy-with-ros-2-and-unity)
69+
- [**New!**] (October 4, 2021) Introducing: Unity Robotics Visualizations Package [blog post](https://blog.unity.com/manufacturing/Introducing-Unity-Robotics-Visualizations-Package)
70+
- (August 13, 2021) Advance your robot autonomy with ROS 2 and Unity [blog post](https://blog.unity.com/manufacturing/advance-your-robot-autonomy-with-ros-2-and-unity)
6371
- (March 2, 2021) Teaching robots to see with Unity [blog post](https://blogs.unity3d.com/2021/03/02/teaching-robots-to-see-with-unity/)
6472
- (November 19, 2020) Robotics simulation in Unity is as easy as 1, 2, 3! [blog post](https://blogs.unity3d.com/2020/11/19/robotics-simulation-in-unity-is-as-easy-as-1-2-3/)
6573
- (November 12, 2020)
@@ -87,13 +95,9 @@ Here’s a peek into what our Physics Team is hard at work on…
8795
- **Force/Torque Sensor API**. This API will allow users to get the force and torque acting on an articulation body (useful for simulating a force/torque sensor!), as well as to get the motor torque applied by an articulation drive.
8896
- **Query primitives**. These simple, GameObject-less shapes allow for collision detection without requiring simulation (i.e., without calling Physics.Simulate). This feature will allow users to initialize objects in feasible locations, and can also be used for motion planning.
8997

90-
## [**New!**] ROS 2
98+
## ROS 2
9199
ROS2 support is now available! You can get started by following [this tutorial](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/ros_unity_integration/publisher.md).
92100

93-
94-
## FAQs
95-
[FAQs](faq.md)
96-
97101
## Community and Feedback
98102

99103
The Unity Robotics projects are open-source and we encourage and welcome contributions.
@@ -112,5 +116,8 @@ Robotics team at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com)
112116
## Newsletter
113117
To get notified about new updates and features, [sign up for our newsletter](https://create.unity3d.com/robotics-simulation-newsletter-sign-up)!
114118

119+
## FAQs
120+
[FAQs](faq.md)
121+
115122
## License
116123
[Apache License 2.0](LICENSE)

tutorials/pick_and_place/0_ros_setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ git clone --recurse-submodules https://github.com/Unity-Technologies/Unity-Robot
3939
1. Start the newly built Docker container:
4040

4141
```docker
42-
docker run -it --rm -p 10000:10000 -p 5005:5005 unity-robotics:pick-and-place /bin/bash
42+
docker run -it --rm -p 10000:10000 unity-robotics:pick-and-place /bin/bash
4343
```
4444

4545
When this is complete, it will print: `Successfully tagged unity-robotics:pick-and-place`. This console should open into a bash shell at the ROS workspace root, e.g. `root@8d88ed579657:/catkin_ws#`.

tutorials/pick_and_place/2_ros_tcp.md

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ To enable communication between Unity and ROS, a TCP endpoint running as a ROS n
4747

4848
In the ROS Message Browser window, click `Browse` next to the ROS message path. Navigate to and select the ROS directory of this cloned repository (`Unity-Robotics-Hub/tutorials/pick_and_place/ROS/`). This window will populate with all msg and srv files found in this directory.
4949

50-
In the ROS Message Browser window, type in `Scripts/RosMessages` in the text field of Build message path.
51-
5250
![](img/2_browser.png)
5351

5452
> Note: If any of these ROS directories appear to be empty, you can run the command `git submodule update --init --recursive` to download the packages via Git submodules.
@@ -87,33 +85,30 @@ To enable communication between Unity and ROS, a TCP endpoint running as a ROS n
8785
8886
```csharp
8987
public void Publish()
90-
{
91-
NiryoMoveitJointsMsg sourceDestinationMessage = new NiryoMoveitJointsMsg();
92-
93-
sourceDestinationMessage.joint_00 = jointArticulationBodies[0].xDrive.target;
94-
sourceDestinationMessage.joint_01 = jointArticulationBodies[1].xDrive.target;
95-
sourceDestinationMessage.joint_02 = jointArticulationBodies[2].xDrive.target;
96-
sourceDestinationMessage.joint_03 = jointArticulationBodies[3].xDrive.target;
97-
sourceDestinationMessage.joint_04 = jointArticulationBodies[4].xDrive.target;
98-
sourceDestinationMessage.joint_05 = jointArticulationBodies[5].xDrive.target;
99-
100-
// Pick Pose
101-
sourceDestinationMessage.pick_pose = new PoseMsg
102-
{
103-
position = target.transform.position.To<FLU>(),
104-
// The hardcoded x/z angles assure that the gripper is always positioned above the target cube before grasping.
105-
orientation = Quaternion.Euler(90, target.transform.eulerAngles.y, 0).To<FLU>()
106-
};
107-
108-
// Place Pose
109-
sourceDestinationMessage.place_pose = new PoseMsg
110-
{
111-
position = targetPlacement.transform.position.To<FLU>(),
112-
orientation = pickOrientation.To<FLU>()
113-
};
114-
115-
// Finally send the message to server_endpoint.py running in ROS
116-
ros.Send(topicName, sourceDestinationMessage);
88+
{
89+
var sourceDestinationMessage = new NiryoMoveitJointsMsg();
90+
91+
for (var i = 0; i < k_NumRobotJoints; i++)
92+
{
93+
sourceDestinationMessage.joints[i] = m_JointArticulationBodies[i].GetPosition();
94+
}
95+
96+
// Pick Pose
97+
sourceDestinationMessage.pick_pose = new PoseMsg
98+
{
99+
position = m_Target.transform.position.To<FLU>(),
100+
orientation = Quaternion.Euler(90, m_Target.transform.eulerAngles.y, 0).To<FLU>()
101+
};
102+
103+
// Place Pose
104+
sourceDestinationMessage.place_pose = new PoseMsg
105+
{
106+
position = m_TargetPlacement.transform.position.To<FLU>(),
107+
orientation = m_PickOrientation.To<FLU>()
108+
};
109+
110+
// Finally send the message to server_endpoint.py running in ROS
111+
m_Ros.Send(m_TopicName, sourceDestinationMessage);
117112
}
118113
```
119114

@@ -142,11 +137,11 @@ To enable communication between Unity and ROS, a TCP endpoint running as a ROS n
142137

143138
- If you are **not** running ROS services in a Docker container, replace the `ROS IP Address` value with the IP address of your ROS machine. Ensure that the `Host Port` is set to `10000`.
144139

145-
- If you **are** running ROS services in a Docker container, fill `ROS IP Address` with the loopback IP address `127.0.0.1` and the `Override Unity IP Address` as your local machine's IP address. Otherwise, leave the `Override Unity IP Address` field empty.
140+
- If you **are** running ROS services in a Docker container, fill `ROS IP Address` with the loopback IP address `127.0.0.1`.
146141

147142
![](img/2_settings.png)
148143

149-
Opening the ROS Settings has created a ROSConnectionPrefab in `Assets/Resources` with the user-input settings. When the static `ROSConnection.instance` is referenced in a script, if a `ROSConnection` instance is not already present, the prefab will be instantiated in the Unity scene, and the connection will begin.
144+
The other settings can be left as their defaults. Opening the ROS Settings has created a ROSConnectionPrefab in `Assets/Resources` with the user-input settings. When the static `ROSConnection.instance` is referenced in a script, if a `ROSConnection` instance is not already present, the prefab will be instantiated in the Unity scene, and the connection will begin.
150145

151146
> Note: While using the ROS Settings menu is the suggested workflow as of this version, you may still manually create a GameObject with an attached ROSConnection component.
152147

tutorials/pick_and_place/3_pick_and_place.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,31 @@ Steps covered in this tutorial includes invoking a motion planning service in RO
3131
```csharp
3232
public void PublishJoints()
3333
{
34-
MoverServiceRequest request = new MoverServiceRequest();
34+
var request = new MoverServiceRequest();
3535
request.joints_input = CurrentJointConfig();
3636

3737
// Pick Pose
3838
request.pick_pose = new PoseMsg
3939
{
40-
position = (target.transform.position + pickPoseOffset).To<FLU>(),
40+
position = (m_Target.transform.position + m_PickPoseOffset).To<FLU>(),
41+
4142
// The hardcoded x/z angles assure that the gripper is always positioned above the target cube before grasping.
42-
orientation = Quaternion.Euler(90, target.transform.eulerAngles.y, 0).To<FLU>()
43+
orientation = Quaternion.Euler(90, m_Target.transform.eulerAngles.y, 0).To<FLU>()
4344
};
4445

4546
// Place Pose
4647
request.place_pose = new PoseMsg
4748
{
48-
position = (targetPlacement.transform.position + pickPoseOffset).To<FLU>(),
49-
orientation = pickOrientation.To<FLU>()
49+
position = (m_TargetPlacement.transform.position + m_PickPoseOffset).To<FLU>(),
50+
orientation = m_PickOrientation.To<FLU>()
5051
};
5152

52-
ros.SendServiceMessage<MoverServiceResponse>(rosServiceName, request, TrajectoryResponse);
53+
m_Ros.SendServiceMessage<MoverServiceResponse>(m_RosServiceName, request, TrajectoryResponse);
5354
}
5455

5556
void TrajectoryResponse(MoverServiceResponse response)
5657
{
57-
if (response.trajectories != null)
58+
if (response.trajectories.Length > 0)
5859
{
5960
Debug.Log("Trajectory returned.");
6061
StartCoroutine(ExecuteTrajectories(response));
@@ -137,12 +138,16 @@ def plan_trajectory(move_group, destination_pose, start_joint_angles):
137138
move_group.set_start_state(moveit_robot_state)
138139

139140
move_group.set_pose_target(destination_pose)
140-
plan = move_group.go(wait=True)
141+
plan = move_group.plan()
141142

142143
if not plan:
143-
print("RAISE NO PLAN ERROR")
144+
exception_str = """
145+
Trajectory could not be planned for a destination of {} with starting joint angles {}.
146+
Please make sure target and destination are reachable by the robot.
147+
""".format(destination_pose, destination_pose)
148+
raise Exception(exception_str)
144149

145-
return move_group.plan()
150+
return planCompat(plan)
146151
```
147152

148153
> This creates a set of planned trajectories, iterating through a pre-grasp, grasp, pick up, and place set of poses. Finally, this set of trajectories is sent back to Unity.

tutorials/pick_and_place/PickAndPlaceProject/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# Ignore scripts that are expected to get copied in at some point
1717
/**/SourceDestinationPublisher.*
1818
/**/TrajectoryPlanner.*
19+
/**/RealSimPickAndPlace.*
1920

2021

2122
# MemoryCaptures can get excessive in size.

0 commit comments

Comments
 (0)