Ask Your Question
0

How to change the background color in the turtlesim tutorial?

asked 2021-09-12 12:37:51 -0600

Shivam gravatar image

I am following the beginner tutorial in ROS. I have completed all the tutorials until the understanding service params. But when I enter the command in 3.2 section of the understanding service params it doesn't change the background color of the turtlesim.

The commands I entered- $ rosservice call /clear $ rosparam set /turtlesim/background_r 150 $ rosservice call /clear But the background color in the image stays the same after executing the command. I am using ROS Noetic and Ubuntu 20.04.

Any help is appreciated.

edit retag flag offensive close merge delete

Comments

I am new to ROS, Linux and this ROS community.

Shivam gravatar image Shivam  ( 2021-09-12 12:40:54 -0600 )edit

I think I got the answer but not the solution. This worked- ($ rosparam set /my_turtle/background_r 150) but not this -($ rosparam set /turtlesim/background_r 150). Are these two different packages ?

Shivam gravatar image Shivam  ( 2021-09-12 12:52:50 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-09-13 07:48:39 -0600

Check this tutorial, i believe it will help you understand: https://automaticaddison.com/implemen... as it will help you understand more details.

But to your specific question, set the background color:

rosparam set /background_b <value>

for example if you want to set blue color to 255:

rosparam set /background_b 255

In a similar you can set /background_r for the red and /background_g for green.

So the combination of RGB allows you to create 16 million combination colors.

edit flag offensive delete link more

Comments

Thank you Osliva. I was using the wrong node in my command that's why the color was not changing. That node was closed but still I didn't get an error when I entered the wrong node name. I will also check out the resource you gave.

Shivam gravatar image Shivam  ( 2021-09-13 08:03:18 -0600 )edit

Glad to be able to help. Happy coding!

osilva gravatar image osilva  ( 2021-09-13 08:07:03 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-09-12 12:29:56 -0600

Seen: 63 times

Last updated: Sep 13 '21