代码如下(示例):
名为: /usr/local/include/ceres/的错误
在报错的项目的CMakeList里的
set(CMAKE_CXX_FLAGS “-std=c++11”)
改成
set(CMAKE_CXX_STANDARD 14)
本人更改的文件夹有
VINS-Fusion/camera_models
VINS-Fusion/global_fusion
VINS-Fusion/loop_fusion
VINS-Fusion/vins_estimator
代码如下(示例):
error: ‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope
将报错文件上的CV_FONT_HERSHEY_SIMPLEX
参数改为cv::FONT_HERSHEY_SIMPLEX
本人更改的文件有:
VINS-Fusion/loop_fusion/src/keyframe.cpp
VINS-Fusion/loop_fusion/src/pose_graph.cpp
代码如下(示例):
error: ‘CV_GRAY2RGB’ was not declared in this scope
在报错头文件里添加
#include
本人更改的文件有:
VINS-Fusion/vins_estimator/src/featureTracker/feature_tracker.cpp
VINS-Fusion/loop_fusion/src/ThirdParty/DVision/BRIEF.cpp
ofstream foutC(VINS_RESULT_PATH, ios::app);
foutC.setf(ios::fixed, ios::floatfield);
foutC.precision(0);
foutC << header.stamp.toSec() * 1e9 << ",";
foutC.precision(5);
foutC << estimator.Ps[WINDOW_SIZE].x() << ","
<< estimator.Ps[WINDOW_SIZE].y() << ","
<< estimator.Ps[WINDOW_SIZE].z() << ","
<< tmp_Q.w() << ","
<< tmp_Q.x() << ","
<< tmp_Q.y() << ","
<< tmp_Q.z() << ","
<< estimator.Vs[WINDOW_SIZE].x() << ","
<< estimator.Vs[WINDOW_SIZE].y() << ","
<< estimator.Vs[WINDOW_SIZE].z() << "," << endl;
foutC.close();
修改为:
ofstream foutC("/home/seal/VINS-output/VINS/unloop_result.txt", ios::app);
foutC.setf(ios::fixed, ios::floatfield);
foutC.precision(0);
foutC << header.stamp.toSec() << " ";
foutC.precision(5);
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();
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(0);
loop_path_file << cur_kf->time_stamp * 1e9 << ",";
loop_path_file.precision(5);
loop_path_file << P.x() << ","
<< P.y() << ","
<< P.z() << ","
<< Q.w() << ","
<< Q.x() << ","
<< Q.y() << ","
<< Q.z() << ","
<< endl;
loop_path_file.close();
}
修改为:
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(0);
loop_path_file << cur_kf->time_stamp << " ";
loop_path_file.precision(5);
loop_path_file << P.x() << " "
<< P.y() << " "
<< P.z() << " "
<< Q.x() << " "
<< Q.y() << " "
<< Q.z() << " "
<< Q.w() << " "
<< endl;
loop_path_file.close();
}
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(0);
loop_path_file << (*it)->time_stamp * 1e9 << ",";
loop_path_file.precision(5);
loop_path_file << P.x() << ","
<< P.y() << ","
<< P.z() << ","
<< Q.w() << ","
<< Q.x() << ","
<< Q.y() << ","
<< Q.z() << ","
<< endl;
loop_path_file.close();
}
修改为:
if (SAVE_LOOP_PATH)
{
ofstream loop_path_file("/home/seal/VINS-output/VINS/loop-result.txt", ios::app);
loop_path_file.setf(ios::fixed, ios::floatfield);
loop_path_file.precision(0);
loop_path_file << (*it)->time_stamp << " ";
loop_path_file.precision(5);
loop_path_file << P.x() << " "
<< P.y() << " "
<< P.z() << " "
<< Q.x() << " "
<< Q.y() << " "
<< Q.z() << " "
<< Q.w() << endl;
loop_path_file.close();
}
更改名称
VINS_RESULT_PATH = VINS_RESULT_PATH + "/loop_result1.txt";
更改路径
output_path: "/home/seal/VINS-output/VINS/"
output_path: "/home/seal/VINS-output/VINS/"
pose_graph_save_path: "/home/seal/VINS-output/VINS/pose_graph/"
std::ofstream foutC("/home/tony-ws1/output/vio_global.csv", ios::app);//这里还是文件输出位置
foutC.setf(ios::fixed, ios::floatfield);
foutC.precision(0);
foutC << pose_msg->header.stamp.toSec() * 1e9 << ",";
foutC.precision(5);
foutC << global_t.x() << ","
<< global_t.y() << ","
<< global_t.z() << ","
<< global_q.w() << ","
<< global_q.x() << ","
<< global_q.y() << ","
<< global_q.z() << endl;
foutC.close();
修改为:
std::ofstream foutC("/home/seal/VINS-output/VINS/vio-global.txt", ios::app);
foutC.setf(ios::fixed, ios::floatfield);
foutC.precision(0);
foutC << pose_msg->header.stamp.toSec() << " ";
foutC.precision(5);
foutC << global_t.x() << " "
<< global_t.y() << " "
<< global_t.z() << " "
<< global_q.x() << " "
<< global_q.y() << " "
<< global_q.z() << " "
<< global_q.w() << endl;
foutC.close();
cd ~/vins-fusion
catkin_make
source ~/vins-fusion/devel/setup.bash
roslaunch vins vins_rviz.launch
source ~/vins-fusion/devel/setup.bash
rosrun vins vins_node ~/vins-fusion/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml
(optional)
source ~/vins-fusion/devel/setup.bash
rosrun loop_fusion loop_fusion_node ~/vins-fusion/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml
source ~/vins-fusion/devel/setup.bash
rosbag play ~/vins-fusion/output/V1_02.bag
source ~/vins-fusion-my/devel/setup.bash
roslaunch vins vins_rviz.launch
source ~/vins-fusion-my/devel/setup.bash
rosrun vins vins_node ~/vins-fusion-my/src/VINS-Fusion-im/config/euroc/euroc_stereo_imu_config.yaml
(optional)
source ~/vins-fusion-my/devel/setup.bash
rosrun loop_fusion loop_fusion_node ~/vins-fusion-my/src/VINS-Fusion-im/config/euroc/euroc_stereo_imu_config.yaml
source ~/vins-fusion-my/devel/setup.bash
rosbag play ~/vins-fusion/output/V1_02.bag
source ~/vins-fusion-my/devel/setup.bash
roslaunch vins vins_rviz.launch
source ~/vins-fusion-my/devel/setup.bash
rosrun loop_fusion loop_fusion_node ~vins-fusion-my/src/VINS-Fusion-im/config/kitti_odom/kitti_config04-12.yaml
source ~/vins-fusion-my/devel/setup.bash
rosrun vins kitti_odom_test src/VINS-Fusion-im/config/kitti_odom/kitti_config04-12.yaml /home/seal/vins-fusion/output/KITTI-dataset/sequences/09
evo_traj euroc data.csv --save_as_tum
evo_ape tum result.csv ~/vins-fusion/date/evo/data.tum -va --plot --plot_mode xyz
evo_rpe tum result.csv ~/vins-fusion/date/evo/data.tum -r full -va --plot --plot_mode xyz
1.运行rviz
roslaunch vins vins_rviz.launch
2.数据融合代码
rosrun vins vins_node ~/vins-fusion/src/VINS-Fusion/config/realsense_d435i/realsense_stereo_imu_config.yaml
3.回环(可选)
rosrun loop_fusion loop_fusion_node ~/vins-fusion/src/VINS-Fusion/config/realsense_d435i/realsense_stereo_imu_config.yaml
4.播放rosbag包
rosbag play ~/vins-fusion/output/date.bag