diff --git a/.github/workflows/check-copied-type-description-sources.yaml b/.github/workflows/check-copied-type-description-sources.yaml index fbb78bef8..6c2400e47 100644 --- a/.github/workflows/check-copied-type-description-sources.yaml +++ b/.github/workflows/check-copied-type-description-sources.yaml @@ -11,12 +11,12 @@ jobs: steps: - uses: actions/checkout@v3 - name: Check fingerprint changed - uses: tj-actions/changed-files@v35 + uses: tj-actions/changed-files@v41 id: changed-fingerprint with: files: scripts/type_description.fingerprint - name: Check type description sources changed - uses: tj-actions/changed-files@v35 + uses: tj-actions/changed-files@v41 id: changed-copied-sources with: files: | diff --git a/rosidl_adapter/CHANGELOG.rst b/rosidl_adapter/CHANGELOG.rst index 85f49f911..8071dd794 100644 --- a/rosidl_adapter/CHANGELOG.rst +++ b/rosidl_adapter/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package rosidl_adapter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_adapter/package.xml b/rosidl_adapter/package.xml index 28ddd3b9e..6f2d8f5bd 100644 --- a/rosidl_adapter/package.xml +++ b/rosidl_adapter/package.xml @@ -2,7 +2,7 @@ rosidl_adapter - 4.4.0 + 4.5.1 API and scripts to parse .msg/.srv/.action files and convert them to .idl. diff --git a/rosidl_cli/CHANGELOG.rst b/rosidl_cli/CHANGELOG.rst index 6a2856bdb..ebfd58a6d 100644 --- a/rosidl_cli/CHANGELOG.rst +++ b/rosidl_cli/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package rosidl_cli ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_cli/package.xml b/rosidl_cli/package.xml index ce1f82009..eb0ce4bc1 100644 --- a/rosidl_cli/package.xml +++ b/rosidl_cli/package.xml @@ -2,7 +2,7 @@ rosidl_cli - 4.4.0 + 4.5.1 Command line tools for ROS interface generation. diff --git a/rosidl_cli/setup.py b/rosidl_cli/setup.py index 164d148b8..aec16306a 100644 --- a/rosidl_cli/setup.py +++ b/rosidl_cli/setup.py @@ -3,7 +3,7 @@ setup( name='rosidl_cli', - version='4.4.0', + version='4.5.1', packages=find_packages(exclude=['test']), extras_require={ 'completion': ['argcomplete'], diff --git a/rosidl_cmake/CHANGELOG.rst b/rosidl_cmake/CHANGELOG.rst index 0c78f57d8..d5fa70561 100644 --- a/rosidl_cmake/CHANGELOG.rst +++ b/rosidl_cmake/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package rosidl_cmake ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ * Add rosidl_find_package_idl helper function (`#754 `_) diff --git a/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake b/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake index 5ced5dd58..829243059 100644 --- a/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake +++ b/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake @@ -284,6 +284,23 @@ macro(rosidl_generate_interfaces target) set(rosidl_generator_arguments_files) ament_execute_extensions("rosidl_write_generator_arguments_extensions") + + # By default, without the settings below, find_package(Python3) will attempt + # to find the newest python version it can, and additionally will find the + # most specific version. For instance, on a system that has + # /usr/bin/python3.10, /usr/bin/python3.11, and /usr/bin/python3, it will find + # /usr/bin/python3.11, even if /usr/bin/python3 points to /usr/bin/python3.10. + # The behavior we want is to prefer the "system" installed version unless the + # user specifically tells us othewise through the Python3_EXECUTABLE hint. + # Setting CMP0094 to NEW means that the search will stop after the first + # python version is found. Setting Python3_FIND_UNVERSIONED_NAMES means that + # the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that + # latter functionality is only available in CMake 3.20 or later, so we need + # at least that version. + cmake_minimum_required(VERSION 3.20) + cmake_policy(SET CMP0094 NEW) + set(Python3_FIND_UNVERSIONED_NAMES FIRST) + find_package(Python3 REQUIRED COMPONENTS Interpreter) # Generate the interface source files for all registered languages and type supports diff --git a/rosidl_cmake/cmake/rosidl_target_interfaces.cmake b/rosidl_cmake/cmake/rosidl_target_interfaces.cmake index f3d08eb34..135b42108 100644 --- a/rosidl_cmake/cmake/rosidl_target_interfaces.cmake +++ b/rosidl_cmake/cmake/rosidl_target_interfaces.cmake @@ -29,7 +29,10 @@ # @public # function(rosidl_target_interfaces target interface_target typesupport_name) - message(DEPRECATION "Use rosidl_get_typesupport_target() and target_link_libraries() instead of rosidl_target_interfaces()") + message(DEPRECATION "Use rosidl_get_typesupport_target() and target_link_libraries() instead of rosidl_target_interfaces(). i.e: + rosidl_get_typesupport_target(cpp_typesupport_target \"\${PROJECT_NAME}\" \"rosidl_typesupport_cpp\") + target_link_libraries(\${PROJECT_NAME}_node \"\${cpp_typesupport_target}\") +") if(ARGN) message(FATAL_ERROR "rosidl_target_interfaces() called with unused arguments: ${ARGN}") diff --git a/rosidl_cmake/package.xml b/rosidl_cmake/package.xml index ee0d693d3..0378e5a0a 100644 --- a/rosidl_cmake/package.xml +++ b/rosidl_cmake/package.xml @@ -2,7 +2,7 @@ rosidl_cmake - 4.4.0 + 4.5.1 The CMake functionality to invoke code generation for ROS interface files. Aditya Pande diff --git a/rosidl_generator_c/CHANGELOG.rst b/rosidl_generator_c/CHANGELOG.rst index 445c1749e..c583b762d 100644 --- a/rosidl_generator_c/CHANGELOG.rst +++ b/rosidl_generator_c/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package rosidl_generator_c ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ * Add rosidl_find_package_idl helper function (`#754 `_) diff --git a/rosidl_generator_c/package.xml b/rosidl_generator_c/package.xml index bb84ddcb6..742eb1724 100644 --- a/rosidl_generator_c/package.xml +++ b/rosidl_generator_c/package.xml @@ -2,7 +2,7 @@ rosidl_generator_c - 4.4.0 + 4.5.1 Generate the ROS interfaces in C. Aditya Pande diff --git a/rosidl_generator_cpp/CHANGELOG.rst b/rosidl_generator_cpp/CHANGELOG.rst index 268f5bfdf..cf7533a6b 100644 --- a/rosidl_generator_cpp/CHANGELOG.rst +++ b/rosidl_generator_cpp/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_generator_cpp ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ +* Fix constant generation for C++ floats (`#772 `_) +* Contributors: Chris Lalancette + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ * Add rosidl_find_package_idl helper function (`#754 `_) diff --git a/rosidl_generator_cpp/package.xml b/rosidl_generator_cpp/package.xml index 7d6db0101..98ba8b8d1 100644 --- a/rosidl_generator_cpp/package.xml +++ b/rosidl_generator_cpp/package.xml @@ -2,7 +2,7 @@ rosidl_generator_cpp - 4.4.0 + 4.5.1 Generate the ROS interfaces in C++. Aditya Pande diff --git a/rosidl_generator_cpp/resource/msg__struct.hpp.em b/rosidl_generator_cpp/resource/msg__struct.hpp.em index 6d1c1363b..6e583888f 100644 --- a/rosidl_generator_cpp/resource/msg__struct.hpp.em +++ b/rosidl_generator_cpp/resource/msg__struct.hpp.em @@ -280,10 +280,16 @@ non_defaulted_zero_initialized_members = [ static const @(MSG_TYPE_TO_CPP['wstring']) @(constant.name); @[ else]@ static constexpr @(MSG_TYPE_TO_CPP[constant.type.typename]) @(constant.name) = -@[ if isinstance(constant.type, BasicType) and constant.type.typename in (*INTEGER_TYPES, *CHARACTER_TYPES, BOOLEAN_TYPE, OCTET_TYPE)]@ +@[ if isinstance(constant.type, BasicType)]@ +@[ if constant.type.typename in (*INTEGER_TYPES, *CHARACTER_TYPES, BOOLEAN_TYPE, OCTET_TYPE)]@ @(int(constant.value))@ -@[ if constant.type.typename in UNSIGNED_INTEGER_TYPES]@ +@[ if constant.type.typename in UNSIGNED_INTEGER_TYPES]@ u@ +@[ end if]@ +@[ elif constant.type.typename == 'float']@ + @(constant.value)f@ +@[ else]@ + @(constant.value)@ @[ end if]; @[ else]@ @(constant.value); diff --git a/rosidl_generator_tests/CHANGELOG.rst b/rosidl_generator_tests/CHANGELOG.rst index 982341f15..1efd3fc3b 100644 --- a/rosidl_generator_tests/CHANGELOG.rst +++ b/rosidl_generator_tests/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_generator_tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ +* Fix constant generation for C++ floats (`#772 `_) +* Contributors: Chris Lalancette + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_generator_tests/CMakeLists.txt b/rosidl_generator_tests/CMakeLists.txt index 514a42853..f36054b70 100644 --- a/rosidl_generator_tests/CMakeLists.txt +++ b/rosidl_generator_tests/CMakeLists.txt @@ -35,6 +35,7 @@ if(BUILD_TESTING) ${test_interface_files_MSG_FILES} ${test_interface_files_SRV_FILES} msg/BasicIdl.idl + msg/SmallConstant.msg ADD_LINTER_TESTS SKIP_INSTALL ) diff --git a/rosidl_generator_tests/msg/SmallConstant.msg b/rosidl_generator_tests/msg/SmallConstant.msg new file mode 100644 index 000000000..a58ff4167 --- /dev/null +++ b/rosidl_generator_tests/msg/SmallConstant.msg @@ -0,0 +1 @@ +float32 FLOAT32_CONST=0.05 diff --git a/rosidl_generator_tests/package.xml b/rosidl_generator_tests/package.xml index 811c86c69..2726f15fa 100644 --- a/rosidl_generator_tests/package.xml +++ b/rosidl_generator_tests/package.xml @@ -2,7 +2,7 @@ rosidl_generator_tests - 4.4.0 + 4.5.1 Integration tests for rosidl_generator_c and rosidl_generator_cpp packages. Aditya Pande diff --git a/rosidl_generator_tests/test/rosidl_generator_c/test_interfaces.c b/rosidl_generator_tests/test/rosidl_generator_c/test_interfaces.c index 72b1a56cb..5cb72ca20 100644 --- a/rosidl_generator_tests/test/rosidl_generator_c/test_interfaces.c +++ b/rosidl_generator_tests/test/rosidl_generator_c/test_interfaces.c @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - #include #include #include @@ -63,97 +62,28 @@ } #define EXPECT_NE(arg1, arg2) if ((arg1) == (arg2)) return 1 -const uint8_t test_values_byte[ARR_SIZE] = {0, 57, 110}; -const char test_values_char[ARR_SIZE] = {'a', '5', '#'}; -const float test_values_float32[ARR_SIZE] = {-3.000001f, 22143.541325f, 6331.00432f}; -const double test_values_float64[ARR_SIZE] = { +static const uint8_t test_values_byte[ARR_SIZE] = {0, 57, 110}; +static const char test_values_char[ARR_SIZE] = {'a', '5', '#'}; +static const float test_values_float32[ARR_SIZE] = {-3.000001f, 22143.541325f, 6331.00432f}; +static const double test_values_float64[ARR_SIZE] = { -120310.00843902140001, 22143.54483920141325, 6331.0048392104432 }; -const int8_t test_values_int8[ARR_SIZE] = {-50, 13, 110}; -const uint8_t test_values_uint8[ARR_SIZE] = {0, 125, 250}; -const int16_t test_values_int16[ARR_SIZE] = {-22222, 0, 32767}; -const uint16_t test_values_uint16[ARR_SIZE] = {0U, 33333U, 65535U}; -const int32_t test_values_int32[ARR_SIZE] = {INT32_MIN / 2, 0L, INT32_MAX / 2}; -const uint32_t test_values_uint32[ARR_SIZE] = {0UL, 444444UL, 4294967295UL}; -const int64_t test_values_int64[ARR_SIZE] = {-9223372036854775807LL, 0, 9223372036854775807ULL}; -const uint64_t test_values_uint64[ARR_SIZE] = {0ULL, 567890123456789ULL, 18446744073709551615ULL}; -const char * test_values_string[ARR_SIZE] = {"", "max value", "min value"}; - -int test_arrays(void); -int test_basic_types(void); -int test_bounded_sequences(void); -int test_constants(void); -int test_defaults(void); -int test_multi_nested(void); -int test_nested(void); -int test_strings(void); -int test_unbounded_sequences(void); -int test_wstrings(void); - -int main(void) -{ - int rc = 0; - printf("Testing rosidl_generator_tests basic types...\n"); - if (test_basic_types()) { - fprintf(stderr, "test_basic_types() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests constant types...\n"); - if (test_constants()) { - fprintf(stderr, "test_constant() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests default types...\n"); - if (test_defaults()) { - fprintf(stderr, "test_defaults() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests string types...\n"); - if (test_strings()) { - fprintf(stderr, "test_strings() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests array types\n"); - if (test_arrays()) { - fprintf(stderr, "test_arrays() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests wstring types\n"); - if (test_wstrings()) { - fprintf(stderr, "test_wstrings() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests bounded_sequences types\n"); - if (test_bounded_sequences()) { - fprintf(stderr, "test_bounded_sequences() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests nested types\n"); - if (test_nested()) { - fprintf(stderr, "test_nested() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests unbounded_sequences types\n"); - if (test_unbounded_sequences()) { - fprintf(stderr, "test_unbounded_sequences() FAILED\n"); - rc++; - } - printf("Testing rosidl_generator_tests multi_nested type\n"); - if (test_multi_nested()) { - fprintf(stderr, "test_multi_nested() FAILED\n"); - rc++; - } - if (rc != 0) { - fprintf(stderr, "Some tests failed!\n"); - } else { - printf("All tests were good!\n"); - } - return rc != 0; -} +static const int8_t test_values_int8[ARR_SIZE] = {-50, 13, 110}; +static const uint8_t test_values_uint8[ARR_SIZE] = {0, 125, 250}; +static const int16_t test_values_int16[ARR_SIZE] = {-22222, 0, 32767}; +static const uint16_t test_values_uint16[ARR_SIZE] = {0U, 33333U, 65535U}; +static const int32_t test_values_int32[ARR_SIZE] = {INT32_MIN / 2, 0L, INT32_MAX / 2}; +static const uint32_t test_values_uint32[ARR_SIZE] = {0UL, 444444UL, 4294967295UL}; +static const int64_t test_values_int64[ARR_SIZE] = { + -9223372036854775807LL, 0, 9223372036854775807ULL +}; +static const uint64_t test_values_uint64[ARR_SIZE] = { + 0ULL, 567890123456789ULL, 18446744073709551615ULL +}; +static const char * test_values_string[ARR_SIZE] = {"", "max value", "min value"}; -int test_basic_types(void) +static int test_basic_types(void) { - // rosidl_generator_tests__msg__BasicTypes basic; rosidl_generator_tests__msg__BasicTypes * basic = NULL; basic = rosidl_generator_tests__msg__BasicTypes__create(); EXPECT_NE(basic, NULL); @@ -214,7 +144,7 @@ int test_basic_types(void) return 0; } -int test_constants(void) +static int test_constants(void) { EXPECT_EQ(true, rosidl_generator_tests__msg__Constants__BOOL_CONST); EXPECT_EQ(50, rosidl_generator_tests__msg__Constants__BYTE_CONST); @@ -233,7 +163,7 @@ int test_constants(void) return 0; } -int test_defaults() +static int test_defaults(void) { rosidl_generator_tests__msg__Defaults * def = NULL; def = rosidl_generator_tests__msg__Defaults__create(); @@ -271,7 +201,7 @@ int test_defaults() return 0; } -int test_bounded_sequences() +static int test_bounded_sequences(void) { rosidl_generator_tests__msg__BoundedSequences * seq = NULL; seq = rosidl_generator_tests__msg__BoundedSequences__create(); @@ -728,7 +658,7 @@ int test_unbounded_sequences() return 0; } -int test_strings() +static int test_strings(void) { rosidl_generator_tests__msg__Strings * str = NULL; str = rosidl_generator_tests__msg__Strings__create(); @@ -772,7 +702,7 @@ int test_strings() return 0; } -int test_nested() +static int test_nested(void) { rosidl_generator_tests__msg__Nested * nested = NULL; nested = rosidl_generator_tests__msg__Nested__create(); @@ -823,7 +753,7 @@ int test_nested() return 0; } -int test_multi_nested() +static int test_multi_nested(void) { rosidl_generator_tests__msg__MultiNested * msg = NULL; msg = rosidl_generator_tests__msg__MultiNested__create(); @@ -872,7 +802,6 @@ int test_multi_nested() } // char_values - char test_values_char[ARR_SIZE] = {'a', '5', '#'}; for (i = 0; i < ARR_SIZE; i++) { for (j = 0; j < ARR_SIZE; j++) { msg->array_of_arrays[i].char_values[j] = test_values_char[j]; @@ -1099,7 +1028,7 @@ int test_wstrings() return 0; } -int test_arrays() +static int test_arrays(void) { rosidl_generator_tests__msg__Arrays * arr = NULL; arr = rosidl_generator_tests__msg__Arrays__create(); @@ -1298,3 +1227,64 @@ int test_arrays() rosidl_generator_tests__msg__Arrays__destroy(arr); return 0; } + +int main(void) +{ + int rc = 0; + printf("Testing rosidl_generator_tests basic types...\n"); + if (test_basic_types()) { + fprintf(stderr, "test_basic_types() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests constant types...\n"); + if (test_constants()) { + fprintf(stderr, "test_constant() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests default types...\n"); + if (test_defaults()) { + fprintf(stderr, "test_defaults() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests string types...\n"); + if (test_strings()) { + fprintf(stderr, "test_strings() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests array types\n"); + if (test_arrays()) { + fprintf(stderr, "test_arrays() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests wstring types\n"); + if (test_wstrings()) { + fprintf(stderr, "test_wstrings() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests bounded_sequences types\n"); + if (test_bounded_sequences()) { + fprintf(stderr, "test_bounded_sequences() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests nested types\n"); + if (test_nested()) { + fprintf(stderr, "test_nested() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests unbounded_sequences types\n"); + if (test_unbounded_sequences()) { + fprintf(stderr, "test_unbounded_sequences() FAILED\n"); + rc++; + } + printf("Testing rosidl_generator_tests multi_nested type\n"); + if (test_multi_nested()) { + fprintf(stderr, "test_multi_nested() FAILED\n"); + rc++; + } + if (rc != 0) { + fprintf(stderr, "Some tests failed!\n"); + } else { + printf("All tests were good!\n"); + } + return rc != 0; +} diff --git a/rosidl_generator_tests/test/rosidl_generator_cpp/test_interfaces.cpp b/rosidl_generator_tests/test/rosidl_generator_cpp/test_interfaces.cpp index 9405d6238..e41230221 100644 --- a/rosidl_generator_tests/test/rosidl_generator_cpp/test_interfaces.cpp +++ b/rosidl_generator_tests/test/rosidl_generator_cpp/test_interfaces.cpp @@ -13,13 +13,15 @@ // limitations under the License. #include -#include -#include + +#include +#include #include +#include #include #include #include -#include + #include "test_array_generator.hpp" #include "rosidl_generator_tests/msg/arrays.hpp" @@ -30,6 +32,7 @@ #include "rosidl_generator_tests/msg/empty.hpp" #include "rosidl_generator_tests/msg/multi_nested.hpp" #include "rosidl_generator_tests/msg/nested.hpp" +#include "rosidl_generator_tests/msg/small_constant.hpp" #include "rosidl_generator_tests/msg/strings.hpp" #include "rosidl_generator_tests/msg/unbounded_sequences.hpp" #include "rosidl_generator_tests/msg/w_strings.hpp" @@ -146,10 +149,6 @@ TEST(Test_rosidl_generator_traits, has_bounded_size) { Message.FieldName = FinalValue; \ ASSERT_STREQ(FinalValue, Message.FieldName.c_str()); -#define TEST_WSTRING_FIELD_ASSIGNMENT(Message, FieldName, InitialValue, FinalValue) \ - Message.FieldName = InitialValue; \ - Message.FieldName = FinalValue; - void test_message_basic_types(rosidl_generator_tests::msg::BasicTypes message) { // workaround for https://github.com/google/googletest/issues/322 @@ -470,6 +469,12 @@ TEST(Test_messages, constants) { ASSERT_EQ(50000000ull, message.UINT64_CONST); } +TEST(Test_messages, constants_assign) { + float x = rosidl_generator_tests::msg::SmallConstant::FLOAT32_CONST; + + ASSERT_EQ(x, rosidl_generator_tests::msg::SmallConstant::FLOAT32_CONST); +} + // Defaults TEST(Test_messages, defaults) { rosidl_generator_tests::msg::Defaults message; @@ -522,20 +527,19 @@ TEST(Test_messages, Test_string) { TEST(Test_messages, Test_wstring) { rosidl_generator_tests::msg::WStrings message; - TEST_WSTRING_FIELD_ASSIGNMENT(message, wstring_value, u"", u"wstring_value_\u2122") + message.wstring_value = u""; + message.wstring_value = u"wstring_value_\u2122"; } -#define TEST_STATIC_ARRAY_STRING( \ - Message, FieldName, PrimitiveType, ArraySize, MinVal, MaxVal, MinLength, MaxLength) \ - std::array pattern_ ## FieldName; \ - test_vector_fill( \ - &pattern_ ## FieldName, ArraySize, MinVal, MaxVal, MinLength, MaxLength); \ - std::copy_n(pattern_ ## FieldName.begin(), Message.FieldName.size(), Message.FieldName.begin()); \ - ASSERT_EQ(pattern_ ## FieldName, Message.FieldName); \ - TEST(Test_messages, Test_string_array_static) { rosidl_generator_tests::msg::Arrays message; - TEST_STATIC_ARRAY_STRING( - message, string_values_default, std::string, ARRAY_SIZE, \ - 0, UINT32_MAX, 0, UINT16_MAX) + std::array pattern_string_values_default; + + test_vector_fill>( + &pattern_string_values_default, ARRAY_SIZE, 0, UINT32_MAX, 0, UINT16_MAX); + std::copy_n( + pattern_string_values_default.begin(), + message.string_values_default.size(), + message.string_values_default.begin()); + ASSERT_EQ(pattern_string_values_default, message.string_values_default); } diff --git a/rosidl_generator_type_description/CHANGELOG.rst b/rosidl_generator_type_description/CHANGELOG.rst index 9448eded3..816ea34f8 100644 --- a/rosidl_generator_type_description/CHANGELOG.rst +++ b/rosidl_generator_type_description/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_generator_type_description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ +* Remove unnecessary parentheses. (`#783 `_) +* Contributors: Chris Lalancette + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_generator_type_description/cmake/rosidl_generator_type_description_generate_interfaces.cmake b/rosidl_generator_type_description/cmake/rosidl_generator_type_description_generate_interfaces.cmake index e3fc167a0..12453b2ea 100644 --- a/rosidl_generator_type_description/cmake/rosidl_generator_type_description_generate_interfaces.cmake +++ b/rosidl_generator_type_description/cmake/rosidl_generator_type_description_generate_interfaces.cmake @@ -12,6 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +# By default, without the settings below, find_package(Python3) will attempt +# to find the newest python version it can, and additionally will find the +# most specific version. For instance, on a system that has +# /usr/bin/python3.10, /usr/bin/python3.11, and /usr/bin/python3, it will find +# /usr/bin/python3.11, even if /usr/bin/python3 points to /usr/bin/python3.10. +# The behavior we want is to prefer the "system" installed version unless the +# user specifically tells us othewise through the Python3_EXECUTABLE hint. +# Setting CMP0094 to NEW means that the search will stop after the first +# python version is found. Setting Python3_FIND_UNVERSIONED_NAMES means that +# the search will prefer /usr/bin/python3 over /usr/bin/python3.11. And that +# latter functionality is only available in CMake 3.20 or later, so we need +# at least that version. +cmake_minimum_required(VERSION 3.20) +cmake_policy(SET CMP0094 NEW) +set(Python3_FIND_UNVERSIONED_NAMES FIRST) + find_package(Python3 REQUIRED COMPONENTS Interpreter) set(_output_path "${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_type_description/${PROJECT_NAME}") diff --git a/rosidl_generator_type_description/package.xml b/rosidl_generator_type_description/package.xml index 198ff4464..4addfd4bc 100644 --- a/rosidl_generator_type_description/package.xml +++ b/rosidl_generator_type_description/package.xml @@ -2,7 +2,7 @@ rosidl_generator_type_description - 4.4.0 + 4.5.1 Generate hashes and descriptions of ROS 2 interface types, per REP-2011. Emerson Knapp diff --git a/rosidl_generator_type_description/rosidl_generator_type_description/__init__.py b/rosidl_generator_type_description/rosidl_generator_type_description/__init__.py index a940a04fb..c62df1787 100644 --- a/rosidl_generator_type_description/rosidl_generator_type_description/__init__.py +++ b/rosidl_generator_type_description/rosidl_generator_type_description/__init__.py @@ -117,7 +117,7 @@ def generate_type_hash(generator_arguments_file: str) -> List[str]: except Exception as e: print('Error processing idl file: ' + str(locator.get_absolute_path()), file=sys.stderr) - raise(e) + raise e idl_rel_path = Path(idl_parts[1]) generate_to_dir = (output_dir / idl_rel_path).parent diff --git a/rosidl_parser/CHANGELOG.rst b/rosidl_parser/CHANGELOG.rst index 2cd32c2bd..412aa561b 100644 --- a/rosidl_parser/CHANGELOG.rst +++ b/rosidl_parser/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_parser ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ +* Remove unnecessary parentheses. (`#783 `_) +* Contributors: Chris Lalancette + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_parser/package.xml b/rosidl_parser/package.xml index 9d53afaf1..78a75832f 100644 --- a/rosidl_parser/package.xml +++ b/rosidl_parser/package.xml @@ -2,7 +2,7 @@ rosidl_parser - 4.4.0 + 4.5.1 The parser for `.idl` ROS interface files. Aditya Pande diff --git a/rosidl_parser/test/test_parser.py b/rosidl_parser/test/test_parser.py index 90fc38696..447655a17 100644 --- a/rosidl_parser/test/test_parser.py +++ b/rosidl_parser/test/test_parser.py @@ -315,13 +315,13 @@ def test_service_parser(service_idl_file): assert srv.namespaced_type.name == 'MyService' assert len(srv.request_message.structure.members) == 2 assert len(srv.response_message.structure.members) == 1 - assert(srv.event_message.structure.namespaced_type.name == + assert (srv.event_message.structure.namespaced_type.name == 'MyService' + SERVICE_EVENT_MESSAGE_SUFFIX) event_message_members = [i.name for i in srv.event_message.structure.members] - assert('request' in event_message_members) - assert('response' in event_message_members) - assert('info' in event_message_members) + assert 'request' in event_message_members + assert 'response' in event_message_members + assert 'info' in event_message_members constants = srv.request_message.constants assert len(constants) == 1 diff --git a/rosidl_pycommon/CHANGELOG.rst b/rosidl_pycommon/CHANGELOG.rst index 071da2c8e..55a6d9de9 100644 --- a/rosidl_pycommon/CHANGELOG.rst +++ b/rosidl_pycommon/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_pycommon ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ +* Remove unnecessary parentheses. (`#783 `_) +* Contributors: Chris Lalancette + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_pycommon/package.xml b/rosidl_pycommon/package.xml index ef77360ff..e47237266 100644 --- a/rosidl_pycommon/package.xml +++ b/rosidl_pycommon/package.xml @@ -2,7 +2,7 @@ rosidl_pycommon - 4.4.0 + 4.5.1 Common Python functions used by rosidl packages. Aditya Pande diff --git a/rosidl_pycommon/rosidl_pycommon/__init__.py b/rosidl_pycommon/rosidl_pycommon/__init__.py index c8c88fc01..3d3cfd637 100644 --- a/rosidl_pycommon/rosidl_pycommon/__init__.py +++ b/rosidl_pycommon/rosidl_pycommon/__init__.py @@ -118,7 +118,7 @@ def generate_files( print( 'Error processing idl file: ' + str(locator.get_absolute_path()), file=sys.stderr) - raise(e) + raise e return generated_files diff --git a/rosidl_pycommon/setup.py b/rosidl_pycommon/setup.py index 1d519a4f4..39273fd06 100644 --- a/rosidl_pycommon/setup.py +++ b/rosidl_pycommon/setup.py @@ -5,7 +5,7 @@ setup( name=package_name, - version='4.4.0', + version='4.5.1', packages=find_packages(exclude=['test']), data_files=[ ('share/ament_index/resource_index/packages', diff --git a/rosidl_runtime_c/CHANGELOG.rst b/rosidl_runtime_c/CHANGELOG.rst index 478d949c6..086b747d4 100644 --- a/rosidl_runtime_c/CHANGELOG.rst +++ b/rosidl_runtime_c/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_runtime_c ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ +* Switch to target_link_libraries. (`#776 `_) +* Contributors: Chris Lalancette + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_runtime_c/CMakeLists.txt b/rosidl_runtime_c/CMakeLists.txt index e0ceff419..825a026ce 100644 --- a/rosidl_runtime_c/CMakeLists.txt +++ b/rosidl_runtime_c/CMakeLists.txt @@ -37,9 +37,10 @@ add_library(${PROJECT_NAME} target_include_directories(${PROJECT_NAME} PUBLIC "$" "$") -ament_target_dependencies(${PROJECT_NAME} - "rcutils" - "rosidl_typesupport_interface") +target_link_libraries(${PROJECT_NAME} PUBLIC + rcutils::rcutils + rosidl_typesupport_interface::rosidl_typesupport_interface +) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_OPTIONS -Wall -Wextra -Wpedantic) @@ -116,8 +117,6 @@ if(BUILD_TESTING) ament_add_gtest(test_sequence_bound test/test_sequence_bound.cpp) if(TARGET test_sequence_bound) - ament_target_dependencies(test_sequence_bound - "rosidl_typesupport_interface") target_link_libraries(test_sequence_bound ${PROJECT_NAME}) endif() diff --git a/rosidl_runtime_c/package.xml b/rosidl_runtime_c/package.xml index c37f0edb5..61ac9a30e 100644 --- a/rosidl_runtime_c/package.xml +++ b/rosidl_runtime_c/package.xml @@ -2,7 +2,7 @@ rosidl_runtime_c - 4.4.0 + 4.5.1 Provides definitions, initialization and finalization functions, and macros for getting and working with rosidl typesupport types in C. Aditya Pande diff --git a/rosidl_runtime_cpp/CHANGELOG.rst b/rosidl_runtime_cpp/CHANGELOG.rst index 042aee74b..98024798a 100644 --- a/rosidl_runtime_cpp/CHANGELOG.rst +++ b/rosidl_runtime_cpp/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package rosidl_runtime_cpp ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_runtime_cpp/package.xml b/rosidl_runtime_cpp/package.xml index b4b72fd16..e6365c7f1 100644 --- a/rosidl_runtime_cpp/package.xml +++ b/rosidl_runtime_cpp/package.xml @@ -2,7 +2,7 @@ rosidl_runtime_cpp - 4.4.0 + 4.5.1 Provides definitions and templated functions for getting and working with rosidl typesupport types in C++. Aditya Pande diff --git a/rosidl_typesupport_interface/CHANGELOG.rst b/rosidl_typesupport_interface/CHANGELOG.rst index c67823388..cdf2f2f94 100644 --- a/rosidl_typesupport_interface/CHANGELOG.rst +++ b/rosidl_typesupport_interface/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package rosidl_typesupport_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ diff --git a/rosidl_typesupport_interface/package.xml b/rosidl_typesupport_interface/package.xml index 41f794894..1cced6f6a 100644 --- a/rosidl_typesupport_interface/package.xml +++ b/rosidl_typesupport_interface/package.xml @@ -2,7 +2,7 @@ rosidl_typesupport_interface - 4.4.0 + 4.5.1 The interface for rosidl typesupport packages. diff --git a/rosidl_typesupport_introspection_c/CHANGELOG.rst b/rosidl_typesupport_introspection_c/CHANGELOG.rst index 910f48a1f..13286edef 100644 --- a/rosidl_typesupport_introspection_c/CHANGELOG.rst +++ b/rosidl_typesupport_introspection_c/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package rosidl_typesupport_introspection_c ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ * Add rosidl_find_package_idl helper function (`#754 `_) diff --git a/rosidl_typesupport_introspection_c/package.xml b/rosidl_typesupport_introspection_c/package.xml index 021aab6a1..67c5dc8b1 100644 --- a/rosidl_typesupport_introspection_c/package.xml +++ b/rosidl_typesupport_introspection_c/package.xml @@ -2,7 +2,7 @@ rosidl_typesupport_introspection_c - 4.4.0 + 4.5.1 Generate the message type support for dynamic message construction in C. diff --git a/rosidl_typesupport_introspection_cpp/CHANGELOG.rst b/rosidl_typesupport_introspection_cpp/CHANGELOG.rst index fa8231e88..285950414 100644 --- a/rosidl_typesupport_introspection_cpp/CHANGELOG.rst +++ b/rosidl_typesupport_introspection_cpp/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_typesupport_introspection_cpp ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ +* Switch to target_link_libraries. (`#776 `_) +* Contributors: Chris Lalancette + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ + 4.4.0 (2023-09-07) ------------------ * Add rosidl_find_package_idl helper function (`#754 `_) diff --git a/rosidl_typesupport_introspection_cpp/CMakeLists.txt b/rosidl_typesupport_introspection_cpp/CMakeLists.txt index e71ee950e..b7d7dcac2 100644 --- a/rosidl_typesupport_introspection_cpp/CMakeLists.txt +++ b/rosidl_typesupport_introspection_cpp/CMakeLists.txt @@ -16,11 +16,7 @@ find_package(ament_cmake_ros REQUIRED) find_package(rosidl_runtime_cpp REQUIRED) find_package(rosidl_typesupport_introspection_c REQUIRED) -ament_export_dependencies(rosidl_runtime_c) -ament_export_dependencies(rosidl_runtime_cpp) -ament_export_dependencies(rosidl_typesupport_interface) -ament_export_dependencies(rosidl_typesupport_introspection_c) - +ament_export_dependencies(rosidl_runtime_cpp rosidl_typesupport_introspection_c) ament_python_install_package(${PROJECT_NAME}) @@ -32,9 +28,10 @@ endif() target_include_directories(${PROJECT_NAME} PUBLIC "$" "$") -ament_target_dependencies(${PROJECT_NAME} - rosidl_runtime_cpp - rosidl_typesupport_introspection_c) +target_link_libraries(${PROJECT_NAME} PUBLIC + rosidl_runtime_cpp::rosidl_runtime_cpp + rosidl_typesupport_introspection_c::rosidl_typesupport_introspection_c +) # Export old-style CMake variables ament_export_include_directories("include/${PROJECT_NAME}") diff --git a/rosidl_typesupport_introspection_cpp/package.xml b/rosidl_typesupport_introspection_cpp/package.xml index 25f060ae0..16f79eceb 100644 --- a/rosidl_typesupport_introspection_cpp/package.xml +++ b/rosidl_typesupport_introspection_cpp/package.xml @@ -2,7 +2,7 @@ rosidl_typesupport_introspection_cpp - 4.4.0 + 4.5.1 Generate the message type support for dynamic message construction in C++. diff --git a/rosidl_typesupport_introspection_tests/CHANGELOG.rst b/rosidl_typesupport_introspection_tests/CHANGELOG.rst index 0071ceddd..c3b8525fb 100644 --- a/rosidl_typesupport_introspection_tests/CHANGELOG.rst +++ b/rosidl_typesupport_introspection_tests/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package rosidl_typesupport_introspection_tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4.5.1 (2024-02-07) +------------------ + +4.5.0 (2023-12-26) +------------------ + +4.4.2 (2023-11-06) +------------------ + +4.4.1 (2023-10-04) +------------------ +* Disable zero-variadic-macro-arguments warning when using clang. (`#768 `_) +* Contributors: Chris Lalancette + 4.4.0 (2023-09-07) ------------------ * Fixed C++20 warning implicit capture of this in lambda (`#766 `_) diff --git a/rosidl_typesupport_introspection_tests/package.xml b/rosidl_typesupport_introspection_tests/package.xml index 9e0ff78cb..955d2c556 100644 --- a/rosidl_typesupport_introspection_tests/package.xml +++ b/rosidl_typesupport_introspection_tests/package.xml @@ -2,7 +2,7 @@ rosidl_typesupport_introspection_tests - 4.4.0 + 4.5.1 Integration tests of the rosidl_typesupport_introspection_c/cpp packages. Aditya Pande