-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from robotpilot/develop
Bump to 0.4.0
- Loading branch information
Showing
52 changed files
with
1,245 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
79 changes: 79 additions & 0 deletions
79
logging_rclpy_example/logging_rclpy_example/logging_example/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.