From ccea19c9333bdede18bf46b09332909611c47beb Mon Sep 17 00:00:00 2001 From: Niels Tiben Date: Fri, 29 May 2020 15:40:26 +0200 Subject: [PATCH] Fix action generation Before, we were not generating code for: * `_SendGoal_Request` * `_SendGoal_Response` * `_GetResult_Request` * `_GetResult_Response` Before, code was generated for `_Send_Goal`, but this code was duplicate to the code in FeedbackMessage, which caused unwanted behaviour since it was not meant to be generated there. --- rosidl_generator_java/resource/action.cpp.em | 30 ++++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/rosidl_generator_java/resource/action.cpp.em b/rosidl_generator_java/resource/action.cpp.em index 1fcdd7fb..e6291779 100644 --- a/rosidl_generator_java/resource/action.cpp.em +++ b/rosidl_generator_java/resource/action.cpp.em @@ -58,21 +58,45 @@ expand_template( data, output_file) +# Generate SendGoal message type +data.update({'msg': action.send_goal_service.request_message}) +output_file = os.path.join(output_dir, *namespaces[1:], '{0}.ep.{1}.cpp'.format(send_goal_type_name, typesupport_impl)) +expand_template( + 'msg.cpp.em', + data, + output_file) + +# Generate GetResult message type +data.update({'msg': action.get_result_service.request_message}) +output_file = os.path.join(output_dir, *namespaces[1:], '{0}.ep.{1}.cpp'.format(send_goal_type_name, typesupport_impl)) +expand_template( + 'msg.cpp.em', + data, + output_file) + +data = { + 'package_name': package_name, + 'interface_path': interface_path, + 'output_dir': output_dir, + 'template_basepath': template_basepath, + 'typesupport_impl': typesupport_impl, +} + # Generate SendGoal service type data.update({'service': action.send_goal_service}) output_file = os.path.join( output_dir, *namespaces[1:], '{0}.ep.{1}.cpp'.format(send_goal_type_name, typesupport_impl)) expand_template( - 'msg.cpp.em', + 'srv.cpp.em', data, output_file) -# Generate SendGoal service type +# Generate GetResult service type data.update({'service': action.get_result_service}) output_file = os.path.join( output_dir, *namespaces[1:], '{0}.ep.{1}.cpp'.format(get_result_type_name, typesupport_impl)) expand_template( - 'msg.cpp.em', + 'srv.cpp.em', data, output_file) }@