From e5d266116be0024752464f8624570a8d07f6c66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Sat, 27 May 2023 19:16:30 +0200 Subject: [PATCH 1/2] Docs: Use branch name substitution for all links (#1031) (cherry picked from commit 590de4e346fe5ce007662f9db000e46fca6b429e) # Conflicts: # doc/index.rst # hardware_interface/doc/hardware_components_userdoc.rst # hardware_interface/doc/mock_components_userdoc.rst # hardware_interface/doc/writing_new_hardware_interface.rst # ros2controlcli/doc/userdoc.rst --- controller_manager/doc/userdoc.rst | 2 +- doc/index.rst | 5 +++++ .../doc/hardware_components_userdoc.rst | 5 +++++ .../doc/mock_components_userdoc.rst | 5 +++++ .../doc/writing_new_hardware_interface.rst | 19 +++++++++++++------ ros2controlcli/doc/userdoc.rst | 5 +++++ 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/controller_manager/doc/userdoc.rst b/controller_manager/doc/userdoc.rst index 66b19054f3..f8ee2a6ec5 100644 --- a/controller_manager/doc/userdoc.rst +++ b/controller_manager/doc/userdoc.rst @@ -1,4 +1,4 @@ -:github_url: https://github.com/ros-controls/ros2_control/blob/|github_branch|/controller_manager/doc/userdoc.rst +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/controller_manager/doc/userdoc.rst .. _controller_manager_userdoc: diff --git a/doc/index.rst b/doc/index.rst index 5821b795f3..40b98416e1 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,3 +1,8 @@ +<<<<<<< HEAD +======= +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/doc/index.rst + +>>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _ros2_control_framework: ################# diff --git a/hardware_interface/doc/hardware_components_userdoc.rst b/hardware_interface/doc/hardware_components_userdoc.rst index e6a9bf5029..31ae42f9ad 100644 --- a/hardware_interface/doc/hardware_components_userdoc.rst +++ b/hardware_interface/doc/hardware_components_userdoc.rst @@ -1,3 +1,8 @@ +<<<<<<< HEAD +======= +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/hardware_components_userdoc.rst + +>>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _hardware_components_userdoc: Hardware Components diff --git a/hardware_interface/doc/mock_components_userdoc.rst b/hardware_interface/doc/mock_components_userdoc.rst index a285408b5f..0b9646be0c 100644 --- a/hardware_interface/doc/mock_components_userdoc.rst +++ b/hardware_interface/doc/mock_components_userdoc.rst @@ -1,3 +1,8 @@ +<<<<<<< HEAD +======= +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/mock_components_userdoc.rst + +>>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _mock_components_userdoc: Mock Components diff --git a/hardware_interface/doc/writing_new_hardware_interface.rst b/hardware_interface/doc/writing_new_hardware_interface.rst index fb748359eb..eca71d44b7 100644 --- a/hardware_interface/doc/writing_new_hardware_interface.rst +++ b/hardware_interface/doc/writing_new_hardware_interface.rst @@ -1,3 +1,8 @@ +<<<<<<< HEAD +======= +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/writing_new_hardware_interface.rst + +>>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _writing_new_hardware_interface: Writing a new hardware interface @@ -28,7 +33,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 1. Take care that you use header guards. ROS2-style is using ``#ifndef`` and ``#define`` preprocessor directives. (For more information on this, a search engine is your friend :) ). 2. Include ``"hardware_interface/$interface_type$_interface.hpp"`` and ``visibility_control.h`` if you are using one. - ``$interface_type$`` can be ``Actuator``, ``Sensor`` or ``System`` depending on the type of hardware you are using. for more details about each type check `Hardware Components description `_. + ``$interface_type$`` can be ``Actuator``, ``Sensor`` or ``System`` depending on the type of hardware you are using. for more details about each type check :ref:`Hardware Components description `. 3. Define a unique namespace for your hardware_interface. This is usually the package name written in ``snake_case``. @@ -37,7 +42,7 @@ The following is a step-by-step guide to create source files, basic tests, and c class HardwareInterfaceName : public hardware_interface::$InterfaceType$Interface 5. Add a constructor without parameters and the following public methods implementing ``LifecycleNodeInterface``: ``on_configure``, ``on_cleanup``, ``on_shutdown``, ``on_activate``, ``on_deactivate``, ``on_error``; and overriding ``$InterfaceType$Interface`` definition: ``on_init``, ``export_state_interfaces``, ``export_command_interfaces``, ``prepare_command_mode_switch`` (optional), ``perform_command_mode_switch`` (optional), ``read``, ``write``. - For further explanation of hardware-lifecycle check the `pull request `_ and for exact definitions of methods check the ``"hardware_interface/$interface_type$_interface.hpp"`` header or `doxygen documentation `_ for *Actuator*, *Sensor* or *System*. + For further explanation of hardware-lifecycle check the `pull request `_ and for exact definitions of methods check the ``"hardware_interface/$interface_type$_interface.hpp"`` header or `doxygen documentation `_ for *Actuator*, *Sensor* or *System*. 4. **Adding definitions into source file (.cpp)** @@ -77,7 +82,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 5. **Writing export definition for pluginlib** 1. Create the ``.xml`` file in the package and add a definition of the library and hardware interface's class which has to be visible for the pluginlib. - The easiest way to do that is to check definition for mock components in the `hardware_interface mock_components `_ section. + The easiest way to do that is to check definition for mock components in the :ref:`hardware_interface mock_components ` section. 2. Usually, the plugin name is defined by the package (namespace) and the class name, e.g., ``/``. @@ -88,7 +93,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 1. Create the folder ``test`` in your package, if it does not exist already, and add a file named ``test_load_.cpp``. - 2. You can copy the ``load_generic_system_2dof`` content defined in the `test_generic_system.cpp `_ package. + 2. You can copy the ``load_generic_system_2dof`` content defined in the `test_generic_system.cpp `_ package. 3. Change the name of the copied test and in the last line, where hardware interface type is specified put the name defined in ``.xml`` file, e.g., ``/``. @@ -113,7 +118,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 7. In the test section add the following dependencies: ``ament_cmake_gmock``, ``hardware_interface``. 8. Add compile definitions for the tests using the ``ament_add_gmock`` directive. - For details, see how it is done for mock hardware in the `ros2_control `_ package. + For details, see how it is done for mock hardware in the `ros2_control `_ package. 9. (optional) Add your hardware interface`s library into ``ament_export_libraries`` before ``ament_package()``. @@ -137,4 +142,6 @@ That's it! Enjoy writing great controllers! Useful External References --------------------------- -- `Templates and scripts for generating controllers shell `_ **NOTE**: The script is currently only recommended to use for Foxy, not compatible with the API from Galactic and onwards. +- `Templates and scripts for generating controllers shell `_ + + .. NOTE:: The script is currently only recommended to use for Foxy, not compatible with the API from Galactic and onwards. diff --git a/ros2controlcli/doc/userdoc.rst b/ros2controlcli/doc/userdoc.rst index 3d0fd35a2e..fe1be47695 100644 --- a/ros2controlcli/doc/userdoc.rst +++ b/ros2controlcli/doc/userdoc.rst @@ -1,3 +1,8 @@ +<<<<<<< HEAD +======= +:github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/ros2controlcli/doc/userdoc.rst + +>>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _ros2controlcli_userdoc: Command Line Interface From 0cbeef8a6ccd5faa7f62ef82775dbdcd271944b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Wed, 31 May 2023 09:04:48 +0200 Subject: [PATCH 2/2] Fix merge conflicts (#1043) --- doc/index.rst | 3 --- hardware_interface/doc/hardware_components_userdoc.rst | 3 --- hardware_interface/doc/mock_components_userdoc.rst | 3 --- hardware_interface/doc/writing_new_hardware_interface.rst | 3 --- ros2controlcli/doc/userdoc.rst | 3 --- 5 files changed, 15 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 40b98416e1..196ea93285 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,8 +1,5 @@ -<<<<<<< HEAD -======= :github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/doc/index.rst ->>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _ros2_control_framework: ################# diff --git a/hardware_interface/doc/hardware_components_userdoc.rst b/hardware_interface/doc/hardware_components_userdoc.rst index 31ae42f9ad..cd93f472a5 100644 --- a/hardware_interface/doc/hardware_components_userdoc.rst +++ b/hardware_interface/doc/hardware_components_userdoc.rst @@ -1,8 +1,5 @@ -<<<<<<< HEAD -======= :github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/hardware_components_userdoc.rst ->>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _hardware_components_userdoc: Hardware Components diff --git a/hardware_interface/doc/mock_components_userdoc.rst b/hardware_interface/doc/mock_components_userdoc.rst index 0b9646be0c..25cfc72a27 100644 --- a/hardware_interface/doc/mock_components_userdoc.rst +++ b/hardware_interface/doc/mock_components_userdoc.rst @@ -1,8 +1,5 @@ -<<<<<<< HEAD -======= :github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/mock_components_userdoc.rst ->>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _mock_components_userdoc: Mock Components diff --git a/hardware_interface/doc/writing_new_hardware_interface.rst b/hardware_interface/doc/writing_new_hardware_interface.rst index eca71d44b7..1ff4dc4420 100644 --- a/hardware_interface/doc/writing_new_hardware_interface.rst +++ b/hardware_interface/doc/writing_new_hardware_interface.rst @@ -1,8 +1,5 @@ -<<<<<<< HEAD -======= :github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/hardware_interface/doc/writing_new_hardware_interface.rst ->>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _writing_new_hardware_interface: Writing a new hardware interface diff --git a/ros2controlcli/doc/userdoc.rst b/ros2controlcli/doc/userdoc.rst index fe1be47695..9b9feecf26 100644 --- a/ros2controlcli/doc/userdoc.rst +++ b/ros2controlcli/doc/userdoc.rst @@ -1,8 +1,5 @@ -<<<<<<< HEAD -======= :github_url: https://github.com/ros-controls/ros2_control/blob/{REPOS_FILE_BRANCH}/ros2controlcli/doc/userdoc.rst ->>>>>>> 590de4e (Docs: Use branch name substitution for all links (#1031)) .. _ros2controlcli_userdoc: Command Line Interface