Turtlesim: Unable to change background colour using .launch file
Hello, I am trying to use .launch file to change the backgroud colour of the turtlesim node.
Here are my Codes:
First one:
<launch>
<node name="" pkg="turtlesim" type="turtlesim_node" output="screen" ns="/">
<rosparam ns="/">
background_b: 10
</rosparam>
</node>
<node name="turtle_teleop_key" pkg="turtlesim" type="turtle_teleop_key" output="screen" />
</launch>
and the second one:
<launch>
<node name="turtlelaunch" pkg="turtlesim" type="turtlesim_node" output="screen" ns="/">
<param name ="/background_b" value="100" />
</node>
<node name="turtle_teleop_key" pkg="turtlesim" type="turtle_teleop_key" output="screen" />
</launch>
the output for rosparam_get /
nac@nac-Lenovo-G560:~/nachiket_ws/src/handouts/launch$ rosparam get /
background_b: 255
background_g: 86
background_r: 69
rosdistro: 'indigo
'
roslaunch:
uris: {host_nac_lenovo_g560__40475: 'http://nac-Lenovo-G560:40475/'}
rosversion: '1.11.10
'
run_id: e57a1672-0332-11e5-87f2-ec55f98a32e6
turtlelaunch: {background_b: 100}
and the rosparam list
nac@nac-Lenovo-G560:~/nachiket_ws/src/handouts/launch$ rosparam list
/background_b
/background_g
/background_r
/rosdistro
/roslaunch/uris/host_nac_lenovo_g560__40475
/rosversion
/run_id
/turtlelaunch/background_b
I am still unable to change the background colour. Even if the global namespace is specified, a new namespace is being create and the turtlesim background paramter that is to be set is getting sent under that namespace.
What am I missing ?
Asked by incessantexplorer on 2015-05-25 18:15:46 UTC
Answers
Hi, The second launch file provided seems to be more correct. So use it and delete the first one. If you are using catkin, make sure you cd to your catkin_ws and issue the catkin_make command at the terminal. Only then roslaunch your launch file. It should work then.
Asked by Raman on 2015-06-03 16:12:47 UTC
Comments
still does not work.
Asked by incessantexplorer on 2015-06-05 08:15:57 UTC
Comments