Roslaunch with python code sometimes won't run
I use the code below to launch darknet ros 3d node, but sometimes it won't run the node. Does the problem rely on the darknet_ros_3d launch file or the python code ?
import subprocess
def run_roslaunch_camera(package_name, launch_file):
command = ['roslaunch', package_name, launch_file]
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
run_roslaunch_camera('darknet_ros_3d', 'ros_3d_left_launch_2.launch')
The code above only shows the launch part, not the whole python code, if the rest of the code has something to do with the problem, I will provide it.