You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/content_filtering.md
+27-30
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ the following create/delete API's are defined,
130
130
- create_contentfilteredtopic()
131
131
- delete_contentfilteredtopic()
132
132
133
-
**According to the specification, filter_expression can be only initialized at constructor and it is read_only. so not possible to change the filter_exThis needs to be discussed to see if we have our specific requirement for expression syntax. but that will make conversion overhead.ed at runtime. [RTI v5.3.0](https://community.rti.com/static/documentation/connext-dds/5.3.0/doc/api/connext_dds/api_cpp2/classdds_1_1topic_1_1ContentFilteredTopic.html#a76310bf0b7123dd89afbacf43dbabf4a) can support this requirement.**
133
+
**According to the specification, filter_expression can be only initialized at constructor and it is read_only. probably it is not possible to change the filter_expression at runtime based on the specification but [RTI v5.3.0](https://community.rti.com/static/documentation/connext-dds/5.3.0/doc/api/connext_dds/api_cpp2/classdds_1_1topic_1_1ContentFilteredTopic.html#a76310bf0b7123dd89afbacf43dbabf4a) can support this requirement. After all, it seems that it is dependent on implementation.**
134
134
135
135
#### DDSI-RTPS
136
136
@@ -145,22 +145,18 @@ The ContentFilterProperty_t field provides all the required information to enabl
145
145
146
146
### Requirement
147
147
148
-
- ContentFilteredTopic interfaces can be used only if implementation supports.
148
+
- ContentFilteredTopic interfaces can be used only if rmw implementation supports.
149
149
- If rmw implementation does not support ContentFilteredTopic interfaces, filtering will be done internally on subscriber side in `rcl`.
150
150
- It can create/destroy ContentFilteredTopic based on parent topic.
151
151
- It can set/get the filter_expression and expression_parameters for ContentFilteredTopic.
152
152
- Filtering expression and expression parameters can be set and get at runtime.
153
-
- As decribed above, according to DDS specification, it implies that filtering expression may not be able to be changed dynamically. But to support requirements in ROS2, it must support dynamic reconfiguration for filtering expression and paramter.
153
+
- As described above, according to DDS specification, it implies that filtering expression may not be able to be changed dynamically. But to support requirements in ROS2, it should be able to support dynamic reconfiguration for filtering expression and parameter.
154
154
- Filtering goal id for action `feedback` and `status` will be done ROS2 system.
155
-
- User can specify node name and parameter name to filter the parameter evetns.
156
-
- Filtering expression and parameter grammer will be the same with DDS standard between `rcl` and `rmw`.
155
+
- User can specify node name and parameter name to filter the parameter events.
156
+
- Filtering expression and parameter grammar will be the same with DDS standard.
157
157
158
158
### Proposal
159
159
160
-
#### Namespace
161
-
162
-
Since ContentFilteredTopic is based on parent topic (more like base topic), it will create ContentFilteredTopic internally, not exposed as ordinary topic.
163
-
164
160
#### Action
165
161
166
162
Each action client id to ContentFilteredTopic based on `action_name/_action/feedback_or_status`. ContentFilteredTopic name would be action_name/_action/feedback_or_status_ActionClient_ID then ActionClient always get feedback events related to goal handler. This granularity is mandatory for action feedback and status topic to have more transport efficiency.
@@ -170,24 +166,24 @@ Each action client id to ContentFilteredTopic based on `action_name/_action/feed
170
166
| action_name/_action/feedback_ActionClient_ID | feedback ContentFilteredTopic for ActionClient ID, ActionClient_ID would be uuid (consistent with status id for the same client) |
171
167
| action_name/_action/status_ActionClient_ID | status ContentFilteredTopic for ActionClient ID, ActionClient_ID would be uuid (consistent with feedback id for the same client) |
172
168
173
-
(*) These ContentFilteredTopic should not show up to user. (e.g `ros2 topic list`)
169
+
(*) These ContentFilteredTopic should not show up to user but parent topic. (e.g `ros2 topic list`)
174
170
175
-
`feedback` topic is user defined message type but it also includes goal id([GoalInfo](https://github.com/ros2/rcl_interfaces/blob/master/action_msgs/msg/GoalInfo.msg)). Goal id will be internally handled and client issues ContentFilteredTopic API to notify the publication(server) what subscription(client) is interested in. `st- [T.B.D] This needs to be discussed more, if user should be able to filter arbitrary parameter or not. if to support any expression and parameter, it means that `rcl` needs to have DDS standard expression and parameter filtering function. new goal id will be applied to ContentFilteredTopic object based on action client ID.
171
+
`feedback` topic is user defined message type but it also includes goal id([GoalInfo](https://github.com/ros2/rcl_interfaces/blob/master/action_msgs/msg/GoalInfo.msg)). Goal id will be internally handled and action client internally issues ContentFilteredTopic API to notify the publication(server) what subscription(client) is interested in. Once new goal id is generated, that will be applied to ContentFilteredTopic object based on action client ID at runtime. In action use case, it does not need to change filtering expression at runtime. instead of that it can use `MATCH` syntax with goal ids in expression parameters.
There are two types of parameter events subscription, one is for system(TimeSource) which is controlled and taken care by rclcpp and rclpy internally. And the other is user application to register user callback to be fired when parameter events come in.
182
178
183
-
It would be good to create ContentFilteredTopic for each of them. This can make responsibility clear and simple, can avoid the complication about filtering expression merge between user filtering and system filtering.
179
+
It would be good to create ContentFilteredTopic for each of them. This can make responsibility clear and simple, it also can avoid the complication about filtering expression merge between user filtering and system filtering.
184
180
185
181
| ContentFilterTopic | Description |
186
182
| :--- | :--- |
187
183
| /parameter_events_system_Node_ID | parameter events ContentFilteredTopic for system internal usage, Node ID would be uuid to identify this NodeBase. |
188
184
| /parameter_events_user_Node_ID | parameter events ContentFilteredTopic for user callback usage, Node ID would be uuid to identify this NodeBase. |
189
185
190
-
(*) These ContentFilteredTopic should not show up to user. (e.g `ros2 topic list`)
186
+
(*) These ContentFilteredTopic should not show up to user but ordinary topic. (e.g `ros2 topic list`)
191
187
192
188
- TimeSource
193
189
**use_sim_time** event on self-node_base is subscribed internally to check if **use_sim_time** parameter is changed or not. so internally this **use_sim_time** AND self node name always must be in filter_expression and expression_parameters via ContentFilteredTopic if it is supported. see [here](https://github.com/ros2/rclcpp/blob/99286978f92c30fe171313bf0785d6b6272c3257/rclcpp/src/rclcpp/time_source.cpp#L123-L125).
@@ -197,11 +193,11 @@ It would be good to create ContentFilteredTopic for each of them. This can make
197
193
This `use_sim_time` can be supported local callbacks, it does not have to use `/parameter_events` at all.
198
194
199
195
- User frontend (rclcpp/rclpy)
200
-
User API will be added to manage filtering configuration, so that user application can set its own filter_expression and expression_parameters. Also using AsyncParametersClient::on_parameter_event, user can take care of the parameter event with user callback only for filtered parameter events. It should be compatible interface for user application even if rmw_implementation does not support ContentFilteredTopic. If rmw_impelementation does not support ContentFilteredTopic, `rcl` will take care of filtering instead based on fitlering expression and parameters.
196
+
User API will be added to manage filtering configuration, so that user application can set its own filter_expression and expression_parameters. Also using AsyncParametersClient::on_parameter_event, user can take care of the parameter event with user callback only for filtered parameter events. It should be compatible interface for user application even if rmw_implementation does not support ContentFilteredTopic. If rmw_implementation does not support ContentFilteredTopic, `rcl` will take care of filtering instead based on filtering expression and parameters.
201
197
202
198
- Filtering Expression and Parameters
203
-
User can specify node name and parameter name to filter the parameter evetns.
204
-
-[T.B.D]This needs to be discussed more, if user should be able to filter arbitrary parameter or not. if to support any expression and parameter, it means that `rcl` needs to have DDS standard expression and parameter filtering function.
199
+
User can specify node name and parameter name to filter the parameter events.
200
+
-***This needs to be discussed more, if user should be able to filter arbitrary parameter or not.***
**[T.B.D] Do we need to expose ContentFilteredTopic for user classes?**
240
238
241
-
-`create_cft_subscription` method in `Node` & `Subscription` class to allow user application to user CFT feature based on parent topics and subscription.
239
+
-extend `create_subscription` method with optional fields in `Node` & `Subscription` class to allow user application to user CFT feature based on parent topics and subscription.
242
240
- if the platform does not support CFT, the return NOT_SUPPORTED.
243
-
-this will override the subscription (datareader in dds), so that we can have single datareader in dds. this means that subscription can only subscribe content filtered data.
244
-
-`set_cft_set/get_expression_parameters` method in `Node` class to set and get expression parameters. (Not possible set filtering expression at runtime this is specification of DDS.)
241
+
-if optional fields are specified, ContentFilteredTopic and corresponding subscription (datareader in dds) this means that subscription can only subscribe content filtered data.
242
+
-`set_<set/get>_expression_parameters` method in `Node` class to set and get expression parameters.
245
243
- Deletion/Destruction of CFT subscription is exactly same with current subscription routine.
246
244
247
245
### Components
248
246
249
247
#### Action
250
248
251
249
- Action Server
252
-
Nothing needs to be changed, even with ContentFilteredTopic it should not be aware of that, just publishes feedback and status message, the rest will be taken care by rmw_implementation. if rmw_implementation does not support ContentFilteredTopic, filtering process is done by subscriber side which is Action Client.
250
+
Nothing needs to be changed, even with ContentFilteredTopic it should not be aware of that, just publishes feedback and status message, the rest will be taken care by rmw_implementation. if rmw_implementation does not support ContentFilteredTopic, filtering process is done by subscriber side which is Action Client as it does now.
253
251
254
252
- Action Client
255
-
User interface(rclcpp and rclpy) should not be changed, everything can be integrated into internal implementation.
256
-
It will check if ContentFilter is supported by rmw_implementation internally. If ContentFilter is supported by rmw_implementation, create ContentFilteredTopic internally based on ActionClient ID (uuid) so that no need to filter goal id. (saying there will be no unknown goal id event.) But w/o ContentFilter [current filtering](https://github.com/ros2/rclcpp/blob/99286978f92c30fe171313bf0785d6b6272c3257/rclcpp_action/include/rclcpp_action/client.hpp#L536-L553) needs to stay since there would be unnecessary message from publisher.At [send_goal_request](https://github.com/ros2/rclcpp/blob/99286978f92c30fe171313bf0785d6b6272c3257/rclcpp_action/include/rclcpp_action/client.hpp#L352-L388), it will set the filter_expression and expression_parameters based on goal id. The goal handler might have multiple goal ids, so that get current filtering configuration, modify and set new filtering configuration. (the finalization is also needed when goal id is being unregistered from goal handler.)
253
+
User interface(rclcpp and rclpy) should not be changed, everything can be integrated into internal implementation. It will check if ContentFilter is supported by rmw_implementation internally. If ContentFilter is supported by rmw_implementation, create ContentFilteredTopic internally based on ActionClient ID (uuid) so that no need to filter goal id. (technically there will be no unknown goal id event.) But w/o ContentFilter [current filtering](https://github.com/ros2/rclcpp/blob/99286978f92c30fe171313bf0785d6b6272c3257/rclcpp_action/include/rclcpp_action/client.hpp#L536-L553) needs to stay just in case, there would be unnecessary message from publisher or different rmw_implementation which does not support ContentFilteredTopic is used on Action Server side. At [send_goal_request](https://github.com/ros2/rclcpp/blob/99286978f92c30fe171313bf0785d6b6272c3257/rclcpp_action/include/rclcpp_action/client.hpp#L352-L388), it will set the filter_expression and expression_parameters based on goal id. The goal handler might have multiple goal ids, so that get current filtering configuration, modify and set new filtering configuration. (the un-registration is also needed when goal id is being unregistered from goal handler.)
0 commit comments