diff --git a/source/Concepts/Basic/About-Interfaces.rst b/source/Concepts/Basic/About-Interfaces.rst index 5c0d3a0ae3..a071e7e8a3 100644 --- a/source/Concepts/Basic/About-Interfaces.rst +++ b/source/Concepts/Basic/About-Interfaces.rst @@ -183,6 +183,7 @@ Field default value Default values can be set to any field in the message type. Currently default values are not supported for string arrays and complex types (i.e. types not present in the built-in-types table above; that applies to all nested messages). +Special floating point values such as ``NaN``, ``+infinity``, and ``-infinity`` are not yet supported as default values. Defining a default value is done by adding a third element to the field definition line, i.e: @@ -227,6 +228,8 @@ For example: Constants names have to be UPPERCASE +Special floating point values such as ``NaN``, ``+infinity``, and ``-infinity`` are not yet supported as constant values. + Services -------- diff --git a/source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.rst b/source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.rst index 46b0215ba1..d4f33fc18c 100644 --- a/source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.rst +++ b/source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.rst @@ -303,6 +303,14 @@ If the message does not use a full header, but just has a field with type ``buil ros2 topic pub /reference sensor_msgs/msg/TimeReference '{header: "auto", time_ref: "now", source: "dumy"}' +Certain messages use ``NaN`` as a significant value. +For example, with a ``sensor_msgs/msg/BatteryState``, the temperature field may not be measured. +If so, it should be set to ``NaN``. + +.. code-block:: console + + ros2 topic pub /battery sensor_msgs/msg/BatteryState '{voltage: 12.4, temperature: .nan}' + 8 ros2 topic hz ^^^^^^^^^^^^^^^