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

Generate python typesupport for Actions #14

Closed
sloretz opened this issue Oct 18, 2018 · 0 comments
Closed

Generate python typesupport for Actions #14

sloretz opened this issue Oct 18, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sloretz
Copy link
Contributor

sloretz commented Oct 18, 2018

Feature request

There should be a python module importable by import packagename.action.actioname which contains everything needed to use actions in python.

Feature description

The module needs to have references to all the types a user needs to interface with actions. This should follow the same model as services since a service type support includes two message type supports.

Implementation considerations

The service python object imports the generated python objects for the request and response message. The action module should import the generated python objects for the services and message it uses as well as the common cancel service and status message.

@{
srv_name = '_' + convert_camel_case_to_lower_case_underscore(spec.srv_name)
for field_name in [srv_name + '__request', srv_name + '__response']:
print('%sfrom %s.srv import %s' % (' ' * 4 * 3, package_name, field_name))
print('%sif %s.Metaclass._TYPE_SUPPORT is None:' % (' ' * 4 * 3, field_name))
print('%s%s.Metaclass.__import_type_support__()' % (' ' * 4 * 4, field_name))
}@

The python object for services is just a class with two class members: Request and Response. Actions could be a class with 3 members: SendGoal, GetResult, and Feedback

class @(spec.srv_name)(metaclass=Metaclass):
from @(package_name).srv._@convert_camel_case_to_lower_case_underscore(spec.srv_name)__request import @(spec.srv_name)_Request as Request
from @(package_name).srv._@convert_camel_case_to_lower_case_underscore(spec.srv_name)__response import @(spec.srv_name)_Response as Response

connects to ros2/ros2#583

@sloretz sloretz added the enhancement New feature or request label Oct 18, 2018
@sloretz sloretz added this to the crystal milestone Oct 18, 2018
@sloretz sloretz mentioned this issue Oct 18, 2018
24 tasks
@tfoote tfoote added the in progress Actively being worked on (Kanban column) label Nov 15, 2018
@tfoote tfoote removed the in progress Actively being worked on (Kanban column) label Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants