Setting private rosparams through a launch file
I have a node where I initialize a set of expected parameters to default values. I am treating the parameters like class member variables. I am now trying to set these parameters through a launch file to but it does not appear to be working. When I set the parameter through a launch file and run rosparam get /some_node_name/value
I get the default value of 0
In node.py
class MyNode:
def __init__(self):
rospy.init_node('my_node')
# Create all expected parameters
rospy.set_param('~number', 0)
In the launch file
<node name='some_node_name' pkg='my_pkg' type='node.py' output='screen'>
<param name='~number' value=10 />
</node>
Am I missing something? Or is this not possible? I was keeping the parameters "private" as I will be launching multiple nodes of the same type, all with different node names
Have you tried not using
~
in your launch file for the private parameters?Also, what does
mean?