generate_parameter_library icon indicating copy to clipboard operation
generate_parameter_library copied to clipboard

Error output from subset_of

Open christophfroehlich opened this issue 1 year ago • 4 comments

While playing around with the validators for https://github.com/ros-controls/ros2_controllers/pull/703, I found out that the error message of subset_of is not really helpful. Launching the JTC from demo 1 with

    command_interfaces:
      - test

gives

Exception thrown during init stage with message: argument not found

If I delete this section, I get a useful error from not_empty:

Exception thrown during init stage with message: Invalid value set during initialization for parameter 'command_interfaces': Parameter 'command_interfaces' cannot be empty

@tylerjw Is there something wrong with the validator configuration or is this an issue with this library?

christophfroehlich avatar Jul 14 '23 14:07 christophfroehlich

Here is the code for subset_of: https://github.com/PickNikRobotics/RSL/blob/91c445b283c5c74a23be0a62f8e6ca07f1fb1e5a/include/rsl/parameter_validators.hpp#L75

You can see the error it should produce. That error seems like you are hitting something else. Can you run that in gdb and get a backtrace to see what is throwing that exception?

tylerjw avatar Jul 17 '23 21:07 tylerjw

First time for me to run gdb on that stuff. It seems that subset_of<> is returning the correct string and added to the const string, which is then passed to fmt::format

0x7fffc0119570 "Invalid value set during initialization for parameter 'command_interfaces': Entry 'test' in parameter 'command_interfaces' is not in the set {position, velocity, acceleration, effort}"

image

christophfroehlich avatar Jul 17 '23 22:07 christophfroehlich

I tried it with ros2_controllers (rolling and humble) installed from source, I have no binary installation at hand.

christophfroehlich avatar Jul 17 '23 22:07 christophfroehlich

I'll need to re-create this locally to determine why our validation error message isn't getting out. I don't understand where Exception thrown during init stage with message: argument not found comes from.

tylerjw avatar Jul 19 '23 18:07 tylerjw