From 13a7ace07996cb0737b147eed0b27d61e19d7468 Mon Sep 17 00:00:00 2001
From: Vladislav Vlasuk <vladislav.vlasuk@th-koeln.de>
Date: Thu, 1 Aug 2024 14:01:19 +0200
Subject: [PATCH] comments

---
 __pycache__/__init__.cpython-38.pyc     | Bin 184 -> 184 bytes
 src/__pycache__/m_ros2py.cpython-38.pyc | Bin 2197 -> 2197 bytes
 src/m_ros2py.py                         |  26 ++++++++++++++++++++++--
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/__pycache__/__init__.cpython-38.pyc b/__pycache__/__init__.cpython-38.pyc
index 3d7538e2d8a9aa388f27587dc29a1a8beee086b0..a7ac6448ad83054dd05bde0e8354a7e33eb0de7b 100644
GIT binary patch
delta 24
fcmdnNxPy^9l$V!_fq{Wxf7$AZ+=YxO6KkyjNwNl#

delta 24
fcmdnNxPy^9l$V!_fq{X+O?TBq?m|YFiM7@MK^z6I

diff --git a/src/__pycache__/m_ros2py.cpython-38.pyc b/src/__pycache__/m_ros2py.cpython-38.pyc
index fc840c243ec91fc26278ea4b38b2c36e04de74d9..a4e0e0065bb873b2a389e5d16c40133fd9a5a43f 100644
GIT binary patch
delta 27
jcmbO#I8~54l$V!_fq{Wxf7$Ad+z%KTQ#QY0T*(FiU>yho

delta 27
jcmbO#I8~54l$V!_fq{X6M|;&q?gxyFE}P#lu4DrMQMd-<

diff --git a/src/m_ros2py.py b/src/m_ros2py.py
index 44c223e..4a854b7 100755
--- a/src/m_ros2py.py
+++ b/src/m_ros2py.py
@@ -1,6 +1,14 @@
+#______________________________________________________________________________________________________________________________________________
+#Author:        VV
+#Description:   Class to simplify the creation of ros2 nodes
+#Date:          01.08.24
+#______________________________________________________________________________________________________________________________________________
+#imports
 from rclpy.node import Node
 from std_msgs.msg import *
 
+#______________________________________________________________________________________________________________________________________________
+#wrapper for creating ros2 node as publisher, subscriber, clients, service
 class ros2node(Node):
     def __init__(self, nodeName):
         super().__init__(nodeName)
@@ -10,22 +18,32 @@ class ros2node(Node):
         self._services = {}
         self._clients = {}
         self.as_ClientService = False
-
+        
+#______________________________________________________________________________________________________________________________________________
+#ros2 publisher
     def create_publisher_with_timer(self, topicName, msgType, func, rate):
         self._publishers[topicName] = self.create_publisher(msgType, topicName, 10)
         self._timers[topicName] = self.create_timer(rate, lambda: self.timer_callback(topicName, func))
+#______________________________________________________________________________________________________________________________________________
+#ros2 subscriber
 
     def create_subscriber(self, topicName, msgType, func):
         self._subscribers[topicName] = self.create_subscription(msgType, topicName, func, 10)
+#______________________________________________________________________________________________________________________________________________
+#ros2 service
 
     def create_new_service(self, topicName, msgType, func):
         self._services[topicName] = self.create_service(msgType, topicName, func)
         self.as_ClientService = True
+#______________________________________________________________________________________________________________________________________________
+#ros2 client
 
     def create_new_client(self, topicName, msgType):
         self._clients[topicName] =  self.create_client(msgType, topicName) 
         self.as_ClientService = True
-        
+#______________________________________________________________________________________________________________________________________________
+#external executable callback function  
+     
     def timer_callback(self, topicName, func):
         if not self.as_ClientService:
             publisher = self._publishers.get(topicName)
@@ -35,6 +53,10 @@ class ros2node(Node):
                 # self.get_logger().info(f'Publishing: "{msg.data}" on topic: "{topicName}"')
             else:
                 self.get_logger().info(f'No publisher found for topic: "{topicName}"')
+#______________________________________________________________________________________________________________________________________________
+#getter
 
     def get_client(self, topicName):
         return self._clients.get(topicName)
+#______________________________________________________________________________________________________________________________________________
+#setter
\ No newline at end of file
-- 
GitLab