Skip to content
Snippets Groups Projects
Commit 55c7c048 authored by Emil Harlan's avatar Emil Harlan
Browse files

a

parent 14d4943c
No related branches found
No related tags found
No related merge requests found
......@@ -48,12 +48,13 @@ class LaunchControlNode(Node):
with self.process_lock:
try:
# Launch the process
process = Popen(command, shell=True, stdout=PIPE, stderr=STDOUT)
process = Popen(command, shell=True, stdout=PIPE, stderr=STDOUT, universal_newlines=True)
self.launched_processes[name] = process
self.get_logger().info(f"Process '{name}' has been launched.")
# Read and log the output of the process
for line in process.stdout:
self.get_logger().info(f"Process '{name}' output: {line.decode().strip()}")
while process.poll() is None:
output = process.stdout.readline()
self.get_logger().info(f"Process '{name}' output: {output.strip()}")
except Exception as e:
self.get_logger().error(f"Error launching process '{name}': {e}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment