MCPcopy Create free account
hub / github.com/MIT-SPARK/Kimera-VIO-ROS / RosbagDataProvider

Method RosbagDataProvider

src/rosbag-data-source.cpp:15–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace VIO {
14
15RosbagDataProvider::RosbagDataProvider()
16 : RosBaseDataProvider(), rosbag_data_() {
17 ROS_INFO("Starting SparkVIO wrapper for offline");
18
19 std::string rosbag_path;
20 CHECK(nh_private_.getParam("rosbag_path", rosbag_path));
21 std::string left_camera_topic;
22 CHECK(nh_private_.getParam("left_cam_rosbag_topic", left_camera_topic));
23 std::string right_camera_topic;
24 CHECK(nh_private_.getParam("right_cam_rosbag_topic", right_camera_topic));
25 std::string imu_topic;
26 CHECK(nh_private_.getParam("imu_rosbag_topic", imu_topic));
27 std::string ground_truth_odometry_topic;
28 CHECK(nh_private_.getParam("ground_truth_odometry_rosbag_topic",
29 ground_truth_odometry_topic));
30
31 CHECK(!rosbag_path.empty());
32 CHECK(!left_camera_topic.empty());
33 CHECK(!right_camera_topic.empty());
34 CHECK(!imu_topic.empty());
35
36 // Ros publishers specific to rosbag data provider
37 clock_pub_ = nh_.advertise<rosgraph_msgs::Clock>("/clock", 10);
38 /// Advertise to the same topic than what it was writen in the rosbag.
39 gt_odometry_pub_ = nh_.advertise<nav_msgs::Odometry>(
40 ground_truth_odometry_topic, 10);
41
42 // Parse data from rosbag
43 CHECK(parseRosbag(rosbag_path,
44 left_camera_topic,
45 right_camera_topic,
46 imu_topic,
47 ground_truth_odometry_topic,
48 &rosbag_data_));
49
50 if (pipeline_params_.backend_params_->autoInitialize_ == 0) {
51 LOG(WARNING) << "Using initial ground-truth state for initialization.";
52 pipeline_params_.backend_params_->initial_ground_truth_state_ =
53 getGroundTruthVioNavState(0); // Send first gt state.
54 }
55}
56
57RosbagDataProvider::~RosbagDataProvider() {}
58

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected