Skip to content

Commit 6313418

Browse files
christophfroehlichmergify[bot]
authored andcommitted
Let sphinx add parameter description with nested structures to documentation (#652)
(cherry picked from commit f375c69)
1 parent 6285b43 commit 6313418

File tree

15 files changed

+204
-248
lines changed

15 files changed

+204
-248
lines changed

admittance_controller/doc/userdoc.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ ROS 2 interface of the controller
1717
Parameters
1818
^^^^^^^^^^^
1919

20-
The admittance controller's uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters.
21-
The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/admittance_controller/src/admittance_controller_parameters.yaml>`_ contains descriptions for all the parameters used by the controller.
22-
An example parameter file can be found in the `test folder of the controller <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/admittance_controller/test/test_params.yaml>`_
20+
The admittance controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters. The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/admittance_controller/src/admittance_controller_parameters.yaml>`_ contains descriptions for all the parameters used by the controller.
2321

22+
.. generate_parameter_library_details:: ../src/admittance_controller_parameters.yaml
23+
24+
An example parameter file for this controller can be found in `the test folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/admittance_controller/test/test_params.yaml>`_:
25+
26+
.. literalinclude:: ../test/test_params.yaml
27+
:language: yaml
2428

2529
Topics
2630
^^^^^^^
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
linear.x: |
2+
Joint limits structure for the linear ``x``-axis.
3+
The limiter ignores position limits.
4+
For details see ``joint_limits`` package from ros2_control repository.
5+
6+
angular.z: |
7+
Joint limits structure for the rotation about ``z``-axis.
8+
The limiter ignores position limits.
9+
For details see ``joint_limits`` package from ros2_control repository.

diff_drive_controller/doc/userdoc.rst

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,12 @@ Publishers
6767
Parameters
6868
,,,,,,,,,,,,
6969

70-
Check `parameter definition file for details <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/diff_drive_controller/src/diff_drive_controller_parameter.yaml>`_.
70+
This controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters. The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/diff_drive_controller/src/diff_drive_controller_parameter.yaml>`_ contains descriptions for all the parameters used by the controller.
7171

72-
Note that the documentation on parameters for joint limits can be found in `their header file <https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/joint_limits/include/joint_limits/joint_limits_rosparam.hpp#L56-L75>`_.
73-
Those parameters are:
72+
.. generate_parameter_library_details:: ../src/diff_drive_controller_parameter.yaml
73+
parameters_context.yaml
7474

75-
linear.x [JointLimits structure]
76-
Joint limits structure for the linear X-axis.
77-
The limiter ignores position limits.
78-
For details see ``joint_limits`` package from ros2_control repository.
75+
An example parameter file for this controller can be found in `the test directory <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/diff_drive_controller/test/config/test_diff_drive_controller.yaml>`_:
7976

80-
angular.z [JointLimits structure]
81-
Joint limits structure for the rotation about Z-axis.
82-
The limiter ignores position limits.
83-
For details see ``joint_limits`` package from ros2_control repository.
77+
.. literalinclude:: ../test/config/test_diff_drive_controller.yaml
78+
:language: yaml
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
interface_names: |
2+
(optional) Defines custom, per axis interface names.
3+
This is used if different prefixes, i.e., sensor name, or non-standard interface names are used.
4+
It is sufficient that only one ``interface_name`` is defined.
5+
This enables the broadcaster to use force sensing cells with less than six measuring axes.
6+
An example definition is:
7+
8+
.. code-block:: yaml
9+
10+
interface_names:
11+
force:
12+
x: example_name/example_interface

force_torque_sensor_broadcaster/doc/userdoc.rst

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,17 @@ The controller is a wrapper around ``ForceTorqueSensor`` semantic component (see
1212

1313
Parameters
1414
^^^^^^^^^^^
15-
The interfaces can be defined in two ways, using ``sensor_name`` or ``interface_names`` parameter.
16-
Those two parameters can not be defined at the same time
15+
This controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters. The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/force_torque_sensor_broadcaster/src/force_torque_sensor_broadcaster_parameters.yaml>`_ contains descriptions for all the parameters used by the controller.
1716

18-
frame_id (mandatory)
19-
Frame in which the output message will be published.
17+
The interfaces can be defined in two ways, using the ``sensor_name`` or the ``interface_names`` parameter:
18+
Those two parameters cannot be defined at the same time.
2019

21-
sensor_name (optional)
22-
Defines sensor name used as prefix for its interfaces.
23-
If used standard interface names for a 6D FTS will be used: <sensor_name>/force.x, ..., <sensor_name>/torque.z.
20+
Full list of parameters:
2421

25-
interface_names.[force|torque].[x|y|z] (optional)
26-
Defines custom, per axis interface names.
27-
This is used if different prefixes, i.e., sensor name, or non-standard interface names are used.
28-
It is sufficient that only one ``interface_name`` is defined.
29-
This enables broadcaster use for force sensing cells with less then six measuring axes.
30-
Example definition is:
22+
.. generate_parameter_library_details:: ../src/force_torque_sensor_broadcaster_parameters.yaml
23+
parameters_context.yaml
3124

32-
.. code-block:: yaml
25+
An example parameter file for this controller can be found in `the test directory <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/force_torque_sensor_broadcaster/test/force_torque_sensor_broadcaster_params.yaml>`_:
3326

34-
interface_names:
35-
force:
36-
x: example_name/example_interface
27+
.. literalinclude:: ../test/force_torque_sensor_broadcaster_params.yaml
28+
:language: yaml

force_torque_sensor_broadcaster/src/force_torque_sensor_broadcaster_parameters.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ force_torque_sensor_broadcaster:
1010
sensor_name: {
1111
type: string,
1212
default_value: "",
13-
description: "Name of the sensor used as prefix for interfaces if there are no individual interface names defined.",
13+
description: "Name of the sensor used as prefix for interfaces if there are no individual interface names defined.
14+
If used, standard interface names for a 6D FTS will be used: ``<sensor_name>/force.x, ..., <sensor_name>/torque.z``",
1415
}
1516
interface_names:
1617
force:

gripper_controllers/doc/userdoc.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,23 @@
55
Gripper Action Controller
66
--------------------------------
77

8-
Controller for executing a gripper command action for simple single-dof grippers.
8+
Controllers for executing a gripper command action for simple single-dof grippers:
9+
10+
- ``position_controllers/GripperActionController``
11+
- ``effort_controllers/GripperActionController``
912

1013
Parameters
1114
^^^^^^^^^^^
12-
This controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters.
15+
These controllers use the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters. The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/gripper_controllers/src/gripper_action_controller_parameters.yaml>`_ contains descriptions for all the parameters used by the controller.
16+
17+
List of parameters
18+
=========================
1319

1420
.. generate_parameter_library_details:: ../src/gripper_action_controller_parameters.yaml
21+
22+
23+
An example parameter file
24+
=========================
25+
26+
.. generate_parameter_library_default::
27+
../src/gripper_action_controller_parameters.yaml

imu_sensor_broadcaster/doc/userdoc.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ The controller is a wrapper around ``IMUSensor`` semantic component (see ``contr
1111

1212
Parameters
1313
^^^^^^^^^^^
14-
This controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters.
14+
This controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters. The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/imu_sensor_broadcaster/src/imu_sensor_broadcaster_parameters.yaml>`_ contains descriptions for all the parameters used by the controller.
1515

16+
List of parameters
17+
=========================
1618
.. generate_parameter_library_details:: ../src/imu_sensor_broadcaster_parameters.yaml
19+
20+
21+
An example parameter file
22+
=========================
23+
24+
An example parameter file for this controller can be found in `the test directory <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/imu_sensor_broadcaster/test/imu_sensor_broadcaster_params.yaml>`_:
25+
26+
.. literalinclude:: ../test/imu_sensor_broadcaster_params.yaml
27+
:language: yaml
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
map_interface_to_joint_state: |
2+
Optional parameter (map) providing mapping between custom interface names to standard fields in ``joint_states`` message.
3+
Usecases:
4+
5+
#. Hydraulics robots where feedback and commanded values often have an offset and reliance on open-loop control is common.
6+
Typically one would map both values in separate interfaces in the framework.
7+
To visualize those data multiple joint_state_broadcaster instances and robot_state_publishers would be used to visualize both values in RViz.
8+
#. A robot provides multiple measuring techniques for its joint values which results in slightly different values.
9+
Typically one would use separate interface for providing those values in the framework.
10+
Using multiple joint_state_broadcaster instances we could publish and show both in RViz.
11+
12+
Format (each line is optional):
13+
14+
.. code-block:: yaml
15+
16+
\tmap_interface_to_joint_state:
17+
\t\tposition: <custom_interface>
18+
\t\tvelocity: <custom_interface>
19+
\t\teffort: <custom_interface>
20+
21+
22+
Examples:
23+
24+
.. code-block:: yaml
25+
26+
\tmap_interface_to_joint_state:
27+
\t\tposition: kf_estimated_position
28+
29+
30+
.. code-block:: yaml
31+
32+
\tmap_interface_to_joint_state:
33+
\t\tvelocity: derived_velocity
34+
\t\teffort: derived_effort
35+
36+
37+
.. code-block:: yaml
38+
39+
\tmap_interface_to_joint_state:
40+
\t\teffort: torque_sensor
41+
42+
43+
.. code-block:: yaml
44+
45+
\tmap_interface_to_joint_state:
46+
\t\teffort: current_sensor

joint_state_broadcaster/doc/userdoc.rst

Lines changed: 10 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -22,70 +22,19 @@ If none of the requested interface are not defined, the controller returns error
2222

2323
Parameters
2424
----------
25+
This controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters. The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/joint_state_broadcaster/src/joint_state_broadcaster_parameters.yaml>`_ contains descriptions for all the parameters used by the controller.
2526

26-
use_local_topics
27-
Optional parameter (boolean; default: ``False``) defining if ``joint_states`` and ``dynamic_joint_states`` messages should be published into local namespace, e.g., ``/my_state_broadcaster/joint_states``.
2827

28+
List of parameters
29+
,,,,,,,,,,,,,,,,,,
2930

30-
joints
31-
Optional parameter (string array) to support broadcasting of only specific joints and interfaces.
32-
It has to be used in combination with the ``interfaces`` parameter.
33-
Joint state broadcaster asks for access to all defined interfaces on all defined joints.
31+
.. generate_parameter_library_details::
32+
../src/joint_state_broadcaster_parameters.yaml
33+
joint_state_broadcaster_parameter_context.yml
3434

3535

36-
interfaces
37-
Optional parameter (string array) to support broadcasting of only specific joints and interfaces.
38-
It has to be used in combination with the ``joints`` parameter.
36+
An example parameter file
37+
,,,,,,,,,,,,,,,,,,,,,,,,,
3938

40-
41-
extra_joints
42-
Optional parameter (string array) with names of extra joints to be added to ``joint_states`` and ``dynamic_joint_states`` with state set to 0.
43-
44-
45-
map_interface_to_joint_state
46-
Optional parameter (map) providing mapping between custom interface names to standard fields in ``joint_states`` message.
47-
Usecases:
48-
49-
1. Hydraulics robots where feedback and commanded values often have an offset and reliance on open-loop control is common.
50-
Typically one would map both values in separate interfaces in the framework.
51-
To visualize those data multiple joint_state_broadcaster instances and robot_state_publishers would be used to visualize both values in RViz.
52-
53-
1. A robot provides multiple measuring techniques for its joint values which results in slightly different values.
54-
Typically one would use separate interface for providing those values in the framework.
55-
Using multiple joint_state_broadcaster instances we could publish and show both in RViz.
56-
57-
Format (each line is optional):
58-
59-
.. code-block:: yaml
60-
61-
map_interface_to_joint_state:
62-
position: <custom_interface>
63-
velocity: <custom_interface>
64-
effort: <custom_interface>
65-
66-
67-
Examples:
68-
69-
.. code-block:: yaml
70-
71-
map_interface_to_joint_state:
72-
position: kf_estimated_position
73-
74-
75-
.. code-block:: yaml
76-
77-
map_interface_to_joint_state:
78-
velocity: derived_velocity
79-
effort: derived_effort
80-
81-
82-
.. code-block:: yaml
83-
84-
map_interface_to_joint_state:
85-
effort: torque_sensor
86-
87-
88-
.. code-block:: yaml
89-
90-
map_interface_to_joint_state:
91-
effort: current_sensor
39+
.. generate_parameter_library_default::
40+
../src/joint_state_broadcaster_parameters.yaml

0 commit comments

Comments
 (0)