Skip to content

Commit

Permalink
Merge Dev to main for release 0.4.0 (#74)
Browse files Browse the repository at this point in the history
* Add logging dependency (#32)

* Changing yamato host flavor to large (#33)

* Amanda/read chunks (#36)

* s.send to s.sendall

* Increase default timeout

* Timeout as argument on instantiation

* Update version number (#38)

* Laurie/topic list (#41)

* Updating Contribution Content (#44)

* Contributing guidelines

* Issue templates

* PR feedback

* Updated per later changes (#45)

* Adding PR template (#46)

* One persistent connection for all messages sent to Unity

* make UnityService accessible from ros_tcp_endpoint (#49)

* Don't keep retrying on success (#50)

* Resolve conflicts for merging dev to main

* Queue module was renamed in Python 3 (#53)

* Update package.xml (#54)

* RosConnection 2.0 (#57)

* Remove outdated handshake references

* Fix sending response to unity service (#59)

* add changelog (#60)

* Forum links to README, config.yml (#61)

* Send empty message on connection start (#58)

* add test coverage for python scripts (#62)

* fix the bug (#64)

* Minor bug fixes (#65)

* Add Tests and Linter (#63)

* Add tests for tcp sender

* Add linter and pre-commit hooks

* Reformat with python black

* Add tests

* Add tests for server, client, publisher, subscriber, ros_service, unity_service, thread_pauser

* Fix pre-commit-config file name; Add client tests

* Add github workflow check

* Formatting

* Resolve conflicts (#66)

* Fix bug (#68)

* Fix bug

* Temporarily remove publisher test

Co-authored-by: Shuo Diao <[email protected]>

* update version to 0.4.0 (#69)

Co-authored-by: Devin Miller (Unity) <[email protected]>
Co-authored-by: Amanda <[email protected]>
Co-authored-by: LaurieCheers-unity <[email protected]>
Co-authored-by: Hamid Younesy <[email protected]>
Co-authored-by: peifeng-unity <[email protected]>
  • Loading branch information
6 people authored Jun 1, 2021
1 parent a5e0fd1 commit 18612dc
Show file tree
Hide file tree
Showing 34 changed files with 811 additions and 222 deletions.
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-Endpoint/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-Endpoint/blob/dev/CHANGELOG.md) and described changes in the [Unreleased section](https://github.com/Unity-Technologies/ROS-TCP-Endpoint/blob/dev/CHANGELOG.md#unreleased)
- [ ] Updated the documentation as appropriate

## Other comments
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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: pre-commit/[email protected]
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/python/black
rev: 19.3b0
hooks:
- id: black
args: [--line-length=100]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
name: trailing-whitespace-markdown
types: [markdown]
23 changes: 18 additions & 5 deletions .yamato/yamato-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ agent:
image: robotics/ci-ubuntu20:latest
flavor: i1.large
commands:
- source /opt/ros/noetic/setup.bash && echo "ROS_DISTRO == $ROS_DISTRO" &&
cd .. && mkdir -p catkin_ws/src && cp -r ./ROS-TCP-Endpoint catkin_ws/src &&
cd catkin_ws && catkin_make && source devel/setup.bash && python3 -m pytest
# run unit tests and save test results in /home/bokken/build/output/Unity-Technologies/ROS-TCP-Endpoint
- command: |
source /opt/ros/noetic/setup.bash && echo "ROS_DISTRO == $ROS_DISTRO"
cd .. && mkdir -p catkin_ws/src && cp -r ./ROS-TCP-Endpoint catkin_ws/src
cd catkin_ws && catkin_make && source devel/setup.bash
cd src/ROS-TCP-Endpoint
python3 -m pytest --cov=. --cov-report xml:../../../ROS-TCP-Endpoint/test-results/coverage.xml --cov-report html:../../../ROS-TCP-Endpoint/test-results/coverage.html test/
# check the test coverage
- command: |
linecoverage=$(head -2 test-results/coverage.xml | grep -Eo 'line-rate="[0-9]+([.][0-9]+)?"' | grep -Eo "[0-9]+([.][0-9]+)?")
echo "Line coverage: $linecoverage"
if (( $(echo "$linecoverage < 0.3" | 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:
- "test-results/**/*"
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Changelog

All notable changes to this repository will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

### Upgrade Notes

### Known Issues

### Added

### Changed

### Deprecated

### Removed

### Fixed

## [0.4.0] - 2021-05-27

Note: the logs only reflects the changes from version 0.3.0

### Upgrade Notes

RosConnection 2.0: maintain a single constant connection from Unity to the Endpoint. This is more efficient than opening one connection per message, and it eliminates a whole bunch of user issues caused by ROS being unable to connect to Unity due to firewalls, proxies, etc.

### Known Issues

### Added

Add a link to the Robotics forum, and add a config.yml to add a link in the Github Issues page

Add linter, unit tests, and test coverage reporting

### Changed

### Deprecated

### Removed

Remove outdated handshake references

### Fixed
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ find_package(catkin REQUIRED COMPONENTS

catkin_python_setup()

add_message_files(DIRECTORY msg)
add_message_files(FILES
RosUnityError.msg
RosUnitySrvMessage.msg
RosUnitySysCommand.msg
)

add_service_files(DIRECTORY srv)
add_service_files(FILES
RosUnityTopicList.srv
)

generate_messages(DEPENDENCIES std_msgs)

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.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ Instructions and examples on how to use this ROS package can be found on the [Un

## 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-Endpoint/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)
2 changes: 1 addition & 1 deletion config/params.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ROS_IP: 127.0.0.1
ROS_IP: 127.0.0.1
4 changes: 4 additions & 0 deletions msg/RosUnitySrvMessage.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int32 srv_id
bool is_request
string topic
uint8[] payload
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>ros_tcp_endpoint</name>
<version>0.3.0</version>
<version>0.4.0</version>
<description>Acts as the bridge between Unity messages sent via Websocket and ROS messages.</description>

<maintainer email="[email protected]">Unity Robotics</maintainer>
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
black
pre-commit
pytest-cov
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from catkin_pkg.python_setup import generate_distutils_setup

# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['ros_tcp_endpoint'],
package_dir={'': 'src'})
setup_args = generate_distutils_setup(packages=["ros_tcp_endpoint"], package_dir={"": "src"})

setup(**setup_args)
Loading

0 comments on commit 18612dc

Please sign in to comment.