Second Image publisher has reset filename as '--ros-args' instead of rtsp stream, why?
I'm using ros2 and image_publisher, I have two image_publisher nodes to convert two rtsp streams to ros2 image streams, but the second stream does not work. I am using following launch file:
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
base_config_path = os.path.join(get_package_share_directory('project'), 'config')
image_publisher_config0 = os.path.join(base_config_path, "image_publisher0.yaml")
image_publisher_config1 = os.path.join(base_config_path, "image_publisher1.yaml")
return LaunchDescription([
Node(
package='image_publisher',
executable='image_publisher_node',
namespace='cam0',
parameters=[image_publisher_config0],
),
Node(
package='image_publisher',
executable='image_publisher_node',
namespace='cam1',
parameters=[image_publisher_config1],
)
])
and I'm using following two config files:
cam[0/1]/ImagePublisher:
ros__parameters:
filename: rtsp://10.11.12.2[0/1]/live_stream
publish_rate: 25.0
frame_id: world
Now the first stream starts normally and everything works, but the second stream somehow doesn't take the filename parameter. This seems odd, because the configs are exactly the same besides the namespace differences of 0/1.
Node cam0 outputs: Reset filename as rtsp://10.11.12.20/live_stream
but Node cam1 outputs: Reset filename as '--ros-args'
.
Why is that and how can I fix it?