Skip to content

Commit

Permalink
Merge pull request #22 from robotpilot/develop
Browse files Browse the repository at this point in the history
Bump to 0.4.0
  • Loading branch information
routiful authored Feb 22, 2021
2 parents c581c4d + 65d1517 commit 41493cd
Show file tree
Hide file tree
Showing 52 changed files with 1,245 additions and 18 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ jobs:
linter: [cppcheck, cpplint, uncrustify, pep257, xmllint, flake8]
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/setup-ros@0.1.0
- uses: ros-tooling/action-ros-lint@0.0.6
- uses: ros-tooling/setup-ros@master
- uses: ros-tooling/action-ros-lint@master
with:
distribution: foxy
linter: ${{ matrix.linter }}
package-name: |
time_rclcpp_example
logging_rclpy_example
msg_srv_action_interface_example
my_first_ros_rclcpp_pkg
my_first_ros_rclpy_pkg
msg_srv_action_interface_example
topic_service_action_rclpy_example
topic_service_action_rclcpp_example
ros2env
rqt_example
time_rclcpp_example
time_rclpy_example
topic_service_action_rclcpp_example
topic_service_action_rclpy_example
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,14 @@ ROS_PYTHON_VERSION = 3
ROS_DOMAIN_ID = 7
RMW_IMPLEMENTATION = rmw_fastrtps_cpp
```

## Run rqt_example package
```
ros2 run rqt_example rqt_example
ros2 launch rqt_example turtlesim.launch.py
```

## Run logging_rclpy_example package
```
$ ros2 run logging_rclpy_example logging_example
```
8 changes: 8 additions & 0 deletions logging_rclpy_example/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package logging_rclpy_example
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.4.0 (2021-02-22)
------------------
* Added new ROS 2 logging example package using rclpy's logging module for ROS 2 seminar
* Contributors: Darby Lim
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Copyright 2021 OROCA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import rclpy
from rclpy.logging import LoggingSeverity
from rclpy.node import Node
from std_msgs.msg import String


class LoggerUsage(Node):

def __init__(self):
super().__init__('logger_usage_demo')
self.pub = self.create_publisher(String, 'logging_demo_count', 10)
self.timer = self.create_timer(0.500, self.on_timer)
self.count = 0

def on_timer(self):
self.get_logger().log(
'Timer callback called (this will only log once)',
LoggingSeverity.INFO,
once=True)

msg = String()
msg.data = 'Current count: {0}'.format(self.count)

self.get_logger().info('Publishing: {0}'.format(msg.data))
self.pub.publish(msg)

# DEBUG FUNCTION
if self.debug_function_to_evaluate():
self.get_logger().debug('Count divides into 12 (function evaluated to true)')

# DEBUG EXPRESSION
if self.count % 2 == 0:
self.get_logger().debug('Count is even (expression evaluated to true)')

self.count += 1
if self.count > 15:
self.get_logger().warn('Reseting count to 0')
self.count = 0

def debug_function_to_evaluate(self):
return is_divisor_of_twelve(self.count, self.get_logger())


def is_divisor_of_twelve(val, logger):
if val == 0:
logger.error('Modulo divisor cannot be 0')
return False

return (12 % val) == 0


def main(args=None):
rclpy.init(args=args)
node = LoggerUsage()
try:
rclpy.spin(node)
except KeyboardInterrupt:
node.get_logger().info('Keyboard Interrupt (SIGINT)')
finally:
node.destroy_node()
rclpy.shutdown()


if __name__ == '__main__':
main()
20 changes: 20 additions & 0 deletions logging_rclpy_example/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>logging_rclpy_example</name>
<version>0.4.0</version>
<description>ROS 2 rclpy example package for understanding logging</description>
<maintainer email="[email protected]">Pyo</maintainer>
<license>Apache License 2.0</license>
<author email="[email protected]">Pyo</author>
<author email="[email protected]">Darby Lim</author>
<depend>rclpy</depend>
<depend>std_msgs</depend>
<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>python3-pytest</test_depend>
<export>
<build_type>ament_python</build_type>
</export>
</package>
Empty file.
4 changes: 4 additions & 0 deletions logging_rclpy_example/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[develop]
script-dir=$base/lib/logging_rclpy_example
[install]
install-scripts=$base/lib/logging_rclpy_example
35 changes: 35 additions & 0 deletions logging_rclpy_example/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from setuptools import find_packages
from setuptools import setup

package_name = 'logging_rclpy_example'

setup(
name=package_name,
version='0.4.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/ament_index/resource_index/packages', ['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
install_requires=['setuptools'],
zip_safe=True,
author='Pyo, Darby Lim',
author_email='[email protected], [email protected]',
maintainer='Pyo',
maintainer_email='[email protected]',
keywords=['ROS'],
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Topic :: Software Development',
],
description='ROS 2 rclpy example package for understanding logging',
license='Apache License, Version 2.0',
tests_require=['pytest'],
entry_points={
'console_scripts': [
'logging_example = logging_rclpy_example.logging_example.main:main',
],
},
)
23 changes: 23 additions & 0 deletions logging_rclpy_example/test/test_copyright.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_copyright.main import main
import pytest


@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found errors'
23 changes: 23 additions & 0 deletions logging_rclpy_example/test/test_flake8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_flake8.main import main
import pytest


@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
rc = main(argv=[])
assert rc == 0, 'Found errors'
23 changes: 23 additions & 0 deletions logging_rclpy_example/test/test_pep257.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_pep257.main import main
import pytest


@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found code style errors / warnings'
3 changes: 3 additions & 0 deletions msg_srv_action_interface_example/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package msg_srv_action_interface_example
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.4.0 (2021-02-22)
------------------

0.3.0 (2021-01-28)
------------------

Expand Down
2 changes: 1 addition & 1 deletion msg_srv_action_interface_example/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>msg_srv_action_interface_example</name>
<version>0.3.0</version>
<version>0.4.0</version>
<description>
ROS 2 example for message, service and action interface
</description>
Expand Down
3 changes: 3 additions & 0 deletions my_first_ros_rclcpp_pkg/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package my_first_ros_rclcpp_pkg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.4.0 (2021-02-22)
------------------

0.3.0 (2021-01-28)
------------------

Expand Down
2 changes: 1 addition & 1 deletion my_first_ros_rclcpp_pkg/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>my_first_ros_rclcpp_pkg</name>
<version>0.3.0</version>
<version>0.4.0</version>
<description>ROS 2 rclcpp basic package for the ROS 2 seminar</description>
<maintainer email="[email protected]">Pyo</maintainer>
<license>Apache License 2.0</license>
Expand Down
3 changes: 3 additions & 0 deletions my_first_ros_rclpy_pkg/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package my_first_ros_rclpy_pkg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.4.0 (2021-02-22)
------------------

0.3.0 (2021-01-28)
------------------

Expand Down
2 changes: 1 addition & 1 deletion my_first_ros_rclpy_pkg/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>my_first_ros_rclpy_pkg</name>
<version>0.3.0</version>
<version>0.4.0</version>
<description>ROS 2 rclpy basic package for the ROS 2 seminar</description>
<maintainer email="[email protected]">Pyo</maintainer>
<license>Apache License 2.0</license>
Expand Down
2 changes: 1 addition & 1 deletion my_first_ros_rclpy_pkg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name=package_name,
version='0.3.0',
version='0.4.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/ament_index/resource_index/packages',
Expand Down
3 changes: 3 additions & 0 deletions ros2env/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package ros2env
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.4.0 (2021-02-22)
------------------

0.3.0 (2021-01-28)
------------------
* Added ros2cli command and verbs for example of roc2cli
Expand Down
2 changes: 1 addition & 1 deletion ros2env/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ros2env</name>
<version>0.3.0</version>
<version>0.4.0</version>
<description>ROS 2 example package for the ROS 2 command line tools.</description>
<maintainer email="[email protected]">Pyo</maintainer>
<license>Apache License 2.0</license>
Expand Down
2 changes: 1 addition & 1 deletion ros2env/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name=package_name,
version='0.3.0',
version='0.4.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/ament_index/resource_index/packages', ['resource/' + package_name]),
Expand Down
30 changes: 30 additions & 0 deletions rqt_example/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package rqt_example
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.4.0 (2021-02-22)
------------------
* Added a launch file for running with turtlesim node
* Code refactoring
* Contributors: Pyo

0.3.0 (2021-01-29)
------------------
* Changed code for new ROS 2 seminar
* Contributors: Pyo

0.2.1 (2019-08-09)
------------------
* Changed text of keypad for O/S's compatibility
* Changed code for PEP-8 and bumped to new version
* Contributors: Pyo

0.2.0 (2019-08-01)
------------------
* Improved code using new code style guides
* Contributors: Pyo

0.1.0 (2019-06-18)
------------------
* Added examples_rqt as rqt plugin for visualizing messages and services
* Contributors: Pyo, Darby Lim
Loading

0 comments on commit 41493cd

Please sign in to comment.