Giter VIP home page Giter VIP logo

Comments (5)

Ryanf55 avatar Ryanf55 commented on August 17, 2024

And, the CLI also supports it on humble:
ros2 topic pub /ap/cmd_vel geometry_msgs/msg/TwistStamped "{header: {frame_id: base_link}, twist: {linear: {x: .nan, y: .nan, z: .nan}, angular: {z: 0.01}}}"

from ros2_documentation.

clalancette avatar clalancette commented on August 17, 2024

Yeah, I think that is a reasonable thing to document; I'd enhance the table in https://docs.ros.org/en/humble/Concepts/Basic/About-Interfaces.html#field-types to add a "Note" column, or something like that. If you'd like to open a PR to add that, I'd be happy to review it.

from ros2_documentation.

Ryanf55 avatar Ryanf55 commented on August 17, 2024

Yeah, I think that is a reasonable thing to document; I'd enhance the table in https://docs.ros.org/en/humble/Concepts/Basic/About-Interfaces.html#field-types to add a "Note" column, or something like that. If you'd like to open a PR to add that, I'd be happy to review it.

It doesn't look like it's actually supported.

In a .msg:

# NaN (IEE-754 quiet NaN) signifies no data is available at the location.
float64 my_value NaN

c: error: β€˜nanl’ undeclared (first use in this function)

  276 |   msg->my_value = nanl;

c++: error: β€˜nan’ was not declared in this scope

  198 |       this->my_value= nan;

from ros2_documentation.

Ryanf55 avatar Ryanf55 commented on August 17, 2024

Relates to ros2/rosidl#705

from ros2_documentation.

Ryanf55 avatar Ryanf55 commented on August 17, 2024

Huh, in the IDL 4.2 spec, it says nothing about special floating point values:
https://www.omg.org/spec/IDL/4.2/PDF

See section 7.2.6.4.

Then in the DDS Consolidated JSON 1.0 spec, it says that NaN is supported.
https://www.omg.org/spec/DDS-JSON/1.0/PDF
See section 7.3.7.4.8

Numeric values, such as Infinity, -Infinity, and NaN, which as stated in [ECMA-404] cannot be represented as
sequences of digits, shall be represented using the following JSON strings: "inf", "-inf", and "nan".

from ros2_documentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.