Retrieving parameters from nodes (rclpy)
I've followed the tutorial here on how to pass parameters to ROS2 nodes here:
https://index.ros.org/doc/ros2/Tutori...
I've made it to the point where the following command on my command line:
ros2 run my_package my_node __params:=/path/to/params.yaml
produces the correct result, meaning I can see the parameters on the command-line output.
However, how would you retrieve those parameters from a python script?
I've tried the following:
rclpy.init()
node = rclpy.create_node("my_node")
param = node.get_parameter('~param_from_yaml')
print(str(param.value))
The output of that is always None. What am I doing wrong or can this even my achieved?