Skip to content

Commit

Permalink
Merge dev to main for release 0.4.0 (#113)
Browse files Browse the repository at this point in the history
* 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) <[email protected]>
Co-authored-by: Amanda <[email protected]>
Co-authored-by: vidurvij-Unity <[email protected]>
Co-authored-by: peifeng-unity <[email protected]>

* Remove deprecated files

Co-authored-by: LaurieCheers-unity <[email protected]>
Co-authored-by: Devin Miller (Unity) <[email protected]>
Co-authored-by: Amanda <[email protected]>
Co-authored-by: vidurvij-Unity <[email protected]>
Co-authored-by: peifeng-unity <[email protected]>

* add changelog meta file (#109)

* update version to 0.4.0 (#110)

* rremove stale merge

Co-authored-by: Devin Miller (Unity) <[email protected]>
Co-authored-by: LaurieCheers-unity <[email protected]>
Co-authored-by: Amanda <[email protected]>
Co-authored-by: vidurvij-Unity <[email protected]>
Co-authored-by: peifeng-unity <[email protected]>
Co-authored-by: Devin Miller (Unity) <[email protected]>
Co-authored-by: peifeng-unity <[email protected]>
  • Loading branch information
8 people authored Jun 1, 2021
1 parent 8ee9d5c commit 1588c15
Show file tree
Hide file tree
Showing 404 changed files with 1,459 additions and 1,228 deletions.
75 changes: 75 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
; see http://editorconfig.org/ for docs on this file
; See https://github.com/dotnet/format for dotnet format

root = true

[*]
ignore_if_in_header = This code was generated by a tool|<auto-generated>
indent_style = space
indent_size = 4
; uncomment to help with sharing files across os's (i.e. network share or through local vm)
#end_of_line = lf
; avoid a bom, which causes endless problems with naive text tooling
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
; keeping auto-format enabled helps avoid merge hell for projects without CI-based format validation
#disable_auto_format = true

[*.cs]
; uncomment to enable full formatting of c# files
formatters = generic, uncrustify

[*.asmdef]
scrape_api = true

[**/Tests/**.asmdef]
scrape_api = false

[*.Tests.asmdef]
scrape_api = false

[*.md]
indent_size = 2
; trailing whitespace is unfortunately significant in markdown
trim_trailing_whitespace = false
; uncomment to enable basic formatting of markdown files
#formatters = generic

[{Makefile,makefile}]
; tab characters are part of the Makefile format
indent_style = tab

[*.asmdef]
indent_size = 4

[*.json]
indent_size = 2

[*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}]
end_of_line = crlf

; this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited.
; the settings are meant to closely match what VS does to minimize unnecessary diffs.
[*.{vcxproj,vcxproj.filters}]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8-bom
trim_trailing_whitespace = true
insert_final_newline = false
; must be broken out because of 51-char bug (https://github.com/editorconfig/editorconfig-visualstudio/issues/21)
[*.{csproj,pyproj,props,targets}]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8-bom
trim_trailing_whitespace = true
insert_final_newline = false
[*.{sln,sln.template}]
indent_style = tab
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Unity Robotics Forum
url: https://forum.unity.com/forums/robotics.623/
about: Discussions and questions about Unity Robotics tools, demos, or integrations.
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Provide any relevant links here.

## Testing and Verification

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.
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.

### Test Configuration:
- Unity Version: [e.g. Unity 2020.2.0f1]
Expand All @@ -27,8 +27,9 @@ Please describe the tests that you ran to verify your changes. Please also provi
## Checklist
- [ ] Ensured this PR is up-to-date with the `dev` branch
- [ ] Created this PR to target the `dev` branch
- [ ] Followed the style guidelines as described in the [Contribution Guidelines](../CONTRIBUTING.md)
- [ ] Followed the style guidelines as described in the [Contribution Guidelines](https://github.com/Unity-Technologies/ROS-TCP-Connector/blob/main/CONTRIBUTING.md)
- [ ] Added tests that prove my fix is effective or that my feature works
- [ ] 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)
- [ ] Updated the documentation as appropriate

## Other comments
17 changes: 17 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pre-commit

on:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7.x
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- uses: pre-commit/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.DS_Store
*.swp
*.vscode/
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: mixed-line-ending
exclude: >
(?x)^(
.*cs.meta|
.*.css|
.*.meta|
.*.mat|
.*.preset|
.*.lighting
)$
args: [--fix=lf]

- id: trailing-whitespace
name: trailing-whitespace-markdown
types: [markdown]
- id: check-merge-conflict
args: [--assume-in-merge]
- id: check-yaml
# Won't handle the templating in yamato
exclude: \.yamato/.*


- repo: https://github.com/dotnet/format
rev: "7e343070a0355c86f72bdee226b5e19ffcbac931"
hooks:
- id: dotnet-format
args: [--folder, --include]
11 changes: 8 additions & 3 deletions .yamato/yamato-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ commands:
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- unity-downloader-cli -u 2020.2.0b9 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
- git clone [email protected]:unity/utr.git utr
- utr/utr --testproject=./TestRosTcpConnector --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor
- 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"
# check test coverage
- command: |
linecoverage=$(cat test-results/Report/Summary.xml | grep Linecoverage | grep -Eo '[+-]?[0-9]+([.][0-9]+)?')
echo "Line coverage: $linecoverage%"
if (( $(echo "$linecoverage < 0" | bc -l) )); then exit 1; fi
triggers:
cancel_old_ci: true
expression: |
(pull_request.target eq "main" AND
NOT pull_request.push.changes.all match "**/*.md") OR
(push.branch eq "dev" AND
NOT push.changes.all match "**/*.md")
(pull_request.target eq "dev" AND
NOT pull_request.push.changes.all match "**/*.md")
artifacts:
logs:
paths:
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contribution Guidelines

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

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

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

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).
Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/[email protected]/manual/index.html)
can be used to format, encode, and lint your code according to the standard Unity
development conventions. Be aware that these Unity conventions will supersede the
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).
Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/[email protected]/manual/index.html)
can be used to format, encode, and lint your code according to the standard Unity
development conventions. Be aware that these Unity conventions will supersede the
Microsoft C# Coding Conventions where applicable.

Please note that even if the code you are changing does not adhere to these guidelines,
Expand All @@ -60,5 +60,5 @@ email us at [[email protected]](mailto:[email protected]).

## Contribution review

Once you have a change ready following the above ground rules, simply make a
Once you have a change ready following the above ground rules, simply make a
pull request in GitHub.
26 changes: 13 additions & 13 deletions MessageGeneration.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Message Generation

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.

![](images~/MessageBrowser.png)

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.

# Message importers

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.

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.
# Message Generation

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.

![](images~/MessageBrowser.png)

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.

# Message importers

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.

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.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

## Installation
1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..."
1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..."
![image](https://user-images.githubusercontent.com/29758400/110989310-8ea36180-8326-11eb-8318-f67ee200a23d.png)
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:
`https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.3.0`
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:
`https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.4.0`
3. Click `Add`.


## Tutorials
## Tutorials
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.

This Unity package provides three main features:

- 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.
- 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.

- [Message Generation](MessageGeneration.md)

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

## Community and Feedback

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

## Support
For general questions, feedback, or feature requests, connect directly with the
Robotics team at [[email protected]](mailto:[email protected]).
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.

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.

For bugs or other issues, please file a GitHub issue and the Robotics team will
investigate the issue as soon as possible.
For any other questions or feedback, connect directly with the
Robotics team at [[email protected]](mailto:[email protected]).

## License
[Apache License 2.0](LICENSE)
Loading

0 comments on commit 1588c15

Please sign in to comment.