From cf98729df518dc2af4864e4cf130f85e1acc1019 Mon Sep 17 00:00:00 2001
From: Emil Harlan <eharlan@uni-bremen.de>
Date: Fri, 21 Jul 2023 13:44:19 +0200
Subject: [PATCH] a

---
 robomaster_pi/command_executer.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/robomaster_pi/command_executer.py b/robomaster_pi/command_executer.py
index 9d8bd97..4b83869 100644
--- a/robomaster_pi/command_executer.py
+++ b/robomaster_pi/command_executer.py
@@ -18,14 +18,12 @@ class CommandExecutor(Node):
     def execute_command_callback(self, msg):
         command = msg.data.split()  # Split the received string into command and name
         if command[0] == "kill":
-            kill_node(command[1])
-            
+            self.kill_node(command[1])  # Call the kill_node method using 'self'
         else:
             name = command[0]
             launch_command = " ".join(command[1:])
             # Execute the launch command in a separate thread
             threading.Thread(target=self.execute_command, args=(name, launch_command)).start()
-            self.get_logger().error("Invalid command format.")
 
     def execute_command(self, name, launch_command):
         try:
@@ -60,4 +58,4 @@ def main(args=None):
     rclpy.shutdown()
 
 if __name__ == '__main__':
-    main()
+    main()
\ No newline at end of file
-- 
GitLab