Update rcl_node_init docstring (#517)
Include rcl_context_t in the example usage. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This commit is contained in:
parent
b7610d9392
commit
5fb711cd0b
1 changed files with 4 additions and 1 deletions
|
@ -97,10 +97,12 @@ rcl_get_zero_initialized_node(void);
|
||||||
* Expected usage:
|
* Expected usage:
|
||||||
*
|
*
|
||||||
* ```c
|
* ```c
|
||||||
|
* rcl_context_t context = rcl_get_zero_initialized_context();
|
||||||
|
* // ... initialize the context with rcl_init()
|
||||||
* rcl_node_t node = rcl_get_zero_initialized_node();
|
* rcl_node_t node = rcl_get_zero_initialized_node();
|
||||||
* rcl_node_options_t node_ops = rcl_node_get_default_options();
|
* rcl_node_options_t node_ops = rcl_node_get_default_options();
|
||||||
* // ... node options customization
|
* // ... node options customization
|
||||||
* rcl_ret_t ret = rcl_node_init(&node, "node_name", "/node_ns", &node_ops);
|
* rcl_ret_t ret = rcl_node_init(&node, "node_name", "/node_ns", &context, &node_ops);
|
||||||
* // ... error handling and then use the node, but eventually deinitialize it:
|
* // ... error handling and then use the node, but eventually deinitialize it:
|
||||||
* ret = rcl_node_fini(&node);
|
* ret = rcl_node_fini(&node);
|
||||||
* // ... error handling for rcl_node_fini()
|
* // ... error handling for rcl_node_fini()
|
||||||
|
@ -116,6 +118,7 @@ rcl_get_zero_initialized_node(void);
|
||||||
* <i>[1] if `atomic_is_lock_free()` returns true for `atomic_uint_least64_t`</i>
|
* <i>[1] if `atomic_is_lock_free()` returns true for `atomic_uint_least64_t`</i>
|
||||||
*
|
*
|
||||||
* \pre the node handle must be allocated, zero initialized, and invalid
|
* \pre the node handle must be allocated, zero initialized, and invalid
|
||||||
|
* \pre the context handle must be allocated, initialized, and valid
|
||||||
* \post the node handle is valid and can be used in other `rcl_*` functions
|
* \post the node handle is valid and can be used in other `rcl_*` functions
|
||||||
*
|
*
|
||||||
* \param[inout] node a preallocated rcl_node_t
|
* \param[inout] node a preallocated rcl_node_t
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue