Skip to content

Commit 7c56b21

Browse files
committedApr 30, 2024
ci(pre-commit): autofix
1 parent 30bc8d7 commit 7c56b21

25 files changed

+75
-68
lines changed
 

‎.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
*.out
3232
*.app
3333

34-
*.vscode
34+
*.vscode

‎.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ repos:
4545
hooks:
4646
- id: shfmt-docker
4747

48-
exclude: ^(.svg|includes/glossary.md)
48+
exclude: ^(.svg|includes/glossary.md)

‎README.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Example programs for demonstrating data read from subscription of ROS 2.
66

77
These example programs consist of four pakages.
88

9-
* [simple_examples](./simple_examples)
10-
* [intra_process_talker_listener](./intra_process_talker_listener)
11-
* [intra_process_examples](./intra_process_examples)
12-
* [waitset_examples](./waitset_examples)
9+
- [simple_examples](./simple_examples)
10+
- [intra_process_talker_listener](./intra_process_talker_listener)
11+
- [intra_process_examples](./intra_process_examples)
12+
- [waitset_examples](./waitset_examples)
1313

1414
These are based on taker-listener in [GitHub - ros2/demos at humble](https://github.com/ros2/demos/tree/humble). If you know the talker-listener well, you can also understand these sample codes. Only `intra_process_examples` is based on [demos/intra_process_demo/src/two_node_pipeline/two_node_pipeline.cpp at humble · ros2/demos](https://github.com/ros2/demos/blob/humble/intra_process_demo/src/two_node_pipeline/two_node_pipeline.cpp) exceptionally.
1515

@@ -33,11 +33,13 @@ You need two terminals one of which is for talker and another for listener.
3333
#### run talker
3434

3535
Execute command below to run talker node on a terminal.
36+
3637
```
3738
ros2 run simple_examples [talker node]
3839
```
3940

4041
The talker supports some additional options unlike the talker of [GitHub - ros2/demos at humble](https://github.com/ros2/demos/tree/humble). For example, you can change frequency of output of messages by `update_frequency` option as below.
42+
4143
```
4244
ros2 run simple_examples talker --ros-args -p update_frequency:=2.0
4345
```
@@ -48,7 +50,7 @@ If you want to use multiple options, you can add subsequent options as `-p optio
4850

4951
Below is the list of talker nodes included in simple_examples package.
5052

51-
* `talker`
53+
- `talker`
5254
- behavior overview
5355
- output `/chatter` topic per specified frequency
5456
- option
@@ -58,14 +60,15 @@ Below is the list of talker nodes included in simple_examples package.
5860
- `use_transient_local` (boolean)
5961
- enable Transient Local of Publisher
6062
- default is false
61-
* `serialized_message_talker`
63+
- `serialized_message_talker`
6264
- behavior overview
6365
- output `/chatter` of SerializedMessage type per one second
6466
- no option
6567

6668
#### run listener
6769

6870
Execute command below to run listener node on another terminal.
71+
6972
```
7073
ros2 run simple_examples [listener node]
7174
```
@@ -76,7 +79,7 @@ The listener of [ros2_subscription_examples/simple_examples at main · takam5f2/
7679

7780
Below is the list of listener nodes included in simple_examples package.
7881

79-
* `timer_listener`
82+
- `timer_listener`
8083
- behavior overview
8184
- driven by timer periodically to execute a callback function in which a message is obtained from Subscription
8285
- output the obtained message of `/chatter`
@@ -90,7 +93,7 @@ Below is the list of listener nodes included in simple_examples package.
9093
- `printout_message_info` (boolean)
9194
- enable to print MessageInfo
9295
- default is false
93-
* `timer_batch_listener`
96+
- `timer_batch_listener`
9497
- behavior overview
9598
- driven by timer periodically to execute a callback function in which multiple messages are obtained from Subscription Queue until the queue becomes empty
9699
- output all obtained messages
@@ -103,7 +106,7 @@ Below is the list of listener nodes included in simple_examples package.
103106
- default is false
104107
- `queue_size` (integer)
105108
- specify Subscription Queue size which stores `/chatter` message
106-
* `timer_listener_using_callback`
109+
- `timer_listener_using_callback`
107110
- behavior overview
108111
- driven by timer periodically to execute a callback function in which a message is obtained from Subscription using `take_type_erased()`
109112
- then execute a callback function which is registered to Subscription using `handle_message()`
@@ -114,7 +117,7 @@ Below is the list of listener nodes included in simple_examples package.
114117
- `use_transient_local` (boolean)
115118
- enable Transient Local of Subscription
116119
- default is false
117-
* `timer_listener_using_normal_function`
120+
- `timer_listener_using_normal_function`
118121
- behavior overview
119122
- driven by timer periodically to execute a callback function in which a message is obtained from Subscription
120123
- then execute a simple function
@@ -126,7 +129,7 @@ Below is the list of listener nodes included in simple_examples package.
126129
- `use_transient_local` (boolean)
127130
- enable Transient Local of Subscription
128131
- default is false
129-
* `timer_serialized_message_listener`
132+
- `timer_serialized_message_listener`
130133
- behavior overview
131134
- driven by timer periodically to execute a callback function in which a message is obtained from Subscription
132135
- the message is of SerializedMessage type
@@ -148,6 +151,7 @@ There is a sample code in `intra_process_talker_listener` in which a topic messa
148151
#### run by launcher
149152

150153
Execute command below to run `talker_listener_intra_process.launch.py`.
154+
151155
```
152156
ros2 launch intra_process_talker_listener talker_listener_intra_process.launch.py
153157
```
@@ -164,7 +168,7 @@ If `use_intra_process_comms` is set to `false`, communication between nodes is p
164168

165169
Below is the list of launch files included in intra_process_talker_listener package.
166170

167-
* talker_listener_intra_process.launch.py
171+
- talker_listener_intra_process.launch.py
168172
- behavior overview
169173
- run `talker_intra_process` and `timer_listener_intra_process`
170174
- `talker_intra_process` publishes `/chatter` message and `timer_listener_intra_process` obtains it
@@ -183,7 +187,7 @@ Below is the list of launch files included in intra_process_talker_listener pack
183187
- `use_transient_local` (boolean)
184188
- enable Transient Local of Publisher and Subscription
185189
- default is false
186-
* talker_batch_listener_intra_process.launch.py
190+
- talker_batch_listener_intra_process.launch.py
187191
- behavior overview
188192
- run `talker_intra_process` and `timer_batch_listener_intra_process`
189193
- `talker_intra_process` publishes `/chatter` message and `timer_batch_listener_intra_process` obtains it
@@ -202,6 +206,7 @@ But intra-process communication also can be used between nodes on MultiThreadedE
202206
#### run
203207

204208
Execute command below to run `two_node_pipeline_timer`.
209+
205210
```
206211
ros2 run intra_process_examples two_node_pipeline_timer
207212
```
@@ -215,6 +220,7 @@ You need two terminals one of which is for talker and another for listener.
215220
#### run talker
216221

217222
Execute command below to run talker node on a terminal.
223+
218224
```
219225
ros2 run waitset_examples talker_triple
220226
```
@@ -223,7 +229,7 @@ ros2 run waitset_examples talker_triple
223229

224230
There is only one node as talker in waitset_examples.
225231

226-
* `talker_triple`
232+
- `talker_triple`
227233
- behavior overview
228234
- publish `/chatter`, `/slower_chatter`, and `/slowest_chatter` topics per each specified frequency
229235
- `/slower_chatter` and `/slowest_chatter` are not published if there is no Subscription which subscribes them
@@ -241,6 +247,7 @@ There is only one node as talker in waitset_examples.
241247
#### run listener
242248

243249
Execute command below to run listener node on another terminal.
250+
244251
```
245252
ros2 run simple_examples [listener node]
246253
```
@@ -249,7 +256,7 @@ ros2 run simple_examples [listener node]
249256

250257
Below is the list of listener nodes included in waitset_examples.
251258

252-
* `timer_listener_single`
259+
- `timer_listener_single`
253260
- behavior overview
254261
- driven by timer periodically to execute a callback function in which a `/chatter` message is obtained from Subscription Queue after verifying that there is a message in the queue by waitset
255262
- print the obtained message by `RCLCPP_INFO`
@@ -260,7 +267,7 @@ Below is the list of listener nodes included in waitset_examples.
260267
- `use_transient_local` (boolean)
261268
- enable Transient Local of Subscription
262269
- default is false
263-
* `timer_listener_using_callback`
270+
- `timer_listener_using_callback`
264271
- behavior overview
265272
- driven by timer periodically to execute a callback function in which a `/chatter` message is obtained from Subscription Queue after verifying that there is a message in the queue by waitset
266273
- `take_type_erased()` and `handle_message()` are used at that time, which is ther manner performed inside Executor
@@ -271,7 +278,7 @@ Below is the list of listener nodes included in waitset_examples.
271278
- `use_transient_local` (boolean)
272279
- enable Transient Local of Subscription
273280
- default is false
274-
* `timer_listener_single_wait_some_period`
281+
- `timer_listener_single_wait_some_period`
275282
- behavior overview
276283
- driven by timer periodically to execute a callback function in which a `/chatter` message is obtained from Subscription Queue after verifying that there is a message in the queue by waitset
277284
- timeout is set when query waitset at that time
@@ -287,7 +294,7 @@ Below is the list of listener nodes included in waitset_examples.
287294
- `waiting_time` (float)
288295
- specify timeout value
289296
- default is 4.0
290-
* `timer_batch_listener_single`
297+
- `timer_batch_listener_single`
291298
- behavior overview
292299
- driven by timer periodically to execute a callback function in which a `/chatter` message is obtained from Subscription Queue until the queue becomes empty after verifying that there are messages in the queue by waitset
293300
- option
@@ -300,7 +307,7 @@ Below is the list of listener nodes included in waitset_examples.
300307
- `queue_size` (integer)
301308
- specify Subscription Queue size
302309
- default is 10
303-
* `timer_listener_triple_sync`
310+
- `timer_listener_triple_sync`
304311
- behavior overview
305312
- driven by timer periodically to execute a callback function in which `/chatter`, `/slower_chatter`, and `/slowest_chatter` messages are obtained from each Subscription Queue
306313
- the messages are obtained only when one or more messages in each Subscription Queue of `/chatter`, `/slower_chatter`, and `/slowest_chatter` get together
@@ -312,7 +319,7 @@ Below is the list of listener nodes included in waitset_examples.
312319
- `use_transient_local` (boolean)
313320
- enable Transient Local of Subscription
314321
- default is false
315-
* `timer_listener_triple_async`
322+
- `timer_listener_triple_async`
316323
- behavior overview
317324
- driven by timer periodically to execute a callback function in which `/chatter`, `/slower_chatter`, and `/slowest_chatter` messages are obtained from each Subscription Queue
318325
- the messages are obtained if one or more messages are in each Subscription Queue of `/chatter`, `/slower_chatter`, and `/slowest_chatter`
@@ -325,7 +332,7 @@ Below is the list of listener nodes included in waitset_examples.
325332
- `use_transient_local` (boolean)
326333
- enable Transient Local of Subscription
327334
- default is false
328-
* `timer_listener_triple_separated_waitset`
335+
- `timer_listener_triple_separated_waitset`
329336
- behavior overview
330337
- driven by three timers periodically to execute a callback function in which `/chatter`, `/slower_chatter`, and `/slowest_chatter` messages are obtained from each Subscription Queue
331338
- the messages are obtained if one or more messages are in each Subscription Queue of `/chatter`, `/slower_chatter`, and `/slowest_chatter`
@@ -337,7 +344,7 @@ Below is the list of listener nodes included in waitset_examples.
337344
- `use_transient_local` (boolean)
338345
- enable Transient Local of Subscription
339346
- default is false
340-
* `timer_listener_triple_sync_intra`
347+
- `timer_listener_triple_sync_intra`
341348
- behavior overview
342349
- similar to `timer_listener_triple_sync`
343350
- support intra-process communication unlike `timer_listener_triple_sync` in which only inter-process communication can be used
@@ -351,7 +358,7 @@ Below is the list of listener nodes included in waitset_examples.
351358
- `use_transient_local` (boolean)
352359
- enable Transient Local of Subscription
353360
- default is false
354-
* `timer_listener_twin_static`
361+
- `timer_listener_twin_static`
355362
- behavior overview
356363
- driven by timer periodically to execute a callback function in which `/chatter` and `/slower_chatter` messages are obtained from each Subscription Queue
357364
- `rclcpp::StaticWaitSet` is used instead of `rclcpp::WaitSet`
@@ -364,7 +371,7 @@ Below is the list of listener nodes included in waitset_examples.
364371
- `use_transient_local` (boolean)
365372
- enable Transient Local of Subscription
366373
- default is false
367-
* `timer_listener_twin_nested_waitset`
374+
- `timer_listener_twin_nested_waitset`
368375
- behavior overview
369376
- run two timers one of which is `timer_` and another is `much_slower_timer_`
370377
- `timer_` is invoked per specified frequency and execute its callback function

‎intra_process_examples/src/two_node_pipeline_timer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct Consumer : public rclcpp::Node
7676
sub_ = this->create_subscription<std_msgs::msg::Int32>(
7777
input,
7878
10,
79-
[](std_msgs::msg::Int32::UniquePtr msg)
79+
[](std_msgs::msg::Int32::UniquePtr msg)
8080
{
8181
printf(
8282
" Received message with value: %d, and address: 0x%" PRIXPTR "\n", msg->data,

‎intra_process_talker_listener/launch/talker_batch_listener_intra_process.launch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ def generate_launch_description():
3131
executable='component_container',
3232
composable_node_descriptions=[
3333
ComposableNode(
34-
package='intra_process_talker_listener',
34+
package='intra_process_talker_listener',
3535
plugin='intra_process_talker_listener::TalkerIntraProcess',
3636
name='talker_intra_process',
3737
namespace='',
3838
extra_arguments=[{'use_intra_process_comms': use_intra_process_comms_value}]
3939
),
4040
ComposableNode(
41-
package='intra_process_talker_listener',
41+
package='intra_process_talker_listener',
4242
plugin='intra_process_talker_listener::TimerBatchListenerIntraProcess',
4343
name='timer_batch_listener_intra_process',
4444
namespace='',

‎intra_process_talker_listener/launch/talker_listener_intra_process.launch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def generate_launch_description():
4040
executable='component_container',
4141
composable_node_descriptions=[
4242
ComposableNode(
43-
package='intra_process_talker_listener',
43+
package='intra_process_talker_listener',
4444
plugin='intra_process_talker_listener::TalkerIntraProcess',
4545
name='talker_intra_process',
4646
namespace='',
@@ -50,7 +50,7 @@ def generate_launch_description():
5050
extra_arguments=[{'use_intra_process_comms': use_intra_process_comms_value}]
5151
),
5252
ComposableNode(
53-
package='intra_process_talker_listener',
53+
package='intra_process_talker_listener',
5454
plugin='intra_process_talker_listener::TimerListenerIntraProcess',
5555
name='timer_listener_intra_process',
5656
namespace='',

‎intra_process_talker_listener/src/timer_batch_listener_intra_process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class TimerBatchListenerIntraProcess : public rclcpp::Node
102102
subscription_options.callback_group = cb_group_noexec;
103103

104104
rclcpp::QoS qos(rclcpp::KeepLast{static_cast<size_t>(queue_size)});
105-
if (use_transient_local) {
105+
if (use_transient_local) {
106106
qos = qos.transient_local();
107107
}
108108

‎intra_process_talker_listener/src/timer_listener_intra_process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class TimerListenerIntraProcess : public rclcpp::Node
109109
subscription_options.callback_group = cb_group_noexec;
110110

111111
rclcpp::QoS qos(rclcpp::KeepLast(10));
112-
if (use_transient_local) {
112+
if (use_transient_local) {
113113
qos = qos.transient_local();
114114
}
115115

‎simple_examples/src/timer_batch_listener.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class TimerBatchListener : public rclcpp::Node
8181
subscription_options.callback_group = cb_group_noexec;
8282

8383
rclcpp::QoS qos(rclcpp::KeepLast{static_cast<size_t>(queue_size)});
84-
if (use_transient_local) {
84+
if (use_transient_local) {
8585
qos = qos.transient_local();
8686
}
8787

‎simple_examples/src/timer_listener.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class TimerListener : public rclcpp::Node
7878
subscription_options.callback_group = cb_group_noexec;
7979

8080
rclcpp::QoS qos(rclcpp::KeepLast(10));
81-
if (use_transient_local) {
81+
if (use_transient_local) {
8282
qos = qos.transient_local();
8383
}
8484

@@ -107,7 +107,7 @@ class TimerListener : public rclcpp::Node
107107

108108
rmw_time_point_value_t received_timestamp = msg_info.get_rmw_message_info().received_timestamp;
109109
const int32_t received_timestamp_sec = received_timestamp / 1000000000;
110-
const uint32_t received_timestamp_nsec = received_timestamp % 1000000000;
110+
const uint32_t received_timestamp_nsec = received_timestamp % 1000000000;
111111
RCLCPP_INFO(this->get_logger(), "Message is received at : %d.%d", received_timestamp_sec, received_timestamp_nsec);
112112

113113
RCLCPP_INFO(this->get_logger(), "publication sequence number: %ld", msg_info.get_rmw_message_info().publication_sequence_number);

‎simple_examples/src/timer_listener_using_callback.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class TimerListenerUsingCallback : public rclcpp::Node
8585
subscription_options.callback_group = cb_group_noexec;
8686

8787
rclcpp::QoS qos(rclcpp::KeepLast(10));
88-
if (use_transient_local) {
88+
if (use_transient_local) {
8989
qos = qos.transient_local();
9090
}
9191

‎simple_examples/src/timer_listener_using_callback_straight.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class TimerListenerUsingNormalFunction : public rclcpp::Node
8383
subscription_options.callback_group = cb_group_noexec;
8484

8585
rclcpp::QoS qos(rclcpp::KeepLast(10));
86-
if (use_transient_local) {
86+
if (use_transient_local) {
8787
qos = qos.transient_local();
8888
}
8989

‎simple_examples/src/timer_listener_using_normal_function.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class TimerListenerUsingNormalFunction : public rclcpp::Node
8383
subscription_options.callback_group = cb_group_noexec;
8484

8585
rclcpp::QoS qos(rclcpp::KeepLast(10));
86-
if (use_transient_local) {
86+
if (use_transient_local) {
8787
qos = qos.transient_local();
8888
}
8989

‎waitset_examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ rclcpp_components_register_node(waitset_examples_library
8181
EXECUTABLE timer_listener_triple_sync_intra)
8282
rclcpp_components_register_node(waitset_examples_library
8383
PLUGIN "waitset_examples::TimerListenerSingleWaitSomePeriod"
84-
EXECUTABLE timer_listener_single_wait_some_period)
84+
EXECUTABLE timer_listener_single_wait_some_period)
8585

8686
install(TARGETS
8787
waitset_examples_library

‎waitset_examples/launch/talker_listener_triple_intra.launch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ def generate_launch_description():
3131
executable='component_container',
3232
composable_node_descriptions=[
3333
ComposableNode(
34-
package='waitset_examples',
34+
package='waitset_examples',
3535
plugin='waitset_examples::TalkerTriple',
3636
name='talker_triple',
3737
namespace='',
3838
extra_arguments=[{'use_intra_process_comms': use_intra_process_comms_value}]
3939
),
4040
ComposableNode(
41-
package='waitset_examples',
41+
package='waitset_examples',
4242
plugin='waitset_examples::TimerListenerTripleSyncIntra',
4343
name='timer_listener_triple_sync_intra',
4444
namespace='',

‎waitset_examples/src/timer_batch_listener_single.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class TimerBatchListenerSingle : public rclcpp::Node
9797
subscription_options.callback_group = cb_group_noexec;
9898

9999
rclcpp::QoS qos(rclcpp::KeepLast{static_cast<size_t>(queue_size)});
100-
if (use_transient_local) {
100+
if (use_transient_local) {
101101
qos = qos.transient_local();
102102
}
103103

‎waitset_examples/src/timer_listener_single.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class TimerListenerSingle : public rclcpp::Node
5252
RCLCPP_INFO(this->get_logger(), "Timer triggered.");
5353

5454
auto wait_result = wait_set_.wait(std::chrono::milliseconds(0));
55-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
55+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
5656
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0]) {
5757
RCLCPP_INFO(this->get_logger(), "wait_set tells that subscription is ready");
5858
} else {
@@ -89,7 +89,7 @@ class TimerListenerSingle : public rclcpp::Node
8989
subscription_options.callback_group = cb_group_noexec;
9090

9191
rclcpp::QoS qos(rclcpp::KeepLast(10));
92-
if (use_transient_local) {
92+
if (use_transient_local) {
9393
qos = qos.transient_local();
9494
}
9595

‎waitset_examples/src/timer_listener_single_using_callback.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TimerListenerSingleUsingCallback : public rclcpp::Node
5959
RCLCPP_INFO(this->get_logger(), "Timer triggered on thread id [%s].", oss.str().c_str());
6060

6161
auto wait_result = wait_set_.wait(std::chrono::milliseconds(0));
62-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
62+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
6363
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0]) {
6464
RCLCPP_INFO(this->get_logger(), "wait_set tells that subscription is ready");
6565
} else {
@@ -93,7 +93,7 @@ class TimerListenerSingleUsingCallback : public rclcpp::Node
9393
subscription_options.callback_group = cb_group_noexec;
9494

9595
rclcpp::QoS qos(rclcpp::KeepLast(10));
96-
if (use_transient_local) {
96+
if (use_transient_local) {
9797
qos = qos.transient_local();
9898
}
9999

‎waitset_examples/src/timer_listener_single_wait_some_period.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TimerListenerSingleWaitSomePeriod : public rclcpp::Node
9999
subscription_options.callback_group = cb_group_noexec;
100100

101101
rclcpp::QoS qos(rclcpp::KeepLast(10));
102-
if (use_transient_local) {
102+
if (use_transient_local) {
103103
qos = qos.transient_local();
104104
}
105105

@@ -126,7 +126,7 @@ class TimerListenerSingleWaitSomePeriod : public rclcpp::Node
126126
rclcpp::TimerBase::SharedPtr timer_;
127127
rclcpp::WaitSet wait_set_;
128128
double waiting_time_;
129-
129+
130130
};
131131

132132
} // namespace waitset_examples

‎waitset_examples/src/timer_listener_triple_async.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class TimerListenerTripleAsync : public rclcpp::Node
9393
subscription_options.callback_group = cb_group_noexec;
9494

9595
rclcpp::QoS qos(rclcpp::KeepLast(10));
96-
if (use_transient_local) {
96+
if (use_transient_local) {
9797
qos = qos.transient_local();
9898
}
9999

‎waitset_examples/src/timer_listener_triple_separated_waitset.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TimerListenerTripleSeparatedWaitSet : public rclcpp::Node
5151

5252
auto wait_result = wait_set_.wait(std::chrono::milliseconds(0));
5353

54-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
54+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
5555
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0]) {
5656
std_msgs::msg::String msg;
5757
rclcpp::MessageInfo msg_info;
@@ -71,7 +71,7 @@ class TimerListenerTripleSeparatedWaitSet : public rclcpp::Node
7171

7272
auto wait_result = slower_wait_set_.wait(std::chrono::milliseconds(0));
7373

74-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
74+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
7575
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0]) {
7676
std_msgs::msg::String msg;
7777
rclcpp::MessageInfo msg_info;
@@ -91,7 +91,7 @@ class TimerListenerTripleSeparatedWaitSet : public rclcpp::Node
9191

9292
auto wait_result = slowest_wait_set_.wait(std::chrono::milliseconds(0));
9393

94-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
94+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
9595
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0]) {
9696
std_msgs::msg::String msg;
9797
rclcpp::MessageInfo msg_info;
@@ -114,7 +114,7 @@ class TimerListenerTripleSeparatedWaitSet : public rclcpp::Node
114114
subscription_options.callback_group = cb_group_noexec;
115115

116116
rclcpp::QoS qos(rclcpp::KeepLast(10));
117-
if (use_transient_local) {
117+
if (use_transient_local) {
118118
qos = qos.transient_local();
119119
}
120120

‎waitset_examples/src/timer_listener_triple_sync.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class TimerListenerTripleSync : public rclcpp::Node
5252
RCLCPP_INFO(this->get_logger(), "Timer triggered.");
5353

5454
auto wait_result = wait_set_.wait(std::chrono::milliseconds(0));
55-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
56-
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0] &&
55+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
56+
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0] &&
5757
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[1] &&
5858
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[2]) {
5959
RCLCPP_INFO(this->get_logger(), "wait_set tells that all subscriptions are ready");
@@ -90,7 +90,7 @@ class TimerListenerTripleSync : public rclcpp::Node
9090
subscription_options.callback_group = cb_group_noexec;
9191

9292
rclcpp::QoS qos(rclcpp::KeepLast(10));
93-
if (use_transient_local) {
93+
if (use_transient_local) {
9494
qos = qos.transient_local();
9595
}
9696

‎waitset_examples/src/timer_listener_triple_sync_intra.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class TimerListenerTripleSyncIntra : public rclcpp::Node
7070
subscription_options.callback_group = cb_group_noexec;
7171

7272
rclcpp::QoS qos(rclcpp::KeepLast(10));
73-
if (use_transient_local) {
73+
if (use_transient_local) {
7474
qos = qos.transient_local();
7575
}
7676

@@ -105,8 +105,8 @@ class TimerListenerTripleSyncIntra : public rclcpp::Node
105105
void receive_data_via_inter_process () {
106106

107107
auto wait_result = wait_set_.wait(std::chrono::milliseconds(0));
108-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
109-
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0] &&
108+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
109+
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0] &&
110110
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[1] &&
111111
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[2]) {
112112
RCLCPP_INFO(this->get_logger(), "wait_set tells that all subscriptions are ready");
@@ -138,8 +138,8 @@ class TimerListenerTripleSyncIntra : public rclcpp::Node
138138
void receive_data_via_intra_process () {
139139
auto wait_result = wait_set_.wait(std::chrono::milliseconds(0));
140140
// TODO: intra process waitable の使い方がよくわからないので調査する. 今は syntax sugar で乗り切っている状態.
141-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
142-
subscriptions_array_[0]->get_intra_process_waitable()->is_ready(nullptr) &&
141+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
142+
subscriptions_array_[0]->get_intra_process_waitable()->is_ready(nullptr) &&
143143
subscriptions_array_[1]->get_intra_process_waitable()->is_ready(nullptr) &&
144144
subscriptions_array_[2]->get_intra_process_waitable()->is_ready(nullptr)) {
145145
RCLCPP_INFO(this->get_logger(), "wait_set tells that all subscriptions are ready(intra)");

‎waitset_examples/src/timer_listener_twin_nested_waitset.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class TimerListenerTwinNestedWaitSet : public rclcpp::Node
5353
RCLCPP_INFO(this->get_logger(), "Timer triggered.");
5454

5555
auto wait_result = wait_set_.wait(std::chrono::milliseconds(0));
56-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
56+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
5757
wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0]) {
5858
std_msgs::msg::String msg;
5959
rclcpp::MessageInfo msg_info;
@@ -64,7 +64,7 @@ class TimerListenerTwinNestedWaitSet : public rclcpp::Node
6464
RCLCPP_INFO(this->get_logger(), "wait_set tells that normal subscription is not ready and return");
6565
}
6666

67-
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
67+
if (wait_result.kind() == rclcpp::WaitResultKind::Ready &&
6868
wait_result.get_wait_set().get_rcl_wait_set().timers[0]) {
6969
much_slower_timer_->execute_callback();
7070
}
@@ -76,7 +76,7 @@ class TimerListenerTwinNestedWaitSet : public rclcpp::Node
7676
RCLCPP_INFO(this->get_logger(), "Much Slower Timer triggered.");
7777

7878
auto sub_wait_result = sub_wait_set_.wait(std::chrono::milliseconds(0));
79-
if (sub_wait_result.kind() == rclcpp::WaitResultKind::Ready &&
79+
if (sub_wait_result.kind() == rclcpp::WaitResultKind::Ready &&
8080
sub_wait_result.get_wait_set().get_rcl_wait_set().subscriptions[0]) {
8181
std_msgs::msg::String msg;
8282
rclcpp::MessageInfo msg_info;
@@ -99,7 +99,7 @@ class TimerListenerTwinNestedWaitSet : public rclcpp::Node
9999
subscription_options.callback_group = cb_group_noexec;
100100

101101
rclcpp::QoS qos(rclcpp::KeepLast(10));
102-
if (use_transient_local) {
102+
if (use_transient_local) {
103103
qos = qos.transient_local();
104104
}
105105

‎waitset_examples/src/timer_listener_twin_static.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ class TimerListenerTwinStatic : public rclcpp::Node
9494
subscription_options.callback_group = cb_group_noexec;
9595

9696
rclcpp::QoS qos(rclcpp::KeepLast(10));
97-
if (use_transient_local) {
97+
if (use_transient_local) {
9898
qos = qos.transient_local();
9999
}
100100

101101
subscriptions_array_[0] = create_subscription<std_msgs::msg::String>("chatter", qos, not_executed_callback, subscription_options);
102102

103103
subscriptions_array_[1] = create_subscription<std_msgs::msg::String>("slower_chatter", qos, not_executed_callback, subscription_options);
104-
104+
105105
// Create Static Wait Set. It cannot be changed afterwards.
106106
static_wait_set_ = std::make_shared<rclcpp::StaticWaitSet<2, 0, 0, 0, 0, 0>>(
107107
std::array<rclcpp::StaticWaitSet<2, 0, 0, 0, 0, 0>::SubscriptionEntry, 2>{{{subscriptions_array_[0]}, {subscriptions_array_[1]}}},

0 commit comments

Comments
 (0)
Please sign in to comment.