diff --git a/doc/migration.rst b/doc/migration.rst index 777f724cee..da2ca75ffc 100644 --- a/doc/migration.rst +++ b/doc/migration.rst @@ -75,7 +75,7 @@ hardware_interface ****************** * ``test_components`` was moved to its own package. Update the dependencies if you are using them. (`#1325 `_) * With (`#1683 `_) the ``rclcpp_lifecycle::State & get_state()`` and ``void set_state(const rclcpp_lifecycle::State & new_state)`` are replaced by ``rclcpp_lifecycle::State & get_lifecycle_state()`` and ``void set_lifecycle_state(const rclcpp_lifecycle::State & new_state)``. This change affects controllers and hardware. This is related to (`#1240 `_) as variant support introduces ``get_state`` and ``set_state`` methods for setting/getting state of handles. -* A new ``get_value`` that returns a ``std::optional`` was added to the ``CommandInterface`` and ``StateInterface``. This can be used to check if the value is available or not. (`#1976 `_) +* A new ``get_optional`` that returns a ``std::optional`` was added to the ``CommandInterface`` and ``StateInterface``. This can be used to check if the value is available or not. (`#1976 `_ and `#2061 `_) Adaption of Command-/StateInterfaces *************************************** @@ -90,12 +90,12 @@ Earlier code will issue compile-time warnings like: .. code:: - warning: ‘double hardware_interface::Handle::get_value() const’ is deprecated: Use std::optional get_value() or bool get_value(double & value) instead to retrieve the value. [-Wdeprecated-declarations] + warning: ‘double hardware_interface::Handle::get_value() const’ is deprecated: Use std::optional get_optional() or bool get_value(double & value) instead to retrieve the value. [-Wdeprecated-declarations] warning: ignoring return value of ‘bool hardware_interface::Handle::set_value(const T&) [with T = double]’ [-Wunused-result] The old methods are deprecated and will be removed in the future. The new methods are: - * ``std::optional get_value()`` or ``bool get_value(T & value)`` for getting the value. + * ``std::optional get_optional()`` or ``bool get_value(T & value)`` for getting the value. * ``bool set_value(const T & value)`` for setting the value. The return value ``bool`` or ``std::optional`` with ``get_value`` can be used to check if the value is available or not. Similarly, the ``set_value`` method returns a ``bool`` to check if the value was set or not. diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 9143dc6ac1..a5b87cd7f5 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -164,7 +164,7 @@ hardware_interface * With (`#1763 `_) parsing for SDF published to ``robot_description`` topic is now also supported. * With (`#1567 `_) all the Hardware components now have a fully functional asynchronous functionality, by simply adding ``is_async`` tag to the ros2_control tag in the URDF. This will allow the hardware components to run in a separate thread, and the controller manager will be able to run the controllers in parallel with the hardware components. * The hardware components can be easily introspect the internal member variables using the macro ``REGISTER_ROS2_CONTROL_INTROSPECTION`` (`#1918 `_) -* Added new ``get_value`` method that returns ``std::optional`` of the templated type, and this can be used to check if the value is available or not (`#1976 `_) +* Added new ``get_optional`` method that returns ``std::optional`` of the templated type, and this can be used to check if the value is available or not (`#1976 `_ and `#2061 `_) joint_limits ************