ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Turtlesim: Unable to change background colour using .launch file

asked 2015-05-25 18:17:32 -0600

incessantexplorer gravatar image

updated 2015-06-03 11:01:58 -0600

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 ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-06-03 16:12:47 -0600

Raman gravatar image

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.

edit flag offensive delete link more

Comments

still does not work.

incessantexplorer gravatar image incessantexplorer  ( 2015-06-05 08:15:57 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-05-25 18:15:46 -0600

Seen: 1,382 times

Last updated: Jun 03 '15