-
Notifications
You must be signed in to change notification settings - Fork 120
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] parameter namespace not scoped with transport used #140
Comments
The fix is relatively easy
The question is:
|
@lukaszmitka, I am asking for your opinion
@mjcarroll, I am asking for your opinion as
@ijnek, I am asking for your opinion as official maintainer and active contributor |
I had no intention to declare parameters against documentation. Most probably a mistake. |
Thanks for doing the leg-work on this. While it has been a little bit, I would agree that this is likely a mistake. I am in favor of moving to the fully-qualified parameter names. I think we should come up with a way of deprecating the current behavior (perhaps preserving it while emitting warnings that those parameters are ambiguous and will be removed in the next iteration) to make sure that we don't unexpectedly break users relying on this implementation, though. |
Thanks for bringing this up! I would be happy to review a PR for this change. I was just about to comment on the deprecation - we should print warnings with useful migration instructions when trying to:
In regards to getting the deprecated parameter, I don't think there is a way to notify the node that is trying to access the deprecated parameter, so printing a warning in image_transport_plugins would be the best we can do. |
- <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.compressed.format` instead of `image.format` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter Similar changes will be needed for: - other transports - subscribers Related to ros-perception#140
I believe all of above apart from notifications on getting a deprecated parameter may be implemented reasonably with existing ROS2 API. Pull request in #142, at the beginning only for As for notification on getting a deprecated parameter - I can't find any reasonable way to do it. Maybe somebody else has idea. ROS2 |
Thanks for putting the PR together! I'm in the process of reviewing it and seeing if we can somehow notify the prameter deprecation when calling get_parameter. I assumed this was possible, but I may have been wrong. I think this is a rather general question, so I've posted it here: https://robotics.stackexchange.com/questions/24634/deprecating-a-ros-2-parameter-name @mjcarroll Do you have ideas on this? |
Got a response on that question from Tully. To summarize, we should:
so I think #142 satisfies 1 and 2, when making the next release, I would ensure 3 happens. |
@ijnek, thank you for clarifying that Also from response
This might be alternative way to change behavior and support old behavior at the same time. But in my quick tests parameter remapping doesn't seem to work in ROS2 at all (foxy, humble, I haven't tried rolling) The CLI interface ( Separate issue, not related to image_transport_plugins repository. As a side note - parameter remapping works in ROS1 |
- <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.compressed.format` instead of `image.format` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter - synchronize deprecated changes to new ones - this is necessary for dynamic reconfigure Similar changes will be needed for: - other transports - subscribers Related to ros-perception#140
I might be wrong about this, but I believe ros2 doesn't have parameter remapping since there is no need for it without the global parameter server that existed in ROS 1 - parameters are specific to each node. |
Resolved by #143, and due to be released in ros/rosdistro#36894 |
- runtime reconfiguration - <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.compressed.mode` instead of `image.mode` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter - synchronize deprecated changes to new ones - this is necessary for dynamic reconfigure Similar changes will be needed for: - other transports Related to ros-perception#140
@ijnek - this should stay open until
Also, this should touch both Publisher in Subscriber For compressed_image_transport
I have no way to reopen this issue myself |
You're right, I've reopened this ticket. I'll try and review the subscriber fix as soon as possible. |
@bmegli Thanks for your work so far on this. We really appreciate it. Since this is one of the ROS packages in ROS Iron Desktop as defined in REP 2001, I'd want these set of changes propogated across the remaining transport_plugins before the Iron Beta release which is on May 1st. @bmegli would you be able to prepare the changes for the other plugins too? If not, these changes may have to wait until the next distro. Personally, I want to see these great changes in Iron :) |
- runtime reconfiguration - <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.compressedDepth.png_level` instead of `image.png_level` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter - synchronize deprecated changes to new ones - this is necessary for dynamic reconfigure - add ROS1 like ranges for parameters (min/max) - some cleanup - remove unnecessary includes, using statements, etc. Default png_level was left the same as for compressed_image_transport - this is OpenCV default (3) - the deprecated paramterer name clashes here with compressed_image_transport - I don't really want to consider if there is a race between plugin loading for default value - side notes: - in ROS2 default was 9 - 9 is not usable for real-time processing on most machines - in ROS1 default is now 1 - 3 is typically usable for real-time processing - this should probably be made even with ROS1 after removing deprecated parameters Related to ros-perception#140 Builds up on ros-perception#110
In the long term
Should probably land in:
The logic of parameter namespaces is complex and if every plugin does it on its own we are asking for trouble. Plugins could just operate on parameter names without worrying about the scope where those live. |
- runtime reconfiguration for publisher and subscriber - <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.theora.target_bitrate` instead of `image.target_bitrate` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter - synchronize deprecated changes to new ones - this is necessary for dynamic reconfigure The publisher is a bit more complex here - in general we reload config on publish - but some code paths (conditional compilation) - would result in resetting context on every config reload - so we flag to reload config only parameter event change - and reload it once on init to mimic ROS1 dynamic reconfigure setup The subscriber is simple as existing code already had necessary checks. Related to ros-perception#140
- runtime reconfiguration for publisher and subscriber - <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.theora.target_bitrate` instead of `image.target_bitrate` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter - synchronize deprecated changes to new ones - this is necessary for dynamic reconfigure The publisher is a bit more complex here - in general we reload config on publish - but some code paths (conditional compilation) - would result in resetting context on every config reload - so we flag to reload config only on parameter event change - and reload it once on init to mimic ROS1 dynamic reconfigure setup The subscriber is simple as it already had necessary checks. Related to ros-perception#140
theora_image_transport fixes are in #146 If #145 and #146 are merged this issue can be closed. In the future
|
Yes, I agree with your suggestion of having this in the image_transport library. I am not a maintainer of ros-perception/image_common, so you will have to open an issue there to make that happen. |
- runtime reconfiguration for publisher and subscriber - <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.theora.target_bitrate` instead of `image.target_bitrate` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter - synchronize deprecated changes to new ones - this is necessary for dynamic reconfigure The publisher is a bit more complex here - in general we reload config on publish - but some code paths (conditional compilation) - would result in resetting context on every config reload - so we flag to reload config only on parameter event change - and reload it once on init to mimic ROS1 dynamic reconfigure setup The subscriber is simple as it already had necessary checks. Related to #140 (cherry picked from commit b7d409f) # Conflicts: # theora_image_transport/src/theora_publisher.cpp # theora_image_transport/src/theora_subscriber.cpp
- runtime reconfiguration - <image>.<transport>.<param> as future replacement of <image>.<param> - e.g. `image.compressedDepth.png_level` instead of `image.png_level` - support both ways for now - emit deprecation warnings on setting through non-transport scoped parameter - synchronize deprecated changes to new ones - this is necessary for dynamic reconfigure - add ROS1 like ranges for parameters (min/max) - some cleanup - remove unnecessary includes, using statements, etc. Default png_level was left the same as for compressed_image_transport - this is OpenCV default (3) - the deprecated paramterer name clashes here with compressed_image_transport - I don't really want to consider if there is a race between plugin loading for default value - side notes: - in ROS2 default was 9 - 9 is not usable for real-time processing on most machines - in ROS1 default is now 1 - 3 is typically usable for real-time processing - this should probably be made even with ROS1 after removing deprecated parameters Related to #140 Builds up on #110 (cherry picked from commit dfdf48b)
@bmegli I think all API has been updated. I'm going to make a release into ros 2 iron (and rolling) with these changes tonight if you don't have addittional API/ABI changes. |
Short Example
Current behavior (ROS2 foxy and humble)
Instead of
# this is artificial, what I would expect ros2 param list /camera/camera: .color.image_raw.compressed.format .color.image_raw.compressed.jpeg_quality .color.image_raw.compressed.png_level
Rationale
ROS1 documentation
image_transport 4.1.2 parameters section
Potential clash of parameter names between transport plugins
Currently if there are two transports, say:
compressed
my_transport
And both use say
format
parameterThere is a clash between transports on parameter namespace.
ros2 param list /camera/camera: .color.image_raw.format # would be used by both plugins
Question
Is there a reason this was not taken into account when migrating from ROS1 to ROS2?
The text was updated successfully, but these errors were encountered: