Skip to content

Commit 3f0da4d

Browse files
authored
Updated deprecated ament_index_cpp API (#18)
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
1 parent 22a1851 commit 3f0da4d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/my_encoder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ int main(int /*argc*/, char ** /*argv*/)
4848
RCLCPP_INFO(logger_, "Using transport: %s", transport.c_str());
4949

5050
const std::string bagged_cloud_topic = "/point_cloud";
51-
const std::string shared_directory = ament_index_cpp::get_package_share_directory(
52-
"point_cloud_transport_tutorial");
53-
const std::string bag_file = shared_directory + "/resources/rosbag2_2023_08_05-16_08_51";
51+
std::filesystem::path shared_directory;
52+
ament_index_cpp::get_package_share_directory("point_cloud_transport_tutorial", shared_directory);
53+
const std::filesystem::path bag_file = shared_directory / "resources" /
54+
"rosbag2_2023_08_05-16_08_51";
5455

5556
// boiler-plate to tell rosbag2 how to read our bag
5657
rosbag2_storage::StorageOptions storage_options;
57-
storage_options.uri = bag_file;
58+
storage_options.uri = bag_file.string();
5859
storage_options.storage_id = "mcap";
5960
rosbag2_cpp::ConverterOptions converter_options;
6061
converter_options.input_serialization_format = "cdr";

0 commit comments

Comments
 (0)