Skip to content

Commit

Permalink
Rename exposed pybind class as Player in anticipation of braeking up …
Browse files Browse the repository at this point in the history
…Rosbag2Transport

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
  • Loading branch information
Emerson Knapp committed Mar 26, 2021
1 parent 8331d7f commit 54e9887
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions ros2bag/ros2bag/verb/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from ros2bag.verb import VerbExtension
from ros2cli.node import NODE_NAME_PREFIX
from rosbag2_py import get_registered_readers
from rosbag2_py import Player
from rosbag2_py import PlayOptions
from rosbag2_py import StorageOptions
from rosbag2_py import Transport
import yaml


Expand Down Expand Up @@ -106,5 +106,5 @@ def main(self, *, args): # noqa: D102
topic_remapping_options=topic_remapping,
)

transport = Transport()
transport.play(storage_options, play_options)
player = Player()
player.play(storage_options, play_options)
4 changes: 2 additions & 2 deletions rosbag2_py/rosbag2_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
Info,
)
from rosbag2_py._transport import (
Player,
PlayOptions,
Transport,
)

__all__ = [
Expand All @@ -58,6 +58,6 @@
'TopicInformation',
'BagMetadata',
'Info',
'Player',
'PlayOptions',
'Transport',
]
11 changes: 5 additions & 6 deletions rosbag2_py/src/rosbag2_py/_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ using Rosbag2Transport = rosbag2_transport::Rosbag2Transport;
namespace rosbag2_py
{

class Transport
class Player
{
public:
Transport() {}

virtual ~Transport() = default;
Player() = default;
virtual ~Player() = default;

void play(
const rosbag2_storage::StorageOptions & storage_options,
Expand Down Expand Up @@ -107,8 +106,8 @@ PYBIND11_MODULE(_transport, m) {
.def_readwrite("topic_remapping_options", &PlayOptions::topic_remapping_options)
;

pybind11::class_<rosbag2_py::Transport>(m, "Transport")
pybind11::class_<rosbag2_py::Player>(m, "Player")
.def(pybind11::init())
.def("play", &rosbag2_py::Transport::play)
.def("play", &rosbag2_py::Player::play)
;
}

0 comments on commit 54e9887

Please sign in to comment.