Skip to content

Commit

Permalink
Fix bad rmw_time_t to nanoseconds conversion. (#555)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
hidmic authored May 7, 2020
1 parent 1a76300 commit 3504f36
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rclpy/src/rclpy_common/src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ static
PyObject *
_convert_rmw_time_to_py_duration(const rmw_time_t * duration)
{
uint64_t total_nanoseconds = RCUTILS_S_TO_NS(duration->sec) + duration->nsec;
PyObject * pyduration_module = NULL;
PyObject * pyduration_class = NULL;
PyObject * args = NULL;
Expand All @@ -163,7 +162,7 @@ _convert_rmw_time_to_py_duration(const rmw_time_t * duration)
if (!args) {
goto cleanup;
}
kwargs = Py_BuildValue("{sK}", "nanoseconds", total_nanoseconds);
kwargs = Py_BuildValue("{sKsK}", "seconds", duration->sec, "nanoseconds", duration->nsec);
if (!kwargs) {
goto cleanup;
}
Expand Down

0 comments on commit 3504f36

Please sign in to comment.