Skip to content

Commit 8578f0a

Browse files
micro-ROS foxy Library auto-update 14-07-2021 06:17 (#372)
Co-authored-by: pablogs9 <[email protected]>
1 parent 68f9387 commit 8578f0a

File tree

10 files changed

+46
-3
lines changed

10 files changed

+46
-3
lines changed

built_packages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git acb2fb6f7b5bde2
1212
https://github.com/micro-ROS/rosidl_typesupport.git 5d974dbee4cd6988ce33923246eb404db327fad8
1313
https://github.com/micro-ROS/rcutils 0fd0c442dfa343dcfd0cb3674012039bed0c9389
1414
https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing d11b87737245b8456bbada44dfa7b1d670b1c4d0
15-
https://github.com/ros2/rclc 1a6a50be0486628875200843080720636b848d21
15+
https://github.com/ros2/rclc 5b11c5a9ca2e0f120f8d1dfeb30bf480689abfa9
1616
https://github.com/micro-ROS/micro_ros_msgs.git c8af6d4f246d1b324e6578ec967c8ddc1f4093d5
1717
https://github.com/ros-controls/control_msgs 338ef98b4a4d763fe5df39e86a1967844ceb506e
1818
https://github.com/ros2/rcl_interfaces.git ee04e046132be9d9fdcdaeff8dd54a5d0d9aa022

src/cortex-m0plus/libmicroros.a

424 Bytes
Binary file not shown.

src/cortex-m3/libmicroros.a

488 Bytes
Binary file not shown.
400 Bytes
Binary file not shown.
376 Bytes
Binary file not shown.
376 Bytes
Binary file not shown.

src/mk20dx256/libmicroros.a

352 Bytes
Binary file not shown.
352 Bytes
Binary file not shown.

src/rclc/executor.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,39 @@ rclc_executor_add_subscription(
221221
rclc_callback_t callback,
222222
rclc_executor_handle_invocation_t invocation);
223223

224+
/**
225+
* Adds a subscription to an executor.
226+
* * An error is returned, if {@link rclc_executor_t.handles} array is full.
227+
* * The total number_of_subscriptions field of {@link rclc_executor_t.info}
228+
* is incremented by one.
229+
*
230+
* <hr>
231+
* Attribute | Adherence
232+
* ------------------ | -------------
233+
* Allocates Memory | No
234+
* Thread-Safe | No
235+
* Uses Atomics | No
236+
* Lock-Free | Yes
237+
*
238+
* \param [inout] executor pointer to initialized executor
239+
* \param [in] subscription pointer to an allocated subscription
240+
* \param [in] msg pointer to an allocated message
241+
* \param [in] callback function pointer to a callback
242+
* \param [in] context type-erased ptr to additional callback context
243+
* \param [in] invocation invocation type for the callback (ALWAYS or only ON_NEW_DATA)
244+
* \return `RCL_RET_OK` if add-operation was successful
245+
* \return `RCL_RET_INVALID_ARGUMENT` if any parameter is a null pointer (NULL context is ignored)
246+
* \return `RCL_RET_ERROR` if any other error occured
247+
*/
248+
rcl_ret_t
249+
rclc_executor_add_subscription_with_context(
250+
rclc_executor_t * executor,
251+
rcl_subscription_t * subscription,
252+
void * msg,
253+
rclc_subscription_callback_with_context_t callback,
254+
void * context,
255+
rclc_executor_handle_invocation_t invocation);
256+
224257
/**
225258
* Adds a timer to an executor.
226259
* * An error is returned, if {@link rclc_executor_t.handles} array is full.

src/rclc/executor_handle.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ typedef enum
5858
/// Type definition for callback function.
5959
typedef void (* rclc_callback_t)(const void *);
6060

61+
/// Type definition for subscription callback function
62+
/// - incoming message
63+
// typedef void (* rclc_subscription_callback_t)(const void *);
64+
65+
/// Type definition for subscription callback function
66+
/// - incoming message
67+
/// - additional callback context
68+
typedef void (* rclc_subscription_callback_with_context_t)(const void *, void *);
69+
6170
/// Type definition for client callback function
6271
/// - request message
6372
/// - response message
@@ -114,8 +123,8 @@ typedef struct
114123
/// only for service - ptr to response message
115124
void * data_response_msg;
116125

117-
/// only for service - ptr to additional service context
118-
void * service_context;
126+
/// ptr to additional callback context
127+
void * callback_context;
119128

120129
// TODO(jst3si) new type to be stored as data for
121130
// service/client objects
@@ -129,6 +138,7 @@ typedef struct
129138
/// Storage for callbacks
130139
union {
131140
rclc_callback_t callback;
141+
rclc_subscription_callback_with_context_t subscription_callback_with_context;
132142
rclc_service_callback_t service_callback;
133143
rclc_service_callback_with_request_id_t service_callback_with_reqid;
134144
rclc_service_callback_with_context_t service_callback_with_context;

0 commit comments

Comments
 (0)