From 7fa8211bd144ad1033e53fac79ea0a537ba8067e Mon Sep 17 00:00:00 2001 From: gcielniak Date: Wed, 2 Oct 2024 17:23:54 +0100 Subject: [PATCH] restructured tutorial package and launch file added --- src/.keep | 0 .../rob2002_tutorial}/LICENSE | 0 .../launch/detect_count.launch.py | 24 +++++++++++++++++++ .../rob2002_tutorial}/package.xml | 1 + .../resource/rob2002_tutorial | 0 .../rob2002_tutorial/__init__.py | 0 .../rob2002_tutorial/counter_basic.py | 0 .../rob2002_tutorial/detector_basic.py | 0 .../rob2002_tutorial/mover_basic.py | 0 .../rob2002_tutorial/mover_laser.py | 0 .../rob2002_tutorial}/setup.cfg | 0 .../rob2002_tutorial}/setup.py | 3 +++ .../rob2002_tutorial}/test/test_copyright.py | 0 .../rob2002_tutorial}/test/test_flake8.py | 0 .../rob2002_tutorial}/test/test_pep257.py | 0 15 files changed, 28 insertions(+) delete mode 100644 src/.keep rename {rob2002_tutorial => src/rob2002_tutorial}/LICENSE (100%) create mode 100644 src/rob2002_tutorial/launch/detect_count.launch.py rename {rob2002_tutorial => src/rob2002_tutorial}/package.xml (95%) rename {rob2002_tutorial => src/rob2002_tutorial}/resource/rob2002_tutorial (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/rob2002_tutorial/__init__.py (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/rob2002_tutorial/counter_basic.py (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/rob2002_tutorial/detector_basic.py (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/rob2002_tutorial/mover_basic.py (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/rob2002_tutorial/mover_laser.py (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/setup.cfg (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/setup.py (90%) rename {rob2002_tutorial => src/rob2002_tutorial}/test/test_copyright.py (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/test/test_flake8.py (100%) rename {rob2002_tutorial => src/rob2002_tutorial}/test/test_pep257.py (100%) diff --git a/src/.keep b/src/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/rob2002_tutorial/LICENSE b/src/rob2002_tutorial/LICENSE similarity index 100% rename from rob2002_tutorial/LICENSE rename to src/rob2002_tutorial/LICENSE diff --git a/src/rob2002_tutorial/launch/detect_count.launch.py b/src/rob2002_tutorial/launch/detect_count.launch.py new file mode 100644 index 0000000..2ba7f1a --- /dev/null +++ b/src/rob2002_tutorial/launch/detect_count.launch.py @@ -0,0 +1,24 @@ +from launch import LaunchDescription +from launch_ros.actions import Node + +def generate_launch_description(): + ld = LaunchDescription() + + detector_node = Node( + package='rob2002_tutorial', + executable='detector_basic', + output='screen', + emulate_tty=True, + ) + + counter_node = Node( + package='rob2002_tutorial', + executable='counter_basic', + output='screen', + emulate_tty=True, + ) + + ld.add_action(detector_node) + ld.add_action(counter_node) + + return ld diff --git a/rob2002_tutorial/package.xml b/src/rob2002_tutorial/package.xml similarity index 95% rename from rob2002_tutorial/package.xml rename to src/rob2002_tutorial/package.xml index a913624..643e4c0 100644 --- a/rob2002_tutorial/package.xml +++ b/src/rob2002_tutorial/package.xml @@ -12,6 +12,7 @@ geometry_msgs sensor_msgs cv_bridge + ros2launch ament_copyright ament_flake8 diff --git a/rob2002_tutorial/resource/rob2002_tutorial b/src/rob2002_tutorial/resource/rob2002_tutorial similarity index 100% rename from rob2002_tutorial/resource/rob2002_tutorial rename to src/rob2002_tutorial/resource/rob2002_tutorial diff --git a/rob2002_tutorial/rob2002_tutorial/__init__.py b/src/rob2002_tutorial/rob2002_tutorial/__init__.py similarity index 100% rename from rob2002_tutorial/rob2002_tutorial/__init__.py rename to src/rob2002_tutorial/rob2002_tutorial/__init__.py diff --git a/rob2002_tutorial/rob2002_tutorial/counter_basic.py b/src/rob2002_tutorial/rob2002_tutorial/counter_basic.py similarity index 100% rename from rob2002_tutorial/rob2002_tutorial/counter_basic.py rename to src/rob2002_tutorial/rob2002_tutorial/counter_basic.py diff --git a/rob2002_tutorial/rob2002_tutorial/detector_basic.py b/src/rob2002_tutorial/rob2002_tutorial/detector_basic.py similarity index 100% rename from rob2002_tutorial/rob2002_tutorial/detector_basic.py rename to src/rob2002_tutorial/rob2002_tutorial/detector_basic.py diff --git a/rob2002_tutorial/rob2002_tutorial/mover_basic.py b/src/rob2002_tutorial/rob2002_tutorial/mover_basic.py similarity index 100% rename from rob2002_tutorial/rob2002_tutorial/mover_basic.py rename to src/rob2002_tutorial/rob2002_tutorial/mover_basic.py diff --git a/rob2002_tutorial/rob2002_tutorial/mover_laser.py b/src/rob2002_tutorial/rob2002_tutorial/mover_laser.py similarity index 100% rename from rob2002_tutorial/rob2002_tutorial/mover_laser.py rename to src/rob2002_tutorial/rob2002_tutorial/mover_laser.py diff --git a/rob2002_tutorial/setup.cfg b/src/rob2002_tutorial/setup.cfg similarity index 100% rename from rob2002_tutorial/setup.cfg rename to src/rob2002_tutorial/setup.cfg diff --git a/rob2002_tutorial/setup.py b/src/rob2002_tutorial/setup.py similarity index 90% rename from rob2002_tutorial/setup.py rename to src/rob2002_tutorial/setup.py index c575d5e..609caa0 100644 --- a/rob2002_tutorial/setup.py +++ b/src/rob2002_tutorial/setup.py @@ -1,4 +1,6 @@ from setuptools import find_packages, setup +import os +from glob import glob package_name = 'rob2002_tutorial' @@ -10,6 +12,7 @@ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), + (os.path.join('share', package_name), glob('launch/*launch.py')), ], install_requires=['setuptools'], zip_safe=True, diff --git a/rob2002_tutorial/test/test_copyright.py b/src/rob2002_tutorial/test/test_copyright.py similarity index 100% rename from rob2002_tutorial/test/test_copyright.py rename to src/rob2002_tutorial/test/test_copyright.py diff --git a/rob2002_tutorial/test/test_flake8.py b/src/rob2002_tutorial/test/test_flake8.py similarity index 100% rename from rob2002_tutorial/test/test_flake8.py rename to src/rob2002_tutorial/test/test_flake8.py diff --git a/rob2002_tutorial/test/test_pep257.py b/src/rob2002_tutorial/test/test_pep257.py similarity index 100% rename from rob2002_tutorial/test/test_pep257.py rename to src/rob2002_tutorial/test/test_pep257.py