Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ros2 param set /turtlesim background_* needs to be "triggered" #72

Closed
maryaB-osr opened this issue Oct 16, 2019 · 10 comments
Closed

ros2 param set /turtlesim background_* needs to be "triggered" #72

maryaB-osr opened this issue Oct 16, 2019 · 10 comments
Assignees

Comments

@maryaB-osr
Copy link
Contributor

See the Understanding ROS 2 parameters tutorial discussion.

Setting the background color parameter with

ros2 param set /turtlesim background_r 150

should update the turtlesim window immediately, but it needs to be triggered by calling

ros2 service call /clear std_srvs/srv/Empty

because of some leftover functionality from ROS 1.

@dirk-thomas
Copy link
Member

There is no way to change the background color without wiping all previous drawn lines. I am not sure if that is desired - to implicitly clear when changing the parameter?

@maryaB-osr
Copy link
Contributor Author

I think that's fine because now they'll have to explicitly clear anyway. I'm more concerned with the extra instructions, not what's actually happening. So if it can all be done at once (the clear and the color change) that's better.

@dirk-thomas
Copy link
Member

So just to be clear: every time a background color parameter is set the whole scene should be cleared implicitly / automatically?

@maryaB-osr
Copy link
Contributor Author

I don't think it should be. If there's a way to make it happen without clearing the lines that would be best.

But, since you said there is no way to change the color without clearing the drawn lines, I'm fine with the whole screen being cleared as long as the background changes automatically.

I will just add a note to the tutorial that the lines will clear - that's much better than the 4 or 5 extra sentences I have now explaining how you have to call /clear to get the parameter setting to change.

@dirk-thomas
Copy link
Member

dirk-thomas commented Oct 18, 2019

#75 separates the background color from the painted turtle paths which makes it possible to update the former without resetting the later. Also the background is immediately redrawn when a parameter event occurs.

I hope this makes writing the tutorial easier (and also simpler for the users).

@maryaB-osr
Copy link
Contributor Author

Awesome! Thanks @dirk-thomas. I'll update the parameters tutorial once #75 is merged in

@Sridhar701Pitt
Copy link

Sridhar701Pitt commented Jun 15, 2020

I'm working through ros2 tutorials at Understanding ROS 2 Parameters
I still need to execute the /clear service to show the changes and it wasn't mentioned anywhere in the tutorial.
Edit: I'm using "Dashing" distro

@dirk-thomas
Copy link
Member

While a new version was tagged in this repo for Dashing (de7271c) it doesn't seem it was ever released with bloom: https://github.com/ros/rosdistro/blob/05e1fa9b6510c9a71a65e8d786b37934e38539b9/dashing/distribution.yaml#L3493

@claireyywang Can you clarify since you did the upstream release?

@claireyywang
Copy link

@dirk-thomas honestly I don't remember if I did since it's been a while, but I can do a release now if that's the right move.

@claireyywang
Copy link

released at ros/rosdistro#25490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants