Skip to content

Commit b8c52b5

Browse files
ROS2 updates
1 parent 127a8a0 commit b8c52b5

File tree

9 files changed

+124
-20
lines changed

9 files changed

+124
-20
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ jobs:
1010
- uses: actions/checkout@v2
1111
- uses: actions/setup-python@v2
1212
with:
13-
python-version: 3.7.x
14-
- uses: pre-commit/action@v2.0.0
13+
python-version: 3.7.x

launch/endpoint.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from launch import LaunchDescription
2+
from launch_ros.actions import Node
3+
4+
5+
def generate_launch_description():
6+
return LaunchDescription(
7+
[
8+
Node(
9+
package="ros_tcp_endpoint",
10+
executable="default_server_endpoint",
11+
emulate_tty=True,
12+
parameters=[{"ROS_IP": "0.0.0.0"}, {"ROS_TCP_PORT": 10000}],
13+
)
14+
]
15+
)

package.xml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
<?xml version="1.0"?>
2-
<package format="2">
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
34
<name>ros_tcp_endpoint</name>
45
<version>0.6.0</version>
5-
<description>Acts as the bridge between Unity messages sent via Websocket and ROS messages.</description>
6-
6+
<description>ROS TCP Endpoint Unity Integration (ROS2 version)
7+
Acts as the bridge between Unity messages sent via TCP socket and ROS messages.
8+
</description>
79
<maintainer email="unity-robotics@unity3d.com">Unity Robotics</maintainer>
8-
910
<license>Apache 2.0</license>
10-
<buildtool_depend>catkin</buildtool_depend>
11-
<build_depend>rospy</build_depend>
12-
<build_depend>message_generation</build_depend>
13-
<build_export_depend>rospy</build_export_depend>
14-
<exec_depend>rospy</exec_depend>
15-
<exec_depend>message_runtime</exec_depend>
1611

12+
<test_depend>ament_copyright</test_depend>
13+
<test_depend>ament_flake8</test_depend>
14+
<test_depend>ament_pep257</test_depend>
15+
<test_depend>python3-pytest</test_depend>
1716

18-
<!-- The export tag contains other, unspecified, tags -->
1917
<export>
20-
<!-- Other tools can request additional information be placed here -->
21-
18+
<build_type>ament_python</build_type>
2219
</export>
2320
</package>

resource/ros_tcp_endpoint

Whitespace-only changes.

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[develop]
2+
script-dir=$base/lib/ros_tcp_endpoint
3+
[install]
4+
install-scripts=$base/lib/ros_tcp_endpoint

setup.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1-
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
1+
import os
22

33
from setuptools import setup
4-
from catkin_pkg.python_setup import generate_distutils_setup
54

6-
# fetch values from package.xml
7-
setup_args = generate_distutils_setup(packages=["ros_tcp_endpoint"], package_dir={"": "src"})
5+
package_name = "ros_tcp_endpoint"
6+
share_dir = os.path.join("share", package_name)
87

9-
setup(**setup_args)
8+
setup(
9+
name=package_name,
10+
version="0.0.1",
11+
packages=[package_name],
12+
data_files=[
13+
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
14+
(share_dir, ["package.xml"]),
15+
(os.path.join(share_dir, "launch"), ["launch/endpoint.py"]),
16+
],
17+
install_requires=["setuptools"],
18+
zip_safe=True,
19+
maintainer="Unity Robotics",
20+
maintainer_email="unity-robotics@unity3d.com",
21+
description="ROS TCP Endpoint Unity Integration (ROS2 version)",
22+
license="Apache 2.0",
23+
tests_require=["pytest"],
24+
entry_points={
25+
"console_scripts": [
26+
"default_server_endpoint = ros_tcp_endpoint.default_server_endpoint:main"
27+
]
28+
},
29+
)

test/test_copyright.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2015 Open Source Robotics Foundation, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from ament_copyright.main import main
16+
import pytest
17+
18+
19+
@pytest.mark.copyright
20+
@pytest.mark.linter
21+
def test_copyright():
22+
rc = main(argv=[".", "test"])
23+
assert rc == 0, "Found errors"

test/test_flake8.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2017 Open Source Robotics Foundation, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from ament_flake8.main import main_with_errors
16+
import pytest
17+
18+
19+
@pytest.mark.flake8
20+
@pytest.mark.linter
21+
def test_flake8():
22+
rc, errors = main_with_errors(argv=[])
23+
assert rc == 0, "Found %d code style errors / warnings:\n" % len(errors) + "\n".join(errors)

test/test_pep257.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2015 Open Source Robotics Foundation, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from ament_pep257.main import main
16+
import pytest
17+
18+
19+
@pytest.mark.linter
20+
@pytest.mark.pep257
21+
def test_pep257():
22+
rc = main(argv=[".", "test"])
23+
assert rc == 0, "Found code style errors / warnings"

0 commit comments

Comments
 (0)