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

change generators to IDL-based pipeline, change char type, separate action types #334

Merged
merged 78 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6a4f053
add Python function for IDL-based generators
dirk-thomas Nov 20, 2018
0b1f412
update C and C++ message generators to use IDL-based extension point
dirk-thomas Nov 20, 2018
6923cb9
update includes in typesupport packages
dirk-thomas Nov 20, 2018
4cec368
replace separate action generation with IDL-based approach
dirk-thomas Nov 21, 2018
8d39c7b
don't pass .action files to legacy message generators
dirk-thomas Nov 21, 2018
565de64
temporary use custom map in not yet updated generator
dirk-thomas Nov 21, 2018
c3c623b
strip action specific suffixes from include filename
dirk-thomas Nov 21, 2018
ee172fc
add action templates to list of dependencies
dirk-thomas Nov 21, 2018
88184c7
match constants with message
dirk-thomas Nov 24, 2018
81de283
traits
dirk-thomas Nov 25, 2018
8a815bf
native path
dirk-thomas Nov 25, 2018
a9ed3b7
escape JSON correctly
dirk-thomas Nov 25, 2018
1347384
rsplit
dirk-thomas Nov 26, 2018
8940706
fix warning
dirk-thomas Nov 26, 2018
087bd40
comment fix
dirk-thomas Nov 26, 2018
a19de6d
unique include directives
dirk-thomas Nov 26, 2018
ced1df9
make pydot optional
dirk-thomas Nov 26, 2018
37e4709
fix linter
dirk-thomas Nov 26, 2018
2fe479f
linter
dirk-thomas Nov 26, 2018
4bbb09b
fix comment
dirk-thomas Nov 27, 2018
a3911f2
remove service check for feedback suffix
dirk-thomas Nov 27, 2018
a5ce54a
use UINT8_MAX
dirk-thomas Nov 27, 2018
f4124af
fix comment
dirk-thomas Nov 27, 2018
3b764f3
extend action struct with FeedbackMessage
dirk-thomas Nov 27, 2018
6f56a6f
update C and C++ introspection typesupport generators to use IDL-base…
dirk-thomas Nov 28, 2018
e9f1e87
add missing symbols
dirk-thomas Nov 28, 2018
7b0bb21
address linter warnings
dirk-thomas Nov 28, 2018
db2f4e3
instantiate parser on demand
dirk-thomas Nov 28, 2018
ef5e329
Add option to generate_files() for keeping idl filename case (#336)
jacobperron Nov 30, 2018
61f80d8
remove unused var
dirk-thomas Nov 30, 2018
f56f18d
remove comment
dirk-thomas Nov 30, 2018
f618c8d
fix missing import introduced during rebase
dirk-thomas Nov 30, 2018
b343af1
change exported variable from <pkg>_INTERFACE_FILES to <pkg>_IDL_FILE…
dirk-thomas Dec 1, 2018
bdffa21
keep <pkg>_INTERFACE_FILES for legacy generators
dirk-thomas Dec 2, 2018
38b6cff
fix upper string length for nested strings
dirk-thomas Dec 3, 2018
c66ef87
fix default value for strings with upper bounds
dirk-thomas Dec 3, 2018
0360b23
fix classification of unbounded sequence of bounded strings
dirk-thomas Dec 3, 2018
5dc61d0
fix previous fix
dirk-thomas Dec 3, 2018
2f067d6
Adds includes for action wrapper IDL messages fields. (#337)
hidmic Dec 5, 2018
15908c5
Use set comprehension instead (nit fix)
hidmic Dec 5, 2018
54b25a1
fix adding actions
dirk-thomas Dec 5, 2018
b5d2ae4
Add missing closing brace for 'extern C'
jacobperron Dec 5, 2018
f333f96
fix missing service request/response symbols
dirk-thomas Dec 5, 2018
62c6f79
don't generate png of AST by default
dirk-thomas Dec 5, 2018
cde2a3f
expose function to get AST
dirk-thomas Dec 5, 2018
84f6ec1
no enum support yet
dirk-thomas Dec 5, 2018
0b8ae2b
fix more missing symbols
dirk-thomas Dec 5, 2018
666080f
fixup
dirk-thomas Dec 5, 2018
1fa8b66
fix includes
dirk-thomas Dec 5, 2018
3d7cb50
undef NO_ERROR for Windows
jacobperron Dec 6, 2018
6878369
dump working copy
dirk-thomas Jan 7, 2019
a0fc35c
fix struct identifier extraction when having an annotation
dirk-thomas Feb 5, 2019
0287060
match renamed action types
dirk-thomas Feb 12, 2019
adfc7eb
update grammar to improve parse performance
dirk-thomas Feb 13, 2019
6646bf4
remove obsolete ImplicitFieldCollision logic
dirk-thomas Feb 14, 2019
af54767
update action tests
dirk-thomas Feb 14, 2019
f1800fe
fix value range of char in adapter
dirk-thomas Feb 15, 2019
3758e70
fix char being unsigned
dirk-thomas Feb 15, 2019
7e41aa3
disable debug images of AST
dirk-thomas Feb 15, 2019
63cd827
use unique_identifier_msgs for goal id
dirk-thomas Feb 17, 2019
3c75b52
up doc
dirk-thomas Feb 19, 2019
0ec66e4
fix regression on Windows
dirk-thomas Feb 19, 2019
355af2e
remove obsolete comment
dirk-thomas Feb 21, 2019
ab1b43a
try to fix Windows warning
dirk-thomas Feb 22, 2019
2c58d6c
remove obsolete constant
dirk-thomas Feb 26, 2019
2555d3e
targeting Dashing
dirk-thomas Feb 26, 2019
5217c46
removed comment
dirk-thomas Feb 26, 2019
f5ee01c
moved template calls
dirk-thomas Feb 26, 2019
19aea38
remove obsolete todo
dirk-thomas Feb 26, 2019
e155168
removed commented code
dirk-thomas Feb 26, 2019
b0f4c42
fix initialization of u16string
dirk-thomas Feb 26, 2019
cca3f1a
fix u16string len
dirk-thomas Feb 26, 2019
e842f17
avoid double initialization
dirk-thomas Feb 26, 2019
82cef24
moved template calls
dirk-thomas Feb 26, 2019
e668e85
comment in test
dirk-thomas Feb 26, 2019
48bd7d0
fix has_bounded_size trait
dirk-thomas Feb 26, 2019
b51372f
readd explicit dependency on absolute paths of idl files
dirk-thomas Feb 28, 2019
1509ae8
reduce logic with all action related types being in a single file
dirk-thomas Mar 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions rosidl_actions/CMakeLists.txt

This file was deleted.

40 changes: 0 additions & 40 deletions rosidl_actions/bin/rosidl_actions

This file was deleted.

23 changes: 0 additions & 23 deletions rosidl_actions/cmake/register_actions.cmake

This file was deleted.

22 changes: 0 additions & 22 deletions rosidl_actions/package.xml

This file was deleted.

7 changes: 0 additions & 7 deletions rosidl_actions/rosidl_actions-extras.cmake.in

This file was deleted.

49 changes: 0 additions & 49 deletions rosidl_actions/rosidl_actions/__init__.py

This file was deleted.

24 changes: 1 addition & 23 deletions rosidl_adapter/rosidl_adapter/action/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Open Source Robotics Foundation, Inc.
# Copyright 2018-2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,28 +27,6 @@ def convert_action_to_idl(package_dir, package_name, input_file, output_dir):
content = abs_input_file.read_text(encoding='utf-8')
action = parse_action_string(package_name, input_file.stem, content)

# HACK as long as the return action specification contains implicitly added
# fields they have to be skipped when generating .idl files
assert len(action.goal_service.request.fields) >= 1
assert action.goal_service.request.fields[0].name == 'action_goal_id'
action.goal_service.request.fields.pop(0)
assert len(action.goal_service.response.fields) >= 2
assert action.goal_service.response.fields[0].name == 'accepted'
assert action.goal_service.response.fields[1].name == 'stamp'
action.goal_service.response.fields.pop(1)
action.goal_service.response.fields.pop(0)

assert len(action.result_service.request.fields) >= 1
assert action.result_service.request.fields[0].name == 'action_goal_id'
action.result_service.request.fields.pop(0)
assert len(action.result_service.response.fields) >= 1
assert action.result_service.response.fields[0].name == 'action_status'
action.result_service.response.fields.pop(0)

assert len(action.feedback.fields) >= 1
assert action.feedback.fields[0].name == 'action_goal_id'
action.feedback.fields.pop(0)

output_file = output_dir / input_file.with_suffix('.idl').name
abs_output_file = output_file.absolute()
print('Writing output file: {abs_output_file}'.format_map(locals()))
Expand Down
6 changes: 4 additions & 2 deletions rosidl_adapter/rosidl_adapter/msg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def convert_msg_to_idl(package_dir, package_name, input_file, output_dir):


def to_idl_literal(idl_type, value):
if idl_type[-1] in (']', '>'):
if idl_type[-1] == ']' or idl_type.startswith('sequence<'):
elements = [repr(v) for v in value]
while len(elements) < 2:
elements.append('')
return '"(%s)"' % ', '.join(e.replace('"', r'\"') for e in elements)

if 'boolean' == idl_type:
return 'TRUE' if value else 'FALSE'
if 'string' == idl_type:
if idl_type.startswith('string'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this might trigger for fixed sized array's of nested messages if the package name starts with string because of

identifier = '{type_.pkg_name}::msg::{type_.type}' \
.format_map(locals())
and this return
if type_.is_fixed_size_array():
return '{identifier}[{type_.array_size}]'.format_map(locals())
when called here
const @(get_idl_type(constant.type)) @(constant.name) = @(to_idl_literal(get_idl_type(constant.type), constant.value));

I assume startswith is used for bounded strings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is only used for constant values and default values. So nested messages aren't supported in these cases atm. While certainly not future proof I think it is good enough for now.

return string_to_idl_string_literal(value)
return value

Expand All @@ -90,6 +90,8 @@ def get_idl_type(type_):
identifier = MSG_TYPE_TO_IDL[type_]
elif type_.is_primitive_type():
identifier = MSG_TYPE_TO_IDL[type_.type]
if identifier == 'string' and type_.string_upper_bound is not None:
identifier += '<{type_.string_upper_bound}>'.format_map(locals())
else:
identifier = '{type_.pkg_name}::msg::{type_.type}' \
.format_map(locals())
Expand Down
Loading