diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8496e5c..22fcb91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()
set(dependencies
+ ament_index_cpp
brain_box_msgs
builtin_interfaces
camera_info_manager
@@ -143,6 +144,9 @@ install(DIRECTORY include/
install(DIRECTORY launch/
DESTINATION share/${PROJECT_NAME}
)
+install(DIRECTORY config
+ DESTINATION share/${PROJECT_NAME}
+ )
install(
TARGETS am_utils
EXPORT am_utilsTargets
diff --git a/config/mcap_writer_options.yaml b/config/mcap_writer_options.yaml
new file mode 100644
index 0000000..8a4cf74
--- /dev/null
+++ b/config/mcap_writer_options.yaml
@@ -0,0 +1,4 @@
+compression: "Zstd"
+compressionLevel: "Fastest"
+chunkSize: 786432
+noChunkCRC: true
\ No newline at end of file
diff --git a/package.xml b/package.xml
index 9cda0cf..32826e9 100644
--- a/package.xml
+++ b/package.xml
@@ -28,6 +28,7 @@
rosbag2
rosbag2_cpp
rosbag2_storage
+ rosbag2_storage_mcap
sensor_msgs
std_msgs
stereo_msgs
@@ -36,6 +37,7 @@
tf2_ros
visualization_msgs
cv_bridge
+ ament_index_cpp
ament_lint_auto
ament_lint_common
diff --git a/src/vb_util_lib/bag_logger.cpp b/src/vb_util_lib/bag_logger.cpp
index 08c1c44..8bae8fa 100644
--- a/src/vb_util_lib/bag_logger.cpp
+++ b/src/vb_util_lib/bag_logger.cpp
@@ -173,6 +173,8 @@ void BagLogger::startLogging(std::string prefix, unsigned log_level)
rosbag2_storage::StorageOptions storage_options;
storage_options.uri = /*std::string("sqlite:///") +*/ file_name_;
+ storage_options.storage_id = "mcap";
+ storage_options.storage_config_uri = ament_index_cpp::get_package_share_directory("am_utils") + "/config/mcap_writer_options.yaml";
writer_ = std::make_unique();
writer_->open(storage_options);
printf("Opening bag file %s\n", file_name_.c_str());