This repository was archived by the owner on Dec 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change generators to IDL-based pipeline (#11)
* update includes and type mapping * update includes and type mapping * remove service check for feedback suffix * Update python, cmake, and msg resource files * Messages working now * Update service EmPy files * cleanup * [wip] typesupport for opensplice c refactor * Update typsupport_opensplice_cpp script to accept output path for converted IDL files * Add function for converting from IDL to OpenSplice compatible IDL * Minor fixups in cpp typesupport * Update c typesupport message template * Update C typesupport EmPy files * Fixes to C++ typesupport * Update C typesupport service templates * Update C++ typesupport service templates * Offload conversion stuff to rosidl_dds * Rename generated external files in C ts * Refactor rosidl_generator_dds_idl extension * Fix C typesupport * Fix C++ typesupport (messages compiling now!) * Fixes post-rebase * Fix template bug * More fixes to C++ templates * Fixes to templates (services compiling now) * Pass in additional service template wrappers to rosidl_generator_dds_idl * More fixes to templates Moved header guards to top-level files. Prepend type names to static variables. * Add missing conversion function implementations and remove debug prints * Call msg template from inside srv template * Call msg template from inside srv template for C type support * Fix lint * add missing action symbols * Fix lint * add missing C action symbols * Fix typo * fix missing C service request/response symbols * Replace defintions in C++ service header template with equivalent expansion of message templates * match renamed action types * remove commented stuff * deterministic order * readd explicit dependency on absolute paths of idl files * include non-nested namespaced types, fix forward declaration * strip action suffix * remove dead block of code * remove duplicate variable * simplify logic * proper syntax * fix target dependency * simplify diff * remove unused/invalid operator
- Loading branch information
1 parent
6aed9f6
commit 2fea5d7
Showing
23 changed files
with
1,222 additions
and
1,002 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
rosidl_typesupport_opensplice_c/resource/idl__dds_opensplice__type_support.c.em
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// generated from rosidl_typesupport_opensplice_c/resource/idl__dds_opensplice__type_support.c.em | ||
// generated code does not contain a copyright notice | ||
|
||
#include <cassert> | ||
#include <cstring> | ||
#include <iostream> | ||
#include <limits> | ||
#include <sstream> | ||
|
||
#include <CdrTypeSupport.h> | ||
#include <u_instanceHandle.h> | ||
|
||
@{ | ||
####################################################################### | ||
# EmPy template for generating <idl>__rosidl_typesupport.c files | ||
# | ||
# Context: | ||
# - package_name (string) | ||
# - content (rosidl_parser.definition.IdlContent result of parsing IDL file) | ||
# - interface_path (Path relative to the directory named after the package) | ||
####################################################################### | ||
|
||
include_directives = set() | ||
|
||
####################################################################### | ||
# Handle message | ||
####################################################################### | ||
from rosidl_parser.definition import Message | ||
for message in content.get_elements_of_type(Message): | ||
TEMPLATE( | ||
'msg__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, message=message, | ||
include_directives=include_directives) | ||
|
||
####################################################################### | ||
# Handle service | ||
####################################################################### | ||
from rosidl_parser.definition import Service | ||
for service in content.get_elements_of_type(Service): | ||
TEMPLATE( | ||
'srv__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, service=service, | ||
include_directives=include_directives) | ||
|
||
####################################################################### | ||
# Handle action | ||
####################################################################### | ||
from rosidl_parser.definition import Action | ||
for action in content.get_elements_of_type(Action): | ||
TEMPLATE( | ||
'msg__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, message=action.goal, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'msg__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, message=action.result, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'msg__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, message=action.feedback, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'srv__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, service=action.send_goal_service, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'srv__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, service=action.get_result_service, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'msg__type_support_c.cpp.em', | ||
package_name=package_name, interface_path=interface_path, message=action.feedback_message, | ||
include_directives=include_directives) | ||
}@ |
74 changes: 74 additions & 0 deletions
74
rosidl_typesupport_opensplice_c/resource/idl__rosidl_typesupport_opensplice_c.h.em
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// generated from rosidl_typesupport_opensplice_c/resource/idl__rosidl_typesupport_c.h.em | ||
// generated code does not contain a copyright notice | ||
@{ | ||
from rosidl_cmake import convert_camel_case_to_lower_case_underscore | ||
include_parts = [package_name] + list(interface_path.parents[0].parts) + \ | ||
[convert_camel_case_to_lower_case_underscore(interface_path.stem)] | ||
header_guard_variable = '__'.join([x.upper() for x in include_parts]) + \ | ||
'__ROSIDL_TYPESUPPORT_OPENSPLICE_C_H_' | ||
}@ | ||
#ifndef @(header_guard_variable) | ||
#define @(header_guard_variable) | ||
@{ | ||
####################################################################### | ||
# EmPy template for generating <idl>__rosidl_typesupport_c.h files | ||
# | ||
# Context: | ||
# - package_name (string) | ||
# - content (rosidl_parser.definition.IdlContent result of parsing IDL file) | ||
# - interface_path (Path relative to the directory named after the package) | ||
####################################################################### | ||
|
||
include_directives = set() | ||
|
||
####################################################################### | ||
# Handle message | ||
####################################################################### | ||
from rosidl_parser.definition import Message | ||
for message in content.get_elements_of_type(Message): | ||
TEMPLATE( | ||
'msg__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, message=message, | ||
include_directives=include_directives) | ||
|
||
####################################################################### | ||
# Handle service | ||
####################################################################### | ||
from rosidl_parser.definition import Service | ||
for service in content.get_elements_of_type(Service): | ||
TEMPLATE( | ||
'srv__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, service=service, | ||
include_directives=include_directives) | ||
|
||
####################################################################### | ||
# Handle action | ||
####################################################################### | ||
from rosidl_parser.definition import Action | ||
for action in content.get_elements_of_type(Action): | ||
TEMPLATE( | ||
'msg__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, message=action.goal, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'msg__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, message=action.result, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'msg__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, message=action.feedback, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'srv__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, service=action.send_goal_service, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'srv__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, service=action.get_result_service, | ||
include_directives=include_directives) | ||
TEMPLATE( | ||
'msg__rosidl_typesupport_opensplice_c.h.em', | ||
package_name=package_name, interface_path=interface_path, message=action.feedback_message, | ||
include_directives=include_directives) | ||
}@ | ||
#endif // @(header_guard_variable) |
Oops, something went wrong.