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

Stricter filter finding strategy? #14

Closed
jonbinney opened this issue Apr 5, 2017 · 6 comments
Closed

Stricter filter finding strategy? #14

jonbinney opened this issue Apr 5, 2017 · 6 comments

Comments

@jonbinney
Copy link
Contributor

As described by @v4n here, there are some pitfalls to the current filter finding strategy. Currently if there is no package name specified for a filter in the yaml, then the first filter with the specified string anywhere in its name is chosen:

if (std::string(config[i]["type"]).find("/") == std::string::npos)

That does output a warning, but given that it can create some really subtle errors when the wrong filter is chosen, it might be better if it actually errored out. For better or worse, many robots have lots of warnings output by various packages, and one more can be easily missed. I can think of a few possible solutions (these would probably only be applied in lunar and later ROS distros):

  1. When no package is specified, require an exact string match (not just a substring) between the string specified in yaml and the name of the plugn (without the package)
  2. Require specification of the full plugin name, including the package. Error out if the package name isn't there. This is the strictest option. I prefer it since it removes ambiguity from the start, but it could require a lot of people to update their robot configs.
  3. Error out if more than one plugin matches the string from the yaml. In theory this would only break robot configurations that are already silently broken.

@tfoote @v4hn what do you guys think?

@tfoote
Copy link
Member

tfoote commented Apr 5, 2017

The section you linked to which does the promiscuous search was added for backwards compatibility 7 years ago. f7a402c I'd suggest officially deprecating it for lunar and removing it in the future.

@jonbinney
Copy link
Contributor Author

It's actually had ROS_WARN("Deprecation Warning: No '/' detected in FilterType, Please update to 1.2 plugin syntax. "); for that case since it was added. Since it is already deprecated, do you mind if I open a PR removing it for lunar?

@jonbinney
Copy link
Contributor Author

(one downside being this will require branching this for lunar, unless we want to check the ros distro in the code)

@tfoote
Copy link
Member

tfoote commented Apr 5, 2017

Good point. We can definitely move ahead on removing it. It's a very low traffic repo so forking it for this is fine.

I've created a lunar-devel branch for you to target.

@v4hn
Copy link

v4hn commented Apr 6, 2017 via email

@tfoote
Copy link
Member

tfoote commented Apr 7, 2017

Fixed in #15

@tfoote tfoote closed this as completed Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants