From 5af6d3bb39b6d678f8645d51cf2998bec1ee4476 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Thu, 27 Feb 2025 15:12:42 +0100 Subject: [PATCH 1/6] Fix max lenght in UDP port string --- rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h b/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h index 3d3e3383..313b58fd 100644 --- a/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h +++ b/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h @@ -49,7 +49,7 @@ extern "C" #elif defined(RMW_UXRCE_TRANSPORT_IPV6) #define MAX_IP_LEN 39 #endif // ifdef RMW_UXRCE_TRANSPORT_IPV4 -#define MAX_PORT_LEN 5 +#define MAX_PORT_LEN 6 // uint16_t max size + NULL-end string #define MAX_SERIAL_DEVICE 50 typedef struct rmw_uxrce_transport_params_t From 7b102bf24a8c24a7a0b54ba368d8bbf97dcd961d Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Thu, 27 Feb 2025 15:19:58 +0100 Subject: [PATCH 2/6] Fix CI Signed-off-by: Pablo Garrido --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8960868f..609b7e16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,14 +46,14 @@ jobs: colcon test --event-handlers console_direct+ --packages-select=rmw_microxrcedds --return-code-on-test-failure ./build/rmw_microxrcedds/test/test-sizes 2> memanalisys_out - - name: Static memory - continue-on-error: true - if: github.event_name == 'pull_request' - uses: machine-learning-apps/pr-comment@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - path: memanalisys_out + # - name: Static memory + # continue-on-error: true + # if: github.event_name == 'pull_request' + # uses: machine-learning-apps/pr-comment@master + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # path: memanalisys_out - name: Coverage run: | From 08ca489b437de9b12facb030c0cc282508acd201 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Thu, 27 Feb 2025 15:27:48 +0100 Subject: [PATCH 3/6] Update --- .github/workflows/ci.yml | 3 +-- rmw_microxrcedds_c/src/rmw_microros/init_options.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 609b7e16..e0ca5128 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Download dependencies run: | - apt update && apt install -y python3-pip git python3-rosdep python3-colcon-common-extensions curl ros-$ROS_DISTRO-performance-test-fixture + apt update && apt install -y python3-pip git python3-rosdep python3-colcon-common-extensions curl ros-$ROS_DISTRO-performance-test-fixture gcovr git clone -b ros2 https://github.com/eProsima/Micro-CDR src/Micro-CDR git clone -b ros2 https://github.com/eProsima/Micro-XRCE-DDS-Client src/Micro-XRCE-DDS-Client git clone -b rolling https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds @@ -30,7 +30,6 @@ jobs: touch src/rosidl_typesupport_microxrcedds/test/COLCON_IGNORE # Install coverage tools - pip3 install gcovr . /opt/ros/$ROS_DISTRO/setup.sh rosdep init && rosdep update rosdep install --from-paths src -r diff --git a/rmw_microxrcedds_c/src/rmw_microros/init_options.c b/rmw_microxrcedds_c/src/rmw_microros/init_options.c index ef42c080..c8aafb1d 100644 --- a/rmw_microxrcedds_c/src/rmw_microros/init_options.c +++ b/rmw_microxrcedds_c/src/rmw_microros/init_options.c @@ -90,7 +90,7 @@ rmw_ret_t rmw_uros_options_set_udp_address( return RMW_RET_INVALID_ARGUMENT; } - if (ip != NULL && strlen(ip) <= MAX_IP_LEN) { + if (ip != NULL && strlen(ip) < MAX_IP_LEN) { snprintf(rmw_options->impl->transport_params.agent_address, MAX_IP_LEN, "%s", ip); } else { RMW_UROS_TRACE_MESSAGE("default ip configuration error") From b26e5eac6501e55fa0ee9979b5f6b33288a74a61 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Thu, 27 Feb 2025 16:13:34 +0100 Subject: [PATCH 4/6] Linting --- rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h | 2 +- rmw_microxrcedds_c/src/rmw_microros/init_options.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h b/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h index 313b58fd..2568f94a 100644 --- a/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h +++ b/rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h @@ -49,7 +49,7 @@ extern "C" #elif defined(RMW_UXRCE_TRANSPORT_IPV6) #define MAX_IP_LEN 39 #endif // ifdef RMW_UXRCE_TRANSPORT_IPV4 -#define MAX_PORT_LEN 6 // uint16_t max size + NULL-end string +#define MAX_PORT_LEN 6 // uint16_t max size + NULL-end string #define MAX_SERIAL_DEVICE 50 typedef struct rmw_uxrce_transport_params_t diff --git a/rmw_microxrcedds_c/src/rmw_microros/init_options.c b/rmw_microxrcedds_c/src/rmw_microros/init_options.c index c8aafb1d..a26b65d7 100644 --- a/rmw_microxrcedds_c/src/rmw_microros/init_options.c +++ b/rmw_microxrcedds_c/src/rmw_microros/init_options.c @@ -90,14 +90,14 @@ rmw_ret_t rmw_uros_options_set_udp_address( return RMW_RET_INVALID_ARGUMENT; } - if (ip != NULL && strlen(ip) < MAX_IP_LEN) { + if (ip != NULL && strlen(ip) <= MAX_IP_LEN) { snprintf(rmw_options->impl->transport_params.agent_address, MAX_IP_LEN, "%s", ip); } else { RMW_UROS_TRACE_MESSAGE("default ip configuration error") return RMW_RET_INVALID_ARGUMENT; } - if (port != NULL && strlen(port) <= MAX_PORT_LEN) { + if (port != NULL && strlen(port) < MAX_PORT_LEN) { snprintf(rmw_options->impl->transport_params.agent_port, MAX_PORT_LEN, "%s", port); } else { RMW_UROS_TRACE_MESSAGE("default port configuration error") From 1a48376ec6f27087e7cfc36a50caf04ab4c914f5 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Thu, 27 Feb 2025 16:33:59 +0100 Subject: [PATCH 5/6] Update --- rmw_microxrcedds_c/src/rmw_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_microxrcedds_c/src/rmw_init.c b/rmw_microxrcedds_c/src/rmw_init.c index 3312c878..39454f8b 100644 --- a/rmw_microxrcedds_c/src/rmw_init.c +++ b/rmw_microxrcedds_c/src/rmw_init.c @@ -91,7 +91,7 @@ rmw_init_options_init( return RMW_RET_INVALID_ARGUMENT; } - if (strlen(RMW_UXRCE_DEFAULT_PORT) <= MAX_PORT_LEN) { + if (strlen(RMW_UXRCE_DEFAULT_PORT) < MAX_PORT_LEN) { snprintf( init_options->impl->transport_params.agent_port, MAX_PORT_LEN, "%s", RMW_UXRCE_DEFAULT_PORT); From 5ca4dd0cf7c4c08100dcd41da8ab66d4363ba192 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Fri, 28 Feb 2025 08:07:04 +0100 Subject: [PATCH 6/6] Fix uncrustify --- rmw_microxrcedds_c/src/rmw_graph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rmw_microxrcedds_c/src/rmw_graph.c b/rmw_microxrcedds_c/src/rmw_graph.c index d0a81689..a0b8f748 100644 --- a/rmw_microxrcedds_c/src/rmw_graph.c +++ b/rmw_microxrcedds_c/src/rmw_graph.c @@ -84,7 +84,8 @@ rmw_ret_t rmw_graph_init( graph_info->datareader_id = uxr_object_id(context->id_datareader++, UXR_DATAREADER_ID); const char * graph_topic_name = "ros_to_microros_graph"; graph_info->graph_type_support = - rosidl_typesupport_microxrcedds_c__get_message_type_support_handle__micro_ros_msgs__msg__Graph(); //NOLINT + // NOLINTNEXTLINE + rosidl_typesupport_microxrcedds_c__get_message_type_support_handle__micro_ros_msgs__msg__Graph(); // Create graph topic request graph_info->topic_id = uxr_object_id(context->id_topic++, UXR_TOPIC_ID);