博主是双目加imu
命令:(一定要记得改成自己的路径哦~)
cd ~/catkin_ws/
source devel/setup.bash
roslaunch vins vins_rviz.launch
source ~/catkin_ws/devel/setup.bash
rosrun vins vins_node ~/catkin_ws/src/vins_fusion/config/realsense_d435i/realsense_stereo_imu_config.yaml
source ~/catkin_ws/devel/setup.bash
rosrun loop_fusion loop_fusion_node ~/catkin_ws/src/vins_fusion/config/realsense_d435i/realsense_stereo_imu_config.yaml
rosbag play ~/catkin_ws/src/vins_fusion/bag/zoulang1.bag
代码修改:
visualization.cpp155行左右
// write result to file
ofstream foutC(VINS_RESULT_PATH, ios::app);
foutC.setf(ios::fixed, ios::floatfield);
foutC.precision(6);
foutC << header.stamp.toSec() << " ";
foutC << estimator.Ps[WINDOW_SIZE].x() << " "
<< estimator.Ps[WINDOW_SIZE].y() << " "
<< estimator.Ps[WINDOW_SIZE].z() << " "
<< tmp_Q.x() << " "
<< tmp_Q.y() << " "
<< tmp_Q.z() << " "
<< tmp_Q.w() << endl;
foutC.close();
Eigen::Vector3d tmp_T = estimator.Ps[WINDOW_SIZE];
printf("time: %f, t: %f %f %f q: %f %f %f %f \n", header.stamp.toSec(), tmp_T.x(), tmp_T.y(), tmp_T.z(),
tmp_Q.w(), tmp_Q.x(), tmp_Q.y(), tmp_Q.z());
pose_graph.cpp182行左右
if (SAVE_LOOP_PATH)
{
ofstream loop_path_file(VINS_RESULT_PATH, ios::app);
loop_path_file.setf(ios::fixed, ios::floatfield);
loop_path_file.precision(6);
loop_path_file << cur_kf->time_stamp << " ";
loop_path_file << P.x() << " "
<< P.y() << " "
<< P.z() << " "
<< Q.x() << " "
<< Q.y() << " "
<< Q.z() << " "
<< Q.w() << endl;
loop_path_file.close();
}
pose_graph.cpp828行左右
if (SAVE_LOOP_PATH)
{
ofstream loop_path_file(VINS_RESULT_PATH, ios::app);
loop_path_file.setf(ios::fixed, ios::floatfield);
loop_path_file.precision(6);
loop_path_file << (*it)->time_stamp << " ";
loop_path_file << P.x() << " "
<< P.y() << " "
<< P.z() << " "
<< Q.x() << " "
<< Q.y() << " "
<< Q.z() << " "
<< Q.w() << endl;
loop_path_file.close();
}
一开始参考的这篇博客,把我害惨了。反正谢谢学长了,大家不要盲目跟着他的改,可以参考我的斟酌一下怎么改
https://blog.csdn/qq_38364548/article/details/123669506?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167980864316800188528976%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=167980864316800188528976&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-2-123669506-null-null.142^v76^insert_down38,201^v4^add_ask,239^v2^insert_chatgpt&utm_term=18.04vins-fusion&spm=1018.2226.3001.4187
更多推荐
ubuntu18.04运行vins-fusion跑通自己的数据集
发布评论