Skip to content

Commit

Permalink
Add deprecation notice for the rosbag2_transport::Player constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
  • Loading branch information
MichaelOrlov committed Dec 10, 2024
1 parent 4f6414e commit 8751ebf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion rosbag2_transport/include/rosbag2_transport/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ class Player : public rclcpp::Node
/// Will call Player(node_name, node_options) constructor with node_name = "rosbag2_player".
/// \param node_options Node options which will be used during construction of the underlying
/// node.
[[deprecated("The rosbag2_transport::Player constructor for the composable player is deprecated."
"Please use rosbag2::Player constructor instead")]]
ROSBAG2_TRANSPORT_PUBLIC
explicit Player(const rclcpp::NodeOptions & node_options);

/// \brief Default constructor and entry point for the composable player.
/// Will construct Player class and initialize play_options, storage_options from node
/// \note Uses from the rosbag2::Player constructor which is registered with ament resource index.
/// \details Will construct Player class and initialize play_options, storage_options from node
/// parameters. At the end will call Player::play() to automatically start playback in a
/// separate thread.
/// \param node_name Name for the underlying node.
Expand Down
7 changes: 6 additions & 1 deletion rosbag2_transport/src/rosbag2_transport/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,12 @@ const rosbag2_transport::PlayOptions & PlayerImpl::get_play_options()
// Player public interface

Player::Player(const rclcpp::NodeOptions & node_options)
: Player("rosbag2_player", node_options) {}
: Player("rosbag2_player", node_options)
{
RCLCPP_WARN(this->get_logger(),
"The rosbag2_transport::Player composable node is deprecated."
" Please use rosbag2::Player instead");
}

Player::Player(const std::string & node_name, const rclcpp::NodeOptions & node_options)
: rclcpp::Node(node_name, node_options)
Expand Down

0 comments on commit 8751ebf

Please sign in to comment.