Skip to content

Commit

Permalink
return timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
mabelzhang committed Jan 16, 2020
1 parent 91f6763 commit deafbf8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rosbag2_py/src/rosbag2_py/_rosbag2_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,13 @@ class SequentialReader
}

/// Return a pair containing the topic name and the serialized ROS message.
std::pair<std::string, py::bytes> read_next()
pybind11::tuple read_next()
{
const auto next = reader_.read_next();
rcutils_uint8_array_t rcutils_data = *next->serialized_data.get();
std::string serialized_data(rcutils_data.buffer,
rcutils_data.buffer + rcutils_data.buffer_length);
// TODO(jacobperron): Also consider returning the timestamp, next->time_stamp
return std::make_pair(next->topic_name, py::bytes(serialized_data));
return pybind11::make_tuple(next->topic_name, py::bytes(serialized_data), next->time_stamp);
}

bool has_next()
Expand Down

0 comments on commit deafbf8

Please sign in to comment.