diff --git a/built_packages b/built_packages index c09730ece..cee9f1512 100755 --- a/built_packages +++ b/built_packages @@ -6,14 +6,14 @@ https://github.com/ament/googletest.git 79c4c9db1a7bc8bc5473a280499bf776173653d6 https://github.com/ament/ament_cmake.git d87b9776e0178f5a31d7e389990b5de6fc3067dd https://github.com/ament/ament_lint.git 4bc68c815ce308b3443e3cb38fd71e2b03ffdc40 https://github.com/ros2/ament_cmake_ros.git 7b6b599c3fc8023806db2a97b344e8610902adac -https://github.com/micro-ROS/rmw-microxrcedds.git fd1570af6906e6323db2345aa6cd27709514a5af +https://github.com/micro-ROS/rmw-microxrcedds.git 30658350495ea891301e11c000f9e22d2ebea62a https://github.com/micro-ROS/rcl ae6b2abc43f71ad9e7d1fce6da76d0e2cc88578a https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git d41a3103458636d1e9df88508077d657d01d5ccb https://github.com/micro-ROS/rosidl_typesupport.git 0e03d18809cb08215877ff856a916ec35a066561 https://github.com/micro-ROS/rcutils 500ee3fcb16bf6260453c75b50c3d7785d724443 https://github.com/micro-ROS/micro_ros_utilities c829971bd33ac1f14a94aa722476110b4b59eaf9 https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing.git/ 07ae5aa5c456f887f2aa82896e207a3209309a50 -https://github.com/ros2/rclc be7c43c0b0dfd7d5b9ba6026631196ad3a09d447 +https://github.com/ros2/rclc b04e6ca8142ce1edf28d558998507bef5a203ae7 https://github.com/micro-ROS/micro_ros_msgs.git c8af6d4f246d1b324e6578ec967c8ddc1f4093d5 https://github.com/ros-controls/control_msgs 11fdcdf76434d8ca9047787d17add4e18f56e9d6 https://github.com/ros2/rcl_interfaces.git c5d0a20150533a6cb93d5dcbd6e27cea9300aa6e @@ -31,4 +31,4 @@ https://github.com/ros2/rosidl.git dceaeb91f72a72e3867557690e2cc074e349230c https://github.com/ros2/rmw.git f9f4ef46f8dd3ef938526a1140a3c57c155a259f https://github.com/ros2/rosidl_defaults.git 6665e8848389f2c67d7c68ce7c53ca957ebcc97e https://github.com/eProsima/Micro-CDR.git 21c99e0d8d140c50b45f13c8ed3716cb9fa0fb27 -https://github.com/eProsima/Micro-XRCE-DDS-Client.git 2693d83bd9c37bd4615c38163b9078084fc79730 +https://github.com/eProsima/Micro-XRCE-DDS-Client.git 4ccec07f4089ec1ec49e72c4ed0484ae6515cd75 diff --git a/src/cortex-m0plus/libmicroros.a b/src/cortex-m0plus/libmicroros.a index 92689f0e8..0179215e0 100755 Binary files a/src/cortex-m0plus/libmicroros.a and b/src/cortex-m0plus/libmicroros.a differ diff --git a/src/cortex-m3/libmicroros.a b/src/cortex-m3/libmicroros.a index 3625687dc..818449656 100755 Binary files a/src/cortex-m3/libmicroros.a and b/src/cortex-m3/libmicroros.a differ diff --git a/src/cortex-m7/fpv5-d16-softfp/libmicroros.a b/src/cortex-m7/fpv5-d16-softfp/libmicroros.a index 76c7eb06a..59f8218ec 100755 Binary files a/src/cortex-m7/fpv5-d16-softfp/libmicroros.a and b/src/cortex-m7/fpv5-d16-softfp/libmicroros.a differ diff --git a/src/cortex-m7/fpv5-sp-d16-softfp/libmicroros.a b/src/cortex-m7/fpv5-sp-d16-softfp/libmicroros.a index 0d2c9c495..cd750472d 100755 Binary files a/src/cortex-m7/fpv5-sp-d16-softfp/libmicroros.a and b/src/cortex-m7/fpv5-sp-d16-softfp/libmicroros.a differ diff --git a/src/imxrt1062/fpv5-d16-hard/libmicroros.a b/src/imxrt1062/fpv5-d16-hard/libmicroros.a index f2b28fb4d..e4fa005e8 100755 Binary files a/src/imxrt1062/fpv5-d16-hard/libmicroros.a and b/src/imxrt1062/fpv5-d16-hard/libmicroros.a differ diff --git a/src/mk20dx256/libmicroros.a b/src/mk20dx256/libmicroros.a index b1f6bc29c..d2c3800b1 100755 Binary files a/src/mk20dx256/libmicroros.a and b/src/mk20dx256/libmicroros.a differ diff --git a/src/mk64fx512/fpv4-sp-d16-hard/libmicroros.a b/src/mk64fx512/fpv4-sp-d16-hard/libmicroros.a index e12507a89..9f2d5f247 100755 Binary files a/src/mk64fx512/fpv4-sp-d16-hard/libmicroros.a and b/src/mk64fx512/fpv4-sp-d16-hard/libmicroros.a differ diff --git a/src/rclc/executor.h b/src/rclc/executor.h index 4dda219ed..2e8e6a1cf 100755 --- a/src/rclc/executor.h +++ b/src/rclc/executor.h @@ -233,7 +233,7 @@ rclc_executor_add_subscription( rclc_executor_t * executor, rcl_subscription_t * subscription, void * msg, - rclc_callback_t callback, + rclc_subscription_callback_t callback, rclc_executor_handle_invocation_t invocation); /** diff --git a/src/rclc/executor_handle.h b/src/rclc/executor_handle.h index f9825c717..20003511c 100755 --- a/src/rclc/executor_handle.h +++ b/src/rclc/executor_handle.h @@ -31,10 +31,17 @@ extern "C" typedef enum { SUBSCRIPTION, + SUBSCRIPTION_WITH_CONTEXT, TIMER, + // TIMER_WITH_CONTEXT, // TODO CLIENT, + CLIENT_WITH_REQUEST_ID, + // CLIENT_WITH_CONTEXT, // TODO SERVICE, + SERVICE_WITH_REQUEST_ID, + SERVICE_WITH_CONTEXT, GUARD_CONDITION, + // GUARD_CONDITION_WITH_CONTEXT, //TODO NONE } rclc_executor_handle_type_t; @@ -46,21 +53,13 @@ typedef enum ALWAYS } rclc_executor_handle_invocation_t; -typedef enum -{ - CB_UNDEFINED, - CB_WITHOUT_REQUEST_ID, - CB_WITH_REQUEST_ID, - CB_WITH_CONTEXT, -} rclc_executor_handle_callback_type_t; - - -/// Type definition for callback function. -typedef void (* rclc_callback_t)(const void *); - /// Type definition for subscription callback function /// - incoming message -// typedef void (* rclc_subscription_callback_t)(const void *); +typedef void (* rclc_subscription_callback_t)(const void *); + +/// Type definition (duplicate) for subscription callback function (alias for foxy and galactic). +/// - incoming message +typedef rclc_subscription_callback_t rclc_callback_t; /// Type definition for subscription callback function /// - incoming message @@ -137,7 +136,7 @@ typedef struct /// Storage for callbacks union { - rclc_callback_t callback; + rclc_subscription_callback_t subscription_callback; rclc_subscription_callback_with_context_t subscription_callback_with_context; rclc_service_callback_t service_callback; rclc_service_callback_with_request_id_t service_callback_with_reqid; @@ -159,8 +158,6 @@ typedef struct /// Interval variable. Flag, which is true, if new data is available from DDS queue /// (is set after calling rcl_take) bool data_available; - /// callback type for service/client - rclc_executor_handle_callback_type_t callback_type; } rclc_executor_handle_t; /// Information about total number of subscriptions, guard_conditions, timers, subscription etc. diff --git a/src/rmw_microros/timing.h b/src/rmw_microros/timing.h new file mode 100755 index 000000000..7843563b1 --- /dev/null +++ b/src/rmw_microros/timing.h @@ -0,0 +1,79 @@ +// Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file + */ + +#ifndef RMW_MICROROS__TIMING_H_ +#define RMW_MICROROS__TIMING_H_ + +#include +#include +#include +#include +#include + +#if defined(__cplusplus) +extern "C" +{ +#endif // if defined(__cplusplus) + +/** \addtogroup rmw micro-ROS RMW API + * @{ + */ + +/** + * \brief Sets the DDS-XRCE session spin time in reliable publication + * + * \param[in] publisher publisher where the spin time is configured + * \param[in] session_timeout time in milliseconds + * \return RMW_RET_OK when success. + * \return RMW_RET_INVALID_ARGUMENT If publisher is not valid or unexpected arguments. + */ +rmw_ret_t rmw_uros_set_publisher_session_timeout( + rmw_publisher_t * publisher, + int session_timeout); + +/** + * \brief Sets the DDS-XRCE session spin time in reliable service server + * + * \param[in] service service where the spin time is configured + * \param[in] session_timeout time in milliseconds + * \return RMW_RET_OK when success. + * \return RMW_RET_INVALID_ARGUMENT If service is not valid or unexpected arguments. + */ +rmw_ret_t rmw_uros_set_service_session_timeout( + rmw_service_t * service, + int session_timeout); + +/** + * \brief Sets the DDS-XRCE session spin time in reliable service client + * + * \param[in] client client where the spin time is configured + * \param[in] session_timeout time in milliseconds + * \return RMW_RET_OK when success. + * \return RMW_RET_INVALID_ARGUMENT If client is not valid or unexpected arguments. + */ +rmw_ret_t rmw_uros_set_client_session_timeout( + rmw_client_t * client, + int session_timeout); + +/** @}*/ + +#if defined(__cplusplus) +} +#endif // if defined(__cplusplus) + +#endif // RMW_MICROROS__TIMING_H_ diff --git a/src/uxr/client/core/session/session.h b/src/uxr/client/core/session/session.h index 3a0f97545..dfffe6d70 100755 --- a/src/uxr/client/core/session/session.h +++ b/src/uxr/client/core/session/session.h @@ -138,7 +138,8 @@ typedef void (* uxrOnReplyFunc) ( * @param session Session structure related to the buffer to be flushed. */ typedef bool (* uxrOnBuffersFull) ( - struct uxrSession* session); + struct uxrSession* session, + void* args); #ifdef PERFORMANCE_TESTING /** @@ -156,6 +157,7 @@ typedef void (* uxrOnPerformanceFunc) ( typedef struct uxrContinuousArgs { uxrOnBuffersFull flush_callback; + void* flush_callback_args; uxrStreamId stream_id; size_t data_size; } uxrContinuousArgs; diff --git a/src/uxr/client/core/session/write_access.h b/src/uxr/client/core/session/write_access.h index bc93aa967..61045ff19 100755 --- a/src/uxr/client/core/session/write_access.h +++ b/src/uxr/client/core/session/write_access.h @@ -116,12 +116,13 @@ UXRDLLAPI uint16_t uxr_prepare_output_stream( * The submessage will be sent when `uxr_flash_output_stream` or `uxr_run_session` function are called. * This function handles the buffer flush by means of `uxrOnBuffersFull` callback. * As a result of the reception of this submessage, the Agent will write a topic into the DDS Global-Data-Space. - * @param session A uxrSession structure previously initialized. - * @param stream_id The output stream identifier where the WRITE_DATA submessage will be buffered. - * @param datawriter_id The identifier of the XRCE DataWriter that will write the topic into the DDS GDS. - * @param ub The ucdrBuffer structure used for serializing the topic. - * @param data_size The size of the topic in bytes. - * @param flush_callback Callback that is call by the library when user should flush output buffers. + * @param session A uxrSession structure previously initialized. + * @param stream_id The output stream identifier where the WRITE_DATA submessage will be buffered. + * @param datawriter_id The identifier of the XRCE DataWriter that will write the topic into the DDS GDS. + * @param ub The ucdrBuffer structure used for serializing the topic. + * @param data_size The size of the topic in bytes. + * @param flush_callback Callback that is call by the library when user should flush output buffers. + * @param flush_callback_args Arguments passed to flush callback. * @return A `request_id` that identifies the XRCE request made by the Entity. * This could be used in the `uxr_run_session_until_one_status` or `uxr_run_session_until_all_status` functions. * */ @@ -132,7 +133,8 @@ UXRDLLAPI uint16_t uxr_prepare_output_stream_fragmented( uxrObjectId datawriter_id, ucdrBuffer* ub, size_t data_size, - uxrOnBuffersFull flush_callback); + uxrOnBuffersFull flush_callback, + void* flush_callback_args); /** @}*/