Skip to content

Commit c471d0e

Browse files
committed
update docs on the third argument to enable introspection
1 parent b499248 commit c471d0e

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

doc/introspection.rst

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,19 @@ How to register a variable for introspection
4242
void MyController::on_configure()
4343
{
4444
...
45-
// Register the variable for introspection
45+
// Register the variable for introspection (disabled by default)
46+
// The variable is introspected only when the controller is active and
47+
// then deactivated when the controller is deactivated.
4648
REGISTER_ROS2_CONTROL_INTROSPECTION("my_variable_name", &my_variable_);
49+
// Register the variable for introspection that starts with the introspection enabled
50+
// So, that the variable starts to be introspected, when the controller is in configured state.
51+
// However, once the controller is activated and deactivated, the introspection is disabled.
52+
REGISTER_ROS2_CONTROL_INTROSPECTION("my_active_variable", &my_active_variable_, true);
4753
...
4854
}
4955
5056
3. By default, The introspection of all the registered variables of the controllers and the hardware components is only activated, when they are active and it is deactivated when the controller or hardware component is deactivated.
5157

52-
.. code-block:: cpp
53-
54-
void MyController::on_configure()
55-
{
56-
...
57-
// Register the variable for introspection
58-
REGISTER_ROS2_CONTROL_INTROSPECTION("my_variable_name", &my_variable_, true);
59-
...
60-
}
61-
6258
.. note::
6359
If you want to keep the introspection active even when the controller or hardware component is not active, you can do that by calling ``this->enable_introspection(true)`` in the ``on_configure`` and ``on_deactivate`` method of the controller or hardware component after registering the variables.
6460

0 commit comments

Comments
 (0)