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

Fix service call #13

Merged
merged 4 commits into from
Aug 21, 2024
Merged

Fix service call #13

merged 4 commits into from
Aug 21, 2024

Conversation

aremazeilles
Copy link
Collaborator

The main fix is related to the verification of services with input that are not basic format (like ROS format).

The error is related to that call:

srv_resp = srv_proxy(**srv_input)

which converts input dictionary into a set of input parameter to the function.
This only works if the service input only contains basic format, like int, bool etc.
If an item is itself a composed ROS message format. It fails.

The solution is to do the following:

srv_type = rosservice.get_service_type(srv_name)
req = message_converter.convert_dictionary_to_ros_message(srv_type, srv_input, kind='request')
srv_resp = srv_proxy(req)

The input dictionary is concerted into a service request, and the proxy is triggered with this unique input parameter.

Several linting fixes also inserted.

@aremazeilles aremazeilles self-assigned this Aug 21, 2024
@aremazeilles aremazeilles merged commit fa9ece4 into noetic-devel Aug 21, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant