Python script is blocked by a launch file in ROS2 launch
I want to run 3 files from ros2 launch file:
- rqt_image_view package which launches the camera viewer
- A python script in which I need to continuously gives enter command to click images
- Camera launch file.
Currently, after launching this launch file my python script (no. 2) get blocks means I'm not able to give enter-command, the terminal prints the output of camera launch file.
```
code starts from here
from launch import LaunchDescription from launch.actions import ExecuteProcess from ament_index_python.packages import get_package_share_directory import os from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource
def generate_launch_description():
ld = LaunchDescription()
exc = os.path.join(
get_package_share_directory("mw_vision"), "scripts", "data_collection.py"
)
rqt_image_view = ExecuteProcess(
cmd=[[
"ros2 run rqt_image_view rqt_image_view",
]],
output="screen",
shell = True,
)
datacollectionnode = ExecuteProcess(
cmd=[[
"python3 ",
exc,
]],
output="screen",
shell = True,
)
broadcaster_listener_nodes = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory('mw_vision'), 'launch'),
'/rs_launch.py']),
)
ld.add_action(datacollectionnode)
ld.add_action(rqt_image_view)
ld.add_action(broadcaster_listener_nodes)
return ld
```