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

Incorrect conversion from rclpy duration to duration message for negative values in Foxy and Galactic #915

Open
KOGDev opened this issue Mar 23, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@KOGDev
Copy link

KOGDev commented Mar 23, 2022

Bug report

Required Info:

  • Operating System:
    • debian 11 running OSRF ROS docker images
  • Installation type:
    • Binary from docker images (ros:foxy f54dd2b563ff and ros:galactic f091b223bb3c)
  • Version or commit hash:
    • foxy and galactic
  • DDS implementation:
    • not relevant
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

import rclpy.duration
rclpy.duration.Duration(seconds=-1.5).to_msg()

Expected behavior

returns builtin_interfaces.msg.Duration(sec=-2, nanosec=500000000)

Actual behavior

returns builtin_interfaces.msg.Duration(sec=-1, nanosec=500000000)

Additional information

The bug is made more clear converting the duration message back to an rclpy duration:

rclpy.duration.Duration.from_msg(rclpy.duration.Duration(seconds=-1.5).to_msg())

results in Duration(nanoseconds=-500000000)

This has been fixed in rolling for a precision issue in #876
Can this be backported to foxy and galactic to solve both the precision issue and this negative duration issue?

@fujitatomoya
Copy link
Collaborator

@fujitatomoya fujitatomoya self-assigned this Mar 24, 2022
@fujitatomoya fujitatomoya added the bug Something isn't working label Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants