Skip to content

Commit 9c54cd6

Browse files
JanStaschulatralph-lange
authored andcommitted
updated timer section and small other things
Signed-off-by: Staschulat Jan <jan.staschulat@de.bosch.com>
1 parent ebb18fd commit 9c54cd6

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • _docs/tutorials/core/programming_rcl_rclc

_docs/tutorials/core/programming_rcl_rclc/index.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if (RCL_RET_OK != rc) {
5454
}
5555
```
5656

57-
Publishing a message:
57+
Initializing a message:
5858

5959
```c
6060
std_msgs__msg__String__init(&pub_msg);
@@ -64,7 +64,7 @@ snprintf(pub_string, 13, "%s", "Hello World!");
6464
rosidl_generator_c__String__assignn(&pub_msg, pub_string, PUB_MSG_SIZE);
6565
```
6666
67-
Creating a subscription by `rclc_subscription_init_default(..)` from [rclc/subscription.h](https://github.com/micro-ROS/rclc/blob/master/rclc/include/rclc/subscription.h), respectively:
67+
Creating a subscription by `rclc_subscription_init_default(..)` from [rclc/subscription.h](https://github.com/micro-ROS/rclc/blob/master/rclc/include/rclc/subscription.h):
6868
6969
```c
7070
rcl_subscription_t my_sub = rcl_get_zero_initialized_subscription();
@@ -204,11 +204,7 @@ A timer can be created with the rclc-package with the function
204204
// create a timer, which will call the publisher with period=`timer_timeout` ms in the 'my_timer_callback'
205205
rcl_timer_t my_timer = rcl_get_zero_initialized_timer();
206206
const unsigned int timer_timeout = 1000;
207-
rc = rclc_timer_init_default(
208-
&my_timer,
209-
&support,
210-
RCL_MS_TO_NS(timer_timeout),
211-
my_timer_callback);
207+
rc = rclc_timer_init_default(&my_timer, &support, RCL_MS_TO_NS(timer_timeout), my_timer_callback);
212208
if (rc != RCL_RET_OK) {
213209
printf("Error in rcl_timer_init_default.\n");
214210
return -1;

0 commit comments

Comments
 (0)