launch file doesn't use the parameters
I am a beginner to ROS so am not sure why this is happening.
<launch>
<node name="hello_world_node" pkg="hello_world" type="hello_world.py" output="screen">
<param name="freq" value="5" />
<param name="text" value="Lauch file is working" />
</node>
</launch>
this is my launch file.
and below is my node hello_world
#! /usr/bin/env python
import rospy
rospy.init_node("hello_world")
#initialising parameters
freq = rospy.get_param('freq',20)
text = rospy.get_param('text',"Hello World")
full_string = text + " %s" %rospy.get_time()
rate = rospy.Rate(freq)
while not rospy.is_shutdown():
print full_string
rate.sleep()
now here is the weird part,
if i list out the parameters separately outside the node in the launch file it seems to work.
<launch>
<node name="hello_world_node" pkg="hello_world" type="hello_world.py" output="screen" />
<param name="freq" value="0.5" />
<param name="text" value="Hello World from Launch file" />
</launch>
any idea why the second format works but the first one doesn't?