use parameters from python launch file in node
I am trying to use parameters specified in my .launch.py file, but a ParameterNotDeclaredException is thrown when accessing any parameter. Does anyone know why? I try to access the parameters like this from within my Node:
self.get_parameter('buffer_size')
Here is the launch file. I'm using Foxy and Python
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
Node(
package='blackfly_calibration',
executable='broadcaster',
parameters=[
{"capture_frequency": 20.0},
{"buffer_size": 10},
{"image_topic": "/camera/image_raw"}
],
)
])