Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization No Longer Allows float("inf") for float32 Type #169

Closed
connoranderson opened this issue Jun 2, 2022 · 7 comments · Fixed by #167
Closed

Serialization No Longer Allows float("inf") for float32 Type #169

connoranderson opened this issue Jun 2, 2022 · 7 comments · Fixed by #167
Assignees

Comments

@connoranderson
Copy link

In galactic release, we were able to use the numeric-limit value of float("inf") for a float32 type. When #128 was introduced (and subsequently we began experimenting with humble release), we observed that the numeric limit checks prevented this use case. This is creating inconsistencies as our c++ code is still able to serialize using std::numeric_limits<T>::infinity but the python code is not able to do so.

Bug report

Required Info:

  • Operating System:
    • ubuntu 22.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • humble
  • DDS implementation:
    • not relevant
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

my_msg = Msg() # info field is float32
my_msg.info = float("inf")

Expected behavior

Set my_msg.info to INF (formerly would serialize to 3.402823e+40 in galactic)

Actual behavior

AssertionError: The 'info' field must be a float in [-3.402823e+38, 3.402823e+38]
@maspe36
Copy link

maspe36 commented Jun 7, 2022

This is also a problem for float("nan")

@sloretz
Copy link
Contributor

sloretz commented Jul 18, 2022

Thanks for the report! The problem with nan was reported in #162, and #167 should fix both that and this issue.

@connoranderson
Copy link
Author

@sloretz sounds good. Can we make sure that PR gets a backport to humble release?

@connoranderson
Copy link
Author

@sloretz is there an ETA expected for #167 to merge?

@connoranderson
Copy link
Author

@sloretz do you think this will be backported to humble? Looks like there was a windows compatibility issue, as well, so just want to make sure that this fix finds its way to humble.

@aditya2592
Copy link

Hi, will this fix be backported to Humble?

@clalancette
Copy link
Contributor

Hi, will this fix be backported to Humble?

Yes, it's already done via #188 , and will be in the next patch release (later this month).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants