KumarRobotics / msckf_vio

Robust Stereo Visual Inertial Odometry for Fast Autonomous Flight
Other
1.66k stars 593 forks source link

How can I use this project without ROS? #96

Closed SparkyTD closed 3 years ago

SparkyTD commented 3 years ago

I would like to use msckf_vio in my own project because based on the description it fits my needs perfectly.

I am developing a driver for a VR device that will be connected to a desktop computer. The device has a pair of front-facing stereo IR cameras and an IMU. I can poll timestamped frames from the cameras (one cv::Mat per camera) at roughly 80 FPS, and I can also poll the accelerometer/gyro data.

Since this is going to be a standalone desktop application and not an autonomous robot, there is no need for any of the ROS interface, I only need to core of the project that does the tracking. I have zero experience/knowledge of ROS, and I don't know how to separate this project from it.

What parts of this project should I use to directly access the tracking system with cv::Mats and raw IMU float data and extract the calculated 6DOF tracking information?

To simplify, I would like something like this (mostly pseudocode):

MsckfVio vio(calibration_file, settings, etc..);
while(run_main_loop) {
    cv::Mat left_eye, right_eye = pollSensorImages();
    float[3] gyro, accel = pollImuData();

    vio.feed(left_eye, right_eye, gyro, accel);

    if(vio.tracking_data_available) {
        float[3] position, rotation = vio.calculate();
        // ...
    }
}

I could write these interfaces, but this project has a huge codebase and I don't know where to get started

ke-sun commented 3 years ago

I am afraid it is not easy to deprive ROS from the project. The code depends on ROS heavily on the subscribing, publishing, and parameter loading mechanism.