Skip to content

Duration: why no .seconds()? #482

@AndyZe

Description

@AndyZe

Bug report

Required Info:

  • Operating System:
    Ubuntu 16.04
  • Installation type:
    • binary
  • Version or commit hash:
    • rclcpp: 0.4.0-0xenial-20180208-1432
  • Client library (if applicable):
    • rclcpp

Feature description

Feedback from a new ROS2 user: I think the new clock is unnecessarily confusing. Why does the constructor take seconds and nanoseconds, but there's only a method to access nanoseconds?

When I retrieve nanoseconds like so:

rclcpp::Duration delta_t_;
delta_t_.nanoseconds();

Am I getting the total time (seconds+nanoseconds)? Or is it the modulo?

My initial thought was that I should do this to convert to seconds, but I have a feeling this is not correct:
delta_t_.nanoseconds()/1000000000;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions