How to properly terminate ROS and Gazebo
import sys
import subprocess
if __name__ == '__main__':
result = []
for _line in sys.stdin:
line = _line.strip()
if line:
k = line.find(' ')
while k < len(line) and line[k] == ' ':
k += 1
end_index = line.find(' ', k)
result.append(line[k:end_index])
command = ["kill", "-9"]
command.extend(result[:-1])
subprocess.run(command)PreviousHow to inspect service and make a service callNextHow to add and remove models in Gazebo simulation dynamically
Last updated