Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
  • Loading branch information
InvincibleRMC committed Sep 1, 2024
2 parents e818297 + e25750d commit 4dcb79d
Show file tree
Hide file tree
Showing 73 changed files with 626 additions and 148 deletions.
15 changes: 15 additions & 0 deletions rosidl_adapter/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
Changelog for package rosidl_adapter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.8.1 (2024-06-25)
------------------

4.8.0 (2024-06-17)
------------------

4.7.0 (2024-04-26)
------------------

4.6.0 (2024-04-16)
------------------

4.5.2 (2024-03-27)
------------------

4.5.1 (2024-02-07)
------------------

Expand Down
2 changes: 1 addition & 1 deletion rosidl_adapter/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>rosidl_adapter</name>
<version>4.5.1</version>
<version>4.8.1</version>
<description>
API and scripts to parse .msg/.srv/.action files and convert them to .idl.
</description>
Expand Down
43 changes: 33 additions & 10 deletions rosidl_adapter/rosidl_adapter/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@

import em

try:
from em import Configuration
em_has_configuration = True
except ImportError:
em_has_configuration = False


def expand_template(template_name, data, output_file, encoding='utf-8'):
content = evaluate_template(template_name, data)
Expand Down Expand Up @@ -45,18 +51,31 @@ def evaluate_template(template_name, data):

output = StringIO()
try:
_interpreter = em.Interpreter(
output=output,
options={
em.BUFFERED_OPT: True,
em.RAW_OPT: True,
})

if em_has_configuration:
config = Configuration(
defaultRoot=template_path,
defaultStdout=output,
deleteOnError=True,
rawErrors=True,
useProxy=True)
_interpreter = em.Interpreter(
config=config,
dispatcher=False)
else:
_interpreter = em.Interpreter(
output=output,
options={
em.BUFFERED_OPT: True,
em.RAW_OPT: True,
})
with open(template_path, 'r') as h:
content = h.read()
_interpreter.invoke(
'beforeFile', name=template_name, file=h, locals=data)
_interpreter.string(content, template_path, locals=data)
if em_has_configuration:
_interpreter.string(content, locals=data)
else:
_interpreter.string(content, template_path, locals=data)
_interpreter.invoke('afterFile')

return output.getvalue()
Expand All @@ -66,7 +85,8 @@ def evaluate_template(template_name, data):
file=sys.stderr)
raise
finally:
_interpreter.shutdown()
if _interpreter is not None:
_interpreter.shutdown()
_interpreter = None


Expand All @@ -78,7 +98,10 @@ def _evaluate_template(template_name, **kwargs):
'beforeInclude', name=template_path, file=h, locals=kwargs)
content = h.read()
try:
_interpreter.string(content, template_path, kwargs)
if em_has_configuration:
_interpreter.string(content, locals=kwargs)
else:
_interpreter.string(content, template_path, kwargs)
except Exception as e: # noqa: F841
print(
f"{e.__class__.__name__} processing template '{template_name}': "
Expand Down
15 changes: 15 additions & 0 deletions rosidl_cli/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
Changelog for package rosidl_cli
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.8.1 (2024-06-25)
------------------

4.8.0 (2024-06-17)
------------------

4.7.0 (2024-04-26)
------------------

4.6.0 (2024-04-16)
------------------

4.5.2 (2024-03-27)
------------------

4.5.1 (2024-02-07)
------------------

Expand Down
2 changes: 1 addition & 1 deletion rosidl_cli/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>rosidl_cli</name>
<version>4.5.1</version>
<version>4.8.1</version>
<description>
Command line tools for ROS interface generation.
</description>
Expand Down
2 changes: 1 addition & 1 deletion rosidl_cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='rosidl_cli',
version='4.5.1',
version='4.8.1',
packages=find_packages(exclude=['test']),
extras_require={
'completion': ['argcomplete'],
Expand Down
17 changes: 17 additions & 0 deletions rosidl_cmake/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
Changelog for package rosidl_cmake
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.8.1 (2024-06-25)
------------------

4.8.0 (2024-06-17)
------------------

4.7.0 (2024-04-26)
------------------

4.6.0 (2024-04-16)
------------------

4.5.2 (2024-03-27)
------------------
* Improve deprecation notice of rosidl_target_interface to give a hint on how to update the code (`#788 <https://github.com/ros2/rosidl/issues/788>`_)
* Contributors: Alexis Paques

4.5.1 (2024-02-07)
------------------

Expand Down
2 changes: 1 addition & 1 deletion rosidl_cmake/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>rosidl_cmake</name>
<version>4.5.1</version>
<version>4.8.1</version>
<description>The CMake functionality to invoke code generation for ROS interface files.</description>

<maintainer email="aditya.pande@openrobotics.org">Aditya Pande</maintainer>
Expand Down
19 changes: 19 additions & 0 deletions rosidl_generator_c/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
Changelog for package rosidl_generator_c
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.8.1 (2024-06-25)
------------------

4.8.0 (2024-06-17)
------------------

4.7.0 (2024-04-26)
------------------
* Fixed warnings - strict-prototypes (`#800 <https://github.com/ros2/rosidl/issues/800>`_)
* Contributors: Alejandro Hernández Cordero

4.6.0 (2024-04-16)
------------------

4.5.2 (2024-03-27)
------------------
* Set hints to find the python version we actually want. (`#785 <https://github.com/ros2/rosidl/issues/785>`_)
* Contributors: Chris Lalancette

4.5.1 (2024-02-07)
------------------

Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosidl_generator_c</name>
<version>4.5.1</version>
<version>4.8.1</version>
<description>Generate the ROS interfaces in C.</description>

<maintainer email="aditya.pande@openrobotics.org">Aditya Pande</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/action__type_support.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const rosidl_action_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__ACTION_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(action.namespaced_type.namespaced_name()))
)();
)(void);

@{
TEMPLATE(
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/msg__functions.c.em
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool
}

@(message_typename) *
@(message_typename)__create()
@(message_typename)__create(void)
{
rcutils_allocator_t allocator = rcutils_get_default_allocator();
@(message_typename) * msg = (@(message_typename) *)allocator.allocate(sizeof(@(message_typename)), allocator.state);
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/msg__functions.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void
*/
ROSIDL_GENERATOR_C_PUBLIC_@(package_name)
@(message_typename) *
@(message_typename)__create();
@(message_typename)__create(void);
/// Destroy @(interface_path_to_string(interface_path)) message.
/**
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/msg__type_support.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(message.structure.namespaced_type.namespaced_name()))
)();
)(void);
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/srv__type_support.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const rosidl_service_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(service.namespaced_type.namespaced_name()))
)();
)(void);

// Forward declare the function to create a service event message for this type.
ROSIDL_GENERATOR_C_PUBLIC_@(package_name)
Expand Down
17 changes: 17 additions & 0 deletions rosidl_generator_cpp/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
Changelog for package rosidl_generator_cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.8.1 (2024-06-25)
------------------

4.8.0 (2024-06-17)
------------------

4.7.0 (2024-04-26)
------------------

4.6.0 (2024-04-16)
------------------

4.5.2 (2024-03-27)
------------------
* Set hints to find the python version we actually want. (`#785 <https://github.com/ros2/rosidl/issues/785>`_)
* Contributors: Chris Lalancette

4.5.1 (2024-02-07)
------------------

Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosidl_generator_cpp</name>
<version>4.5.1</version>
<version>4.8.1</version>
<description>Generate the ROS interfaces in C++.</description>

<maintainer email="aditya.pande@openrobotics.org">Aditya Pande</maintainer>
Expand Down
25 changes: 25 additions & 0 deletions rosidl_generator_tests/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
Changelog for package rosidl_generator_tests
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.8.1 (2024-06-25)
------------------
* Silence one more gcc false-positive. (`#814 <https://github.com/ros2/rosidl/issues/814>`_)
* Contributors: Chris Lalancette

4.8.0 (2024-06-17)
------------------
* Switch to using fastjsonschema for schema validation. (`#809 <https://github.com/ros2/rosidl/issues/809>`_)
* Contributors: Chris Lalancette

4.7.0 (2024-04-26)
------------------
* Fixed warnings - strict-prototypes (`#800 <https://github.com/ros2/rosidl/issues/800>`_)
* Contributors: Alejandro Hernández Cordero

4.6.0 (2024-04-16)
------------------
* Increased the cpplint timeout to 300 seconds (`#797 <https://github.com/ros2/rosidl/issues/797>`_)
* Contributors: Alejandro Hernández Cordero

4.5.2 (2024-03-27)
------------------
* Fixes for modern uncrustify. (`#793 <https://github.com/ros2/rosidl/issues/793>`_)
* Contributors: Chris Lalancette

4.5.1 (2024-02-07)
------------------

Expand Down
5 changes: 5 additions & 0 deletions rosidl_generator_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,8 @@ if(BUILD_TESTING)
endif()

ament_package()

if(TEST cpplint)
# must set the property after ament_package()
set_tests_properties(cpplint PROPERTIES TIMEOUT 300)
endif()
4 changes: 2 additions & 2 deletions rosidl_generator_tests/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosidl_generator_tests</name>
<version>4.5.1</version>
<version>4.8.1</version>
<description>Integration tests for rosidl_generator_c and rosidl_generator_cpp packages.</description>

<maintainer email="aditya.pande@openrobotics.org">Aditya Pande</maintainer>
Expand All @@ -24,7 +24,7 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>ament_index_python</test_depend>
<test_depend>python3-jsonschema</test_depend>
<test_depend>python3-fastjsonschema</test_depend>
<test_depend>rosidl_cmake</test_depend>
<test_depend>rosidl_generator_c</test_depend>
<test_depend>rosidl_generator_cpp</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "rosidl_generator_tests/msg/detail/defaults__struct.h"
#include "rosidl_generator_tests/msg/detail/defaults__functions.h"

int func()
int func(void)
{
rosidl_generator_tests__msg__Defaults * msg = rosidl_generator_tests__msg__Defaults__create();
if (!msg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
#ifndef ROSIDL_GENERATOR_C__SEPARATE_COMPILATION_H_
#define ROSIDL_GENERATOR_C__SEPARATE_COMPILATION_H_

int func();
int func(void);

#endif // ROSIDL_GENERATOR_C__SEPARATE_COMPILATION_H_
Loading

0 comments on commit 4dcb79d

Please sign in to comment.