Skip to content

Commit 1588c15

Browse files
sdiaomrpropellersLaurieCheers-unityat669vidurvij-Unity
authored
Merge dev to main for release 0.4.0 (#113)
* Add ROS# link (#55) * Add ROS# link * Fixing message name that should not take a capital first letter automatically (#47) * Fixing message name that should not take a capital first letter automatically * Adding warning when a message file name starts with a lowercase character * AIRO-331 Code Cleanup and Testing Framework (#57) * Moving package files into package subdirectory * Adding tests and fixing Yamato config. * Adding missing using statement to MessageParser * RosMessageGeneration namespace change (#61) * Amanda/read chunks (#62) * Read message in chunks min * Removing unpredictable DataAvailable check * Configurable byte chun k size * Prevent infinite hang on reading message contents * Wait for frame on data read retry * PR Feedback * Adding prebuilt ObjectRecognition and Octomap messages (#64) * M prefix for all messages (#66) * Topic list service (#72) * Adding install instructions to README Partially addressing issue #71 wherein a user couldn't find up-to-date instructions for installing the connector into a new project. * Updating Contribution Content (#77) * Contributing content commit * Link fix * PR feedback * Adding PR template (#81) * One persistent connection for all messages sent to Unity * Read multiple messages from each connection * Compiles * First thing sent on each new connection is the timeout * Comments! * Stop the connection on leaving play mode * Add a "timeout on idle" config setting so Endpoint doesn't have to send it * IP address check for Unity IP address and ROS IP address (#80) * Add Ip address check * Adding condition for alphaumeric IP address https://man7.org/linux/man-pages/man5/hosts.5.html * Resolve conflicts Resolve the conflicts to merge dev to main * Update package.json (#87) * Update version number in readme, and clean up some weird instructions (#89) * MDuration namespace change (#91) * Minor link fix (#98) * RosConnection 2.0 (#94) * add changelog (#100) add changelog * Forum links to README, config.yml (#101) * Laurie/connection status hud (#99) * add test coverage (#102) * Reducing character count for path to generated messages The path from the package root to the root of the PregeneratedMessages folder was 47 characters. From within the PickAndPlace project, the fully qualified path including drive letter, path to workspace, and path to its location in the package cache can easily exceed 200 characters, especially for users with long names or deep workspace organization. The maximum allowed path length for a fully qualified path in Windows is 260 characters, after which an IDE can not compile the assemblies for source with too-long paths. Moved Runtime/MessageGeneration/PregeneratedMessages to Runtime/Messages, which saves 30 characters off the full path name. This is a mitigation that can not fully solve the problem, but wil at least reduce the number of cases for which the ROS-TCP-Endpoint assemblies fail to compile due to path length. Tested on my machine by manually renaming the directory in my PackageCache. * Add Linter (#103) * Add editorconfig for formatting * Use linter to format the package code * Add pre-commit hook * Fix line endings for markdown Fix trailing-whitespace * Remove ruby setup; Change to run pre-commit only on pull-requests * Resolve conflicts (#106) * Shuo/resolve conflict (#107) * Merge 0.3.0 to main (#90) * Add ROS# link (#55) * Add ROS# link * Fixing message name that should not take a capital first letter automatically (#47) * Fixing message name that should not take a capital first letter automatically * Adding warning when a message file name starts with a lowercase character * AIRO-331 Code Cleanup and Testing Framework (#57) * Moving package files into package subdirectory * Adding tests and fixing Yamato config. * Adding missing using statement to MessageParser * RosMessageGeneration namespace change (#61) * Amanda/read chunks (#62) * Read message in chunks min * Removing unpredictable DataAvailable check * Configurable byte chun k size * Prevent infinite hang on reading message contents * Wait for frame on data read retry * PR Feedback * Adding prebuilt ObjectRecognition and Octomap messages (#64) * M prefix for all messages (#66) * Topic list service (#72) * Adding install instructions to README Partially addressing issue #71 wherein a user couldn't find up-to-date instructions for installing the connector into a new project. * Updating Contribution Content (#77) * Contributing content commit * Link fix * PR feedback * Adding PR template (#81) * One persistent connection for all messages sent to Unity * Read multiple messages from each connection * Compiles * First thing sent on each new connection is the timeout * Comments! * Stop the connection on leaving play mode * Add a "timeout on idle" config setting so Endpoint doesn't have to send it * IP address check for Unity IP address and ROS IP address (#80) * Add Ip address check * Adding condition for alphaumeric IP address https://man7.org/linux/man-pages/man5/hosts.5.html * Resolve conflicts Resolve the conflicts to merge dev to main * Update package.json (#87) * Update version number in readme, and clean up some weird instructions (#89) Co-authored-by: Devin Miller (Unity) <mrpropellers@users.noreply.github.com> Co-authored-by: Amanda <31416491+at669@users.noreply.github.com> Co-authored-by: vidurvij-Unity <60901103+vidurvij-Unity@users.noreply.github.com> Co-authored-by: peifeng-unity <56408141+peifeng-unity@users.noreply.github.com> * Remove deprecated files Co-authored-by: LaurieCheers-unity <73140792+LaurieCheers-unity@users.noreply.github.com> Co-authored-by: Devin Miller (Unity) <mrpropellers@users.noreply.github.com> Co-authored-by: Amanda <31416491+at669@users.noreply.github.com> Co-authored-by: vidurvij-Unity <60901103+vidurvij-Unity@users.noreply.github.com> Co-authored-by: peifeng-unity <56408141+peifeng-unity@users.noreply.github.com> * add changelog meta file (#109) * update version to 0.4.0 (#110) * rremove stale merge Co-authored-by: Devin Miller (Unity) <mrpropellers@users.noreply.github.com> Co-authored-by: LaurieCheers-unity <73140792+LaurieCheers-unity@users.noreply.github.com> Co-authored-by: Amanda <31416491+at669@users.noreply.github.com> Co-authored-by: vidurvij-Unity <60901103+vidurvij-Unity@users.noreply.github.com> Co-authored-by: peifeng-unity <56408141+peifeng-unity@users.noreply.github.com> Co-authored-by: Devin Miller (Unity) <devin.miller@unity3d.com> Co-authored-by: peifeng-unity <peifeng.jing@unity3d.com>
1 parent 8ee9d5c commit 1588c15

File tree

404 files changed

+1459
-1228
lines changed

Some content is hidden

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

404 files changed

+1459
-1228
lines changed

.editorconfig

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
; see http://editorconfig.org/ for docs on this file
2+
; See https://github.com/dotnet/format for dotnet format
3+
4+
root = true
5+
6+
[*]
7+
ignore_if_in_header = This code was generated by a tool|<auto-generated>
8+
indent_style = space
9+
indent_size = 4
10+
; uncomment to help with sharing files across os's (i.e. network share or through local vm)
11+
#end_of_line = lf
12+
; avoid a bom, which causes endless problems with naive text tooling
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true
16+
; keeping auto-format enabled helps avoid merge hell for projects without CI-based format validation
17+
#disable_auto_format = true
18+
19+
[*.cs]
20+
; uncomment to enable full formatting of c# files
21+
formatters = generic, uncrustify
22+
23+
[*.asmdef]
24+
scrape_api = true
25+
26+
[**/Tests/**.asmdef]
27+
scrape_api = false
28+
29+
[*.Tests.asmdef]
30+
scrape_api = false
31+
32+
[*.md]
33+
indent_size = 2
34+
; trailing whitespace is unfortunately significant in markdown
35+
trim_trailing_whitespace = false
36+
; uncomment to enable basic formatting of markdown files
37+
#formatters = generic
38+
39+
[{Makefile,makefile}]
40+
; tab characters are part of the Makefile format
41+
indent_style = tab
42+
43+
[*.asmdef]
44+
indent_size = 4
45+
46+
[*.json]
47+
indent_size = 2
48+
49+
[*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}]
50+
end_of_line = crlf
51+
52+
; this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited.
53+
; the settings are meant to closely match what VS does to minimize unnecessary diffs.
54+
[*.{vcxproj,vcxproj.filters}]
55+
indent_style = space
56+
indent_size = 2
57+
end_of_line = crlf
58+
charset = utf-8-bom
59+
trim_trailing_whitespace = true
60+
insert_final_newline = false
61+
; must be broken out because of 51-char bug (https://github.com/editorconfig/editorconfig-visualstudio/issues/21)
62+
[*.{csproj,pyproj,props,targets}]
63+
indent_style = space
64+
indent_size = 2
65+
end_of_line = crlf
66+
charset = utf-8-bom
67+
trim_trailing_whitespace = true
68+
insert_final_newline = false
69+
[*.{sln,sln.template}]
70+
indent_style = tab
71+
indent_size = 4
72+
end_of_line = crlf
73+
charset = utf-8
74+
trim_trailing_whitespace = true
75+
insert_final_newline = false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Unity Robotics Forum
4+
url: https://forum.unity.com/forums/robotics.623/
5+
about: Discussions and questions about Unity Robotics tools, demos, or integrations.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Provide any relevant links here.
1616

1717
## Testing and Verification
1818

19-
Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment.
19+
Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment.
2020

2121
### Test Configuration:
2222
- Unity Version: [e.g. Unity 2020.2.0f1]
@@ -27,8 +27,9 @@ Please describe the tests that you ran to verify your changes. Please also provi
2727
## Checklist
2828
- [ ] Ensured this PR is up-to-date with the `dev` branch
2929
- [ ] Created this PR to target the `dev` branch
30-
- [ ] Followed the style guidelines as described in the [Contribution Guidelines](../CONTRIBUTING.md)
30+
- [ ] Followed the style guidelines as described in the [Contribution Guidelines](https://github.com/Unity-Technologies/ROS-TCP-Connector/blob/main/CONTRIBUTING.md)
3131
- [ ] Added tests that prove my fix is effective or that my feature works
32+
- [ ] Updated the [Changelog](https://github.com/Unity-Technologies/ROS-TCP-Connector/blob/dev/com.unity.robotics.ros-tcp-connector/CHANGELOG.md) and described changes in the [Unreleased section](https://github.com/Unity-Technologies/ROS-TCP-Connector/blob/dev/com.unity.robotics.ros-tcp-connector/CHANGELOG.md#unreleased)
3233
- [ ] Updated the documentation as appropriate
3334

3435
## Other comments

.github/workflows/pre-commit.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pre-commit:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.7.x
14+
- uses: actions/setup-dotnet@v1
15+
with:
16+
dotnet-version: '3.1.x'
17+
- uses: pre-commit/action@v2.0.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
.DS_Store
33
*.swp
4+
*.vscode/

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: mixed-line-ending
6+
exclude: >
7+
(?x)^(
8+
.*cs.meta|
9+
.*.css|
10+
.*.meta|
11+
.*.mat|
12+
.*.preset|
13+
.*.lighting
14+
)$
15+
args: [--fix=lf]
16+
17+
- id: trailing-whitespace
18+
name: trailing-whitespace-markdown
19+
types: [markdown]
20+
- id: check-merge-conflict
21+
args: [--assume-in-merge]
22+
- id: check-yaml
23+
# Won't handle the templating in yamato
24+
exclude: \.yamato/.*
25+
26+
27+
- repo: https://github.com/dotnet/format
28+
rev: "7e343070a0355c86f72bdee226b5e19ffcbac931"
29+
hooks:
30+
- id: dotnet-format
31+
args: [--folder, --include]

.yamato/yamato-config.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ commands:
99
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
1010
- unity-downloader-cli -u 2020.2.0b9 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
1111
- git clone git@github.cds.internal.unity3d.com:unity/utr.git utr
12-
- utr/utr --testproject=./TestRosTcpConnector --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor
12+
- utr/utr --testproject=./TestRosTcpConnector --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --enable-code-coverage --coverage-results-path=../test-results --coverage-options="assemblyFilters:+Unity.Robotics.ROSTCPConnector,+Unity.Robotics.ROSTCPConnector.Editor;generateHtmlReport;generateBadgeReport;generateAdditionalMetrics"
13+
# check test coverage
14+
- command: |
15+
linecoverage=$(cat test-results/Report/Summary.xml | grep Linecoverage | grep -Eo '[+-]?[0-9]+([.][0-9]+)?')
16+
echo "Line coverage: $linecoverage%"
17+
if (( $(echo "$linecoverage < 0" | bc -l) )); then exit 1; fi
1318
triggers:
1419
cancel_old_ci: true
1520
expression: |
1621
(pull_request.target eq "main" AND
1722
NOT pull_request.push.changes.all match "**/*.md") OR
18-
(push.branch eq "dev" AND
19-
NOT push.changes.all match "**/*.md")
23+
(pull_request.target eq "dev" AND
24+
NOT pull_request.push.changes.all match "**/*.md")
2025
artifacts:
2126
logs:
2227
paths:

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contribution Guidelines
22

3-
Thank you for your interest in contributing to Unity Robotics! To facilitate your
4-
contributions, we've outlined a brief set of guidelines to ensure that your extensions
3+
Thank you for your interest in contributing to Unity Robotics! To facilitate your
4+
contributions, we've outlined a brief set of guidelines to ensure that your extensions
55
can be easily integrated.
66

77
## Communication
@@ -40,10 +40,10 @@ We run continuous integration on all PRs; all tests must be passing before the P
4040

4141
All Python code should follow the [PEP 8 style guidelines](https://pep8.org/).
4242

43-
All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions).
44-
Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html)
45-
can be used to format, encode, and lint your code according to the standard Unity
46-
development conventions. Be aware that these Unity conventions will supersede the
43+
All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions).
44+
Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html)
45+
can be used to format, encode, and lint your code according to the standard Unity
46+
development conventions. Be aware that these Unity conventions will supersede the
4747
Microsoft C# Coding Conventions where applicable.
4848

4949
Please note that even if the code you are changing does not adhere to these guidelines,
@@ -60,5 +60,5 @@ email us at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com).
6060

6161
## Contribution review
6262

63-
Once you have a change ready following the above ground rules, simply make a
63+
Once you have a change ready following the above ground rules, simply make a
6464
pull request in GitHub.

MessageGeneration.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Message Generation
2-
3-
To work with a ROS message in Unity, you first need to generate the corresponding C# message class. Select the menu option "RosMessageGeneration->Browse..." to open the message browser.
4-
5-
![](images~/MessageBrowser.png)
6-
7-
Select your ROS message folder at the top, then you can navigate through the folder structure to find the .msg files. Click the "Build msg" button to build the messages you want.
8-
9-
# Message importers
10-
11-
For a more automated workflow, you may find it useful to simply drag an entire ROS module folder into your Unity project. Unity will automatically find any .msg and .srv files in the folder structure, and convert them into C# message classes for you. And the classes will be updated if the .msg or .srv files change on disk.
12-
13-
NB: The message generation system looks for a ROS package.xml to determine what code to generate, so if you're working this way it's recommended to import an entire ROS module, rather than individual .msg files, into your Unity project.
1+
# Message Generation
2+
3+
To work with a ROS message in Unity, you first need to generate the corresponding C# message class. Select the menu option "RosMessageGeneration->Browse..." to open the message browser.
4+
5+
![](images~/MessageBrowser.png)
6+
7+
Select your ROS message folder at the top, then you can navigate through the folder structure to find the .msg files. Click the "Build msg" button to build the messages you want.
8+
9+
# Message importers
10+
11+
For a more automated workflow, you may find it useful to simply drag an entire ROS module folder into your Unity project. Unity will automatically find any .msg and .srv files in the folder structure, and convert them into C# message classes for you. And the classes will be updated if the .msg or .srv files change on disk.
12+
13+
NB: The message generation system looks for a ROS package.xml to determine what code to generate, so if you're working this way it's recommended to import an entire ROS module, rather than individual .msg files, into your Unity project.

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44

55
## Installation
6-
1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..."
6+
1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..."
77
![image](https://user-images.githubusercontent.com/29758400/110989310-8ea36180-8326-11eb-8318-f67ee200a23d.png)
8-
2. Enter the following URL. If you don't want to use the latest version, substitute your desired version tag where we've put `v0.3.0` in this example:
9-
`https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.3.0`
8+
2. Enter the following URL. If you don't want to use the latest version, substitute your desired version tag where we've put `v0.4.0` in this example:
9+
`https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.4.0`
1010
3. Click `Add`.
1111

1212

13-
## Tutorials
13+
## Tutorials
1414
Scripts used to send [ROS](https://www.ros.org/) messages to an [TCP endpoint](https://github.com/Unity-Technologies/ROS_TCP_Endpoint) running as a ROS node.
1515

1616
This Unity package provides three main features:
1717

18-
- ROSConnection: See the [Unity Robotics Hub](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/master/tutorials/ros_unity_integration/README.md) repository for information and tutorials on how to use this component.
18+
- ROSConnection: See the [Unity Robotics Hub](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/ros_unity_integration/README.md) repository for information and tutorials on how to use this component.
1919

2020
- [Message Generation](MessageGeneration.md)
2121

@@ -27,16 +27,17 @@ Special thanks to the Siemens [ROS# Project Team]( https://github.com/siemens/ro
2727

2828
## Community and Feedback
2929

30-
The Unity Robotics projects are open-source and we encourage and welcome contributions.
31-
If you wish to contribute, be sure to review our [contribution guidelines](CONTRIBUTING.md)
30+
The Unity Robotics projects are open-source and we encourage and welcome contributions.
31+
If you wish to contribute, be sure to review our [contribution guidelines](CONTRIBUTING.md)
3232
and [code of conduct](CODE_OF_CONDUCT.md).
3333

3434
## Support
35-
For general questions, feedback, or feature requests, connect directly with the
36-
Robotics team at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com).
35+
For questions or discussions about Unity Robotics package installations or how to best set up and integrate your robotics projects, please create a new thread on the [Unity Robotics forum](https://forum.unity.com/forums/robotics.623/) and make sure to include as much detail as possible.
36+
37+
For feature requests, bugs, or other issues, please file a [GitHub issue](https://github.com/Unity-Technologies/ROS-TCP-Connector/issues) using the provided templates and the Robotics team will investigate as soon as possible.
3738

38-
For bugs or other issues, please file a GitHub issue and the Robotics team will
39-
investigate the issue as soon as possible.
39+
For any other questions or feedback, connect directly with the
40+
Robotics team at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com).
4041

4142
## License
4243
[Apache License 2.0](LICENSE)

0 commit comments

Comments
 (0)