Skip to content

Commit 918e6b9

Browse files
committed
PR review #162
Signed-off-by: Staschulat Jan <jan.staschulat@de.bosch.com>
1 parent 3f505e6 commit 918e6b9

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

  • _docs/tutorials/core/programming_rcl_rclc

_docs/tutorials/core/programming_rcl_rclc/index.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,7 @@ bool pub_trigger(rclc_executor_handle_t * handles, unsigned int size, void * obj
539539
}
540540
}
541541
}
542-
if (timer1 || timer2) {
543-
return true;
544-
} else {
545-
return false;
546-
}
542+
return (timer1 || timer2);
547543
}
548544
```
549545
The trigger condition for the subscription `sub_trigger`shall implement an AND-logic. That is, only if both subscriptions have received a new message, then the executor shall start processing the callbacks.
@@ -577,11 +573,7 @@ bool sub_trigger(rclc_executor_handle_t * handles, unsigned int size, void * obj
577573
}
578574
}
579575
}
580-
if (sub1 && sub2) {
581-
return true;
582-
} else {
583-
return false;
584-
}
576+
return (sub1 && sub2);
585577
}
586578
```
587579
Like in the Hello-World example, the subscription callbacks just prints out the received message.
@@ -619,6 +611,7 @@ In the `my_timer_string_callback`, the message `pub_msg` is created and filled w
619611
The macro `UNUSED` is a workaround for the linter warning, that the second parameter `last_call_time` is not used.
620612
```C
621613
#define UNUSED(x) (void)x;
614+
622615
void my_timer_string_callback(rcl_timer_t * timer, int64_t last_call_time)
623616
{
624617
rcl_ret_t rc;

0 commit comments

Comments
 (0)