Skip to content

Commit 18276ae

Browse files
committed
Wording, minor changes
Thanks for the review, Ralph! Signed-off-by: Arne Nordmann <arne.nordmann@de.bosch.com>
1 parent 4e22b07 commit 18276ae

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

  • _docs/tutorials/core/programming_rcl_rclc

‎_docs/tutorials/core/programming_rcl_rclc/index.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ if (rc != RCL_RET_OK) {
215215

216216
## <a name="lifecycle"/>Lifecycle
217217

218-
The rclc lifecycle package provides convenience functions in C to bundle an rclc node with the ROS 2 Node Lifecycle state machine, similar to the [rclcpp Lifecycle Node](https://github.com/ros2/rclcpp/blob/master/rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp) for C++.
218+
The rclc lifecycle package provides convenience functions in C to bundle an rcl node with the ROS 2 Node Lifecycle state machine, similar to the [rclcpp Lifecycle Node](https://github.com/ros2/rclcpp/blob/master/rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp) for C++.
219219

220220
This tutorial show-cases how to set up an rclc lifecycle node, transition through its lifecycle states, and assign callbacks to lifecycle transitions.
221221

222222
### Initialization
223223

224-
Creation of a lifecycle node as a bundle of an rcl node and the rcl Node Lifecycle state machine.
224+
Creation of a lifecycle node as a bundle of an rcl node and the rcl lifecycle state machine.
225225

226226
```C
227227
#include "rclc_lifecycle/rclc_lifecycle.h"
@@ -233,19 +233,19 @@ rcl_ret_t rc;
233233
// create rcl node
234234
rc = rclc_support_init(&support, argc, argv, &allocator);
235235
rcl_node_t my_node = rcl_get_zero_initialized_node();
236-
rc = rclc_node_init_default(&my_node, "lifecycle_node", "rclc", &support);
236+
rc = rclc_node_init_default(&my_node, "my_lifecycle_node", "rclc", &support);
237237

238238
// rcl state machine
239-
rcl_lifecycle_state_machine_t state_machine_ =
239+
rcl_lifecycle_state_machine_t state_machine =
240240
rcl_lifecycle_get_zero_initialized_state_machine();
241241
...
242242

243243
// create the lifecycle node
244-
rclc_lifecycle_node_t lifecycle_node;
244+
rclc_lifecycle_node_t my_lifecycle_node;
245245
rcl_ret_t rc = rclc_make_node_a_lifecycle_node(
246-
&lifecycle_node,
246+
&my_lifecycle_node,
247247
&my_node,
248-
&state_machine_,
248+
&state_machine,
249249
&allocator);
250250
```
251251

@@ -254,13 +254,13 @@ Optionally create hooks for lifecycle state changes.
254254
```C
255255
// declare callback
256256
rcl_ret_t my_on_configure() {
257-
printf(" >>> lifecycle_node: on_configure() callback called.\n");
257+
printf(" >>> my_lifecycle_node: on_configure() callback called.\n");
258258
return RCL_RET_OK;
259259
}
260260
...
261261

262262
// register callbacks
263-
rclc_lifecycle_register_on_configure(&lifecycle_node, &my_on_configure);
263+
rclc_lifecycle_register_on_configure(&my_lifecycle_node, &my_on_configure);
264264
```
265265
266266
### Running
@@ -270,11 +270,11 @@ Change states of the lifecycle node, e.g.
270270
```C
271271
bool publish_transition = true;
272272
rc += rclc_lifecycle_change_state(
273-
&lifecycle_node,
273+
&my_lifecycle_node,
274274
lifecycle_msgs__msg__Transition__TRANSITION_CONFIGURE,
275275
publish_transition);
276276
rc += rclc_lifecycle_change_state(
277-
&lifecycle_node,
277+
&my_lifecycle_node,
278278
lifecycle_msgs__msg__Transition__TRANSITION_ACTIVATE,
279279
publish_transition);
280280
...
@@ -287,14 +287,14 @@ Except for error processing transitions, transitions are usually triggered from
287287
To clean everything up, simply do
288288

289289
```C
290-
rc += rcl_lifecycle_node_fini(&lifecycle_node, &allocator);
290+
rc += rcl_lifecycle_node_fini(&my_lifecycle_node, &allocator);
291291
```
292292

293293
### Example and Limitations
294294

295-
An example, how to use the RCLC Lifecycle Node is given in the file `lifecycle_node.c` in the [rclc_examples](https://github.com/micro-ROS/rclc/tree/master/rclc_examples) package.
295+
An example of the rclc Lifecycle Node is given in the file `lifecycle_node.c` in the [rclc_examples](https://github.com/micro-ROS/rclc/tree/master/rclc_examples) package.
296296

297-
The state machine publishes state changes, however, lifecycle services are not yet exposed via ROS 2 services (tbd).
297+
The state machine publishes state changes, however, lifecycle services are not yet exposed via ROS 2 services ([micro-ROS/rclc#40](https://github.com/micro-ROS/rclc/issues/40)).
298298

299299
## <a name="rclc_executor"/>rclc Executor
300300

0 commit comments

Comments
 (0)