Git Product home page Git Product logo

cube_slam's Introduction

Cube SLAM

This code contains two mode:

  1. object SLAM integrated with ORB SLAM. See orb_object_slam Online SLAM with ros bag input. It reads the offline detected 3D object.
  2. Basic implementation for Cube only SLAM. See object_slam Given RGB and 2D object detection, the algorithm detects 3D cuboids from each frame then formulate an object SLAM to optimize both camera pose and cuboid poses. is main package. detect_3d_cuboid is the C++ version of single image cuboid detection, corresponding to a matlab version.

Authors: Shichao Yang

Related Paper:

  • CubeSLAM: Monocular 3D Object SLAM, IEEE Transactions on Robotics 2019, S. Yang, S. Scherer PDF

If you use the code in your research work, please cite the above paper. Feel free to contact the authors if you have any further questions.

Installation

Prerequisites

This code contains several ros packages. We test it in ROS indigo/kinetic, Ubuntu 14.04/16.04, Opencv 2/3. Create or use existing a ros workspace.

mkdir -p ~/cubeslam_ws/src
cd ~/cubeslam_ws/src
catkin_init_workspace
git clone [email protected]:shichaoy/cube_slam.git
cd cube_slam

Compile dependency g2o

sh install_dependenices.sh

Compile

cd ~/cubeslam_ws
catkin_make -j4

Running

source devel/setup.bash
roslaunch object_slam object_slam_example.launch

You will see results in Rviz. Default rviz file is for ros indigo. A kinetic version is also provided.

To run orb-object SLAM in folder orb_object_slam, download data. See correct path in mono.launch, then run following in two terminal:

roslaunch orb_object_slam mono.launch
rosbag play mono.bag --clock -r 0.5

To run dynamic orb-object SLAM mentioned in the paper, download data. Similar to above, set correct path in mono_dynamic.launch, then run the launch file with bag file.

If compiling problems met, please refer to ORB_SLAM.

Notes

  1. For the online orb object SLAM, we simply read the offline detected 3D object txt in each image. Many other deep learning based 3D detection can also be used similarly especially in KITTI data.

  2. In the launch file (object_slam_example.launch), if online_detect_mode=false, it requires the matlab saved cuboid images, cuboid pose txts and camera pose txts. if true, it reads the 2D object bounding box txt then online detects 3D cuboids poses using C++.

  3. object_slam/data/ contains all the preprocessing data. depth_imgs/ is just for visualization. pred_3d_obj_overview/ is the offline matlab cuboid detection images. detect_cuboids_saved.txt is the offline cuboid poses in local ground frame, in the format "3D position, 1D yaw, 3D scale, score". pop_cam_poses_saved.txt is the camera poses to generate offline cuboids (camera x/y/yaw = 0, truth camera roll/pitch/height) truth_cam_poses.txt is mainly used for visulization and comparison.

    filter_2d_obj_txts/ is the 2D object bounding box txt. We use Yolo to detect 2D objects. Other similar methods can also be used. preprocessing/2D_object_detect is our prediction code to save images and txts. Sometimes there might be overlapping box of the same object instance. We need to filter and clean some detections. See the filter_match_2d_boxes.m in our matlab detection package.

cube_slam's People

Contributors

shichaoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cube_slam's Issues

detect-3d-cubiod

Thanking for your work!
When I use a picture in my own dataset to generate a 3D box, how to set the camera posture ?

cuboid_box_size, heading_angle, center for the detected cuboid.

Hye shichao,
I am using detect_3d_cuboid (C++ version) for single image cuboid detection. I wish to save the cuboid_box_size, heading_angle and center for the detected cuboid in order to compute 3D IoU for the detected object in the test image. Can you please suggest the changes to be made in the code?

How to run the mono_dynamic.launch successfully?

We want to learn how you deal with dynamic objects by reading related codes in your great work. But now we can not run mono_dynamic.launch successfully. Could you give us more instructions and provide some data like seq07(including the txt files) to run it successfully? Thanks!~

About the detected pose of the 3D object

Hi shichaoy, thanks for your code, after a period of exploration, I have some questions to ask.

  1. I added your code to ORB-SLAM2. Drawing a cue(8 2D points) on a 2D image has achieved good results, but the calculated pose of the cube is wrong.
    As shown in the figure below, in the pangolin drawing window, the red point (bigger) is the position of the center point of the object(all frame) output by your code.
    I think the camera pose I entered should be correct. The first frame I take transToWorld as transToWorld_initial = [1 0 0 0; 0 0 1 0; 0 -1 0 1.7; 0 0 0 1], subsequent camera poses are taken as transToWorld = transToWorld_initial * (mCurrentFrame.mTcw)^(-1), where mCurrentFrame.mTcw is from ORB-SLAM2.
    In addition, when I draw the position of the object I use detected_cube->pos (and cube_ground_value.pose)
    I want to know where the problem is?

190731kitti3issue

  1. Although the effect of drawing cube on 2D image is not bad, there is still a big gap between it and what you showed in video. Is there any place where I need to optimize?
    Thank you again and look forward to your answer.

process has died when run orb_object_slam

Hello, thanks for your great job and open source sharing.
I try the command ‘roslaunch orb_object_slam mono_dynamic.launch’, but there is a problem that '[ros_mono-3] process has died [pid 10101, exit code -11...'
I don't know why. Look forward to your reply. Thank you!
1
2

Not updating scale

Hi

I am using your orb_slam with scaling feature of the map. I use a camera which has almost constant height of 1m. I want the map to get scaled once at first and not updated later. Is this possible? Could you please tell me which parts to change so it only gets scaled once at the start?

Thank You

catkin_make error.

[ 40%] Building CXX object cube_slam/line_lbd/CMakeFiles/linelbd_detect_node.dir/src/detect_lines.cpp.o
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp: In function ‘void fuse_normalize_scores_v2(const VectorXd&, const VectorXd&, Eigen::VectorXd&, std::vector&, double, bool)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp:503:14: error: ‘iota’ is not a member of ‘std’
std::iota(dist_sorted_inds.begin(), dist_sorted_inds.end(), 0);
^~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp:503:14: note: suggested alternative: ‘not2’
std::iota(dist_sorted_inds.begin(), dist_sorted_inds.end(), 0);
^~~~
not2
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp:529:14: error: ‘iota’ is not a member of ‘std’
std::iota(final_keep_inds.begin(), final_keep_inds.end(), 0);
^~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp:529:14: note: suggested alternative: ‘not2’
std::iota(final_keep_inds.begin(), final_keep_inds.end(), 0);
^~~~
not2
In file included from /home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:1:0:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:47:101: error: ‘std::vector’ has not been declared
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:47:107: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:49:102: error: ‘std::vector’ has not been declared
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:49:108: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:52:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:52:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:53:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:53:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:60:30: error: ‘vector’ in namespace ‘std’ does not name a template type
void print_vector(const std::vector &vec);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:60:36: error: expected ‘,’ or ‘...’ before ‘<’ token
void print_vector(const std::vector &vec);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:64:51: error: ‘std::vector’ has not been declared
void linespace(T starting, T ending, T step, std::vector &res);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:64:57: error: expected ‘,’ or ‘...’ before ‘<’ token
void linespace(T starting, T ending, T step, std::vector &res);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:236:101: error: ‘std::vector’ has not been declared
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:236:107: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘bool read_obj_detection_txt(std::__cxx11::string, Eigen::MatrixXd&, int)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:243:5: error: ‘all_strings’ was not declared in this scope
all_strings.clear();
^~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:274:102: error: ‘std::vector’ has not been declared
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:274:108: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘bool read_obj_detection2_txt(std::__cxx11::string, Eigen::MatrixXd&, int)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:281:5: error: ‘all_strings’ was not declared in this scope
all_strings.clear();
^~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:316:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k)
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:316:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k)
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void sort_indexes(const VectorXd&, int)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:318:23: error: ‘idx’ was not declared in this scope
std::partial_sort(idx.begin(), idx.begin() + top_k, idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:318:23: note: suggested alternative: ‘index’
std::partial_sort(idx.begin(), idx.begin() + top_k, idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^~~
index
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:318:50: error: ‘top_k’ was not declared in this scope
std::partial_sort(idx.begin(), idx.begin() + top_k, idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:321:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx)
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:321:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx)
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void sort_indexes(const VectorXd&, int)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:321:6: error: redefinition of ‘void sort_indexes(const VectorXd&, int)’
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx)
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:316:6: note: ‘void sort_indexes(const VectorXd&, int)’ previously defined here
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k)
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:10: error: ‘idx’ was not declared in this scope
sort(idx.begin(), idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:10: note: suggested alternative: ‘index’
sort(idx.begin(), idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^~~
index
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:5: error: ‘sort’ was not declared in this scope
sort(idx.begin(), idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:5: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/eigen3/Eigen/Core:269,
from /home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:4,
from /home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:4856:5: note: ‘std::sort’
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:339:30: error: ‘vector’ in namespace ‘std’ does not name a template type
void print_vector(const std::vector &vec)
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:339:36: error: expected ‘,’ or ‘...’ before ‘<’ token
void print_vector(const std::vector &vec)
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void print_vector(int)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:341:28: error: ‘vec’ was not declared in this scope
for (size_t i = 0; i < vec.size(); i++)
^~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:341:28: note: suggested alternative: ‘getc’
for (size_t i = 0; i < vec.size(); i++)
^~~
getc
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:345:39: error: ‘vector’ in namespace ‘std’ does not name a template type
template void print_vector(const std::vector &);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:345:45: error: expected ‘,’ or ‘...’ before ‘<’ token
template void print_vector(const std::vector &);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:345:15: error: template-id ‘print_vector<>’ for ‘void print_vector(int)’ does not match any template declaration
template void print_vector(const std::vector &);
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:339:6: note: candidate is: template void print_vector(int)
void print_vector(const std::vector &vec)
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:346:39: error: ‘vector’ in namespace ‘std’ does not name a template type
template void print_vector(const std::vector &);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:346:45: error: expected ‘,’ or ‘...’ before ‘<’ token
template void print_vector(const std::vector &);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:346:15: error: template-id ‘print_vector<>’ for ‘void print_vector(int)’ does not match any template declaration
template void print_vector(const std::vector &);
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:339:6: note: candidate is: template void print_vector(int)
void print_vector(const std::vector &vec)
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:347:39: error: ‘vector’ in namespace ‘std’ does not name a template type
template void print_vector(const std::vector &);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:347:45: error: expected ‘,’ or ‘...’ before ‘<’ token
template void print_vector(const std::vector &);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:347:15: error: template-id ‘print_vector<>’ for ‘void print_vector(int)’ does not match any template declaration
template void print_vector(const std::vector &);
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:339:6: note: candidate is: template void print_vector(int)
void print_vector(const std::vector &vec)
^~~~~~~~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:350:51: error: ‘std::vector’ has not been declared
void linespace(T starting, T ending, T step, std::vector &res)
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:350:57: error: expected ‘,’ or ‘...’ before ‘<’ token
void linespace(T starting, T ending, T step, std::vector &res)
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void linespace(T, T, T, int)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:352:5: error: ‘res’ was not declared in this scope
res.reserve((ending - starting) / step + 2);
^~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:364:45: error: ‘std::vector’ has not been declared
template void linespace(int, int, int, std::vector &);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:364:51: error: expected ‘,’ or ‘...’ before ‘<’ token
template void linespace(int, int, int, std::vector &);
^
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:365:54: error: ‘std::vector’ has not been declared
template void linespace(double, double, double, std::vector &);
^~~~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:365:60: error: expected ‘,’ or ‘...’ before ‘<’ token
template void linespace(double, double, double, std::vector &);
^
cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/build.make:88: recipe for target 'cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/src/matrix_utils.cpp.o' failed
make[2]: *** [cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/src/matrix_utils.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/box_proposal_detail.cpp: In member function ‘void detect_3d_cuboid::detect_cuboid(const cv::Mat&, const Matrix4d&, const MatrixXd&, Eigen::MatrixXd, std::vector<std::vector<cuboid*> >&)’:
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/box_proposal_detail.cpp:531:3: error: ‘iota’ was not declared in this scope
iota(sort_idx_small.begin(), sort_idx_small.end(), 0);
^~~~
/home/a-y-x/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/box_proposal_detail.cpp:531:3: note: suggested alternative: ‘int’
iota(sort_idx_small.begin(), sort_idx_small.end(), 0);
^~~~
int
[ 42%] Linking CXX executable /home/a-y-x/cubeslam_ws/devel/lib/line_lbd/linelbd_detect_node
[ 42%] Built target linelbd_detect_node
cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/build.make:62: recipe for target 'cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/src/box_proposal_detail.cpp.o' failed
make[2]: *** [cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/src/box_proposal_detail.cpp.o] Error 1
cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/build.make:75: recipe for target 'cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/src/object_3d_util.cpp.o' failed
make[2]: *** [cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/src/object_3d_util.cpp.o] Error 1
CMakeFiles/Makefile2:1531: recipe for target 'cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/all' failed
make[1]: *** [cube_slam/detect_3d_cuboid/CMakeFiles/detect_3d_cuboid.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Test on Own The Images

Hello I have some question related to the cube_slam
1.In your example of object_slam_example.launch, you have detect_cuboids_saved.txt, pop_cam_poses_saved.txt, and truth_cam_poses.txt. May I know how you generate this file? Because I would like to test it with my own images
Thank you

Program running error

An error is reported when "Found one bad object !!!!!!!!!!!!!!!!!!!!!!!!! " occurs

Detect cuboid for pKF id: 252  total id: 826  numObj: 7
begin to associate cuboids #candidate:   0   #landmarks   3   #localKFs   12
Found one bad object !!!!!!!!!!!!!!!!!!!!!!!!!  47  2  0
[ros_mono-3] process has died [pid 9501, exit code -11, cmd /home/wang/Total/cubeslam_ws/devel/lib/orb_object_slam/ros_mono /home/wang/Total/cubeslam_ws/src/cube_slam/orb_object_slam/Vocabulary/ORBvoc.bin /home/wang/Total/cubeslam_ws/src/cube_slam/orb_object_slam/Examples/Monocular/KITTI04-12_me.yaml /camera/image_raw:=/kitti/left/image_raw __name:=ros_mono __log:=/home/wang/.ros/log/41750dc4-ead5-11ec-a0eb-25bfe08d23ac/ros_mono-3.log].
log file: /home/wang/.ros/log/41750dc4-ead5-11ec-a0eb-25bfe08d23ac/ros_mono-3*.log
[ WARN] [1655096339.650441103]: The input topic '/mono/image_raw' is not yet advertised
[ WARN] [1655096339.650508607]: The input topic '/mono/camera_info' is not yet `advertised

Dynamic SLAM

Hello, shichao, thanks for your great job and open source sharing.
In 'mono dynamic.launch' file, I find that the values of "‘use_dynamic_klt_features’, 'triangulate_dynamic_pts', 'ba_dyna_pt_obj_cam' and 'mono_allframe_obj_depth_init' are all set to 'false', and thus the optimization process does not consider the dynamic point observation. According to your paper, this term is involved in the optimization. I try to set all the above parameters to be 'true', and the result is poor (especially the trajectories of the dynamic objects). So I want to know what is possible reason? In addition, what is the meaning of the parameter 'mono_allframe_obj_depth_init'? Look forward to your reply. Thank you!

Run on my own sequence

Hi,
Your work looks amazing and I'd like to try it for one project I'm working on.
Unluckily, I can't figure out how to run your work on one of my sequences.
I managed to compile everything with ROS and also to run the object_slam example.
Now, I have a sequence of images from a driving scene (with dynamic objects) and I'd like to obtain SLAM and 3D object detection results. I also have camera intrinsincs.
Would you be so kind to provide instructions to run cube_slam on a sequence of images?
Thanks in advance for your support!

how to triangulate a dynamic point?

In your paper CubeSLAM: Monocular 3D Object SLAM, you propose to triangulate a dynamic point:
image
In real initialization case, how do you get Delta T?

Questions on 3d cuboid detection.

Hi shichao! Thanks to your impressive work. I learnt a lot from your paper.
However, I have a problem when I try to run detect_3d_cuboid module with ICL_NUIM dataset which your paper mentioned.

I used the first image of "Living Room 'lr kt2'" to test detect_3d_cuboid module.
here is my input:

  • se3quat: [0 0 -2.25 0 0 0 1] that is the first line data of trajectory ground truth ICL_NUIM provide.
  • camera calibration matrix K provided by them.
481.20, 0,       319.50
0,      -480.00, 239.50
0,	    0,	     1
  • 2d detection info .I use YOLOv3 to run 2d detection.
sofa	191	274	441	194	1.00
  • my configuration
detect_cuboid_obj.whether_plot_detail_images = true;
detect_cuboid_obj.whether_plot_final_images = true;
detect_cuboid_obj.print_details = true; 
detect_cuboid_obj.set_calibration(Kalib);
detect_cuboid_obj.whether_sample_bbox_height = false;
detect_cuboid_obj.whether_sample_cam_roll_pitch = false;
detect_cuboid_obj.nominal_skew_ratio = 2;
detect_cuboid_obj.whether_save_final_images = false;

then I failed to detect any cuboids and got output like this

Configuration fails at corner 2, outside segment
Configuration fails at corner 2, outside segment
...//a lot of same tips like it

detail image:
details

Then here are my questions (seems stupid I guess, but it is kind of hard for me a beginner XD

  • I noticed that coordinate system in CubeSLAM matters a lot when running cuboid detection and I think it is what I should modify.
    坐标系统

But I have no idea how to solve this problem in detail.For example,how to determine the height wrt world ground coordinate ?
BTW I used another format ground truth poses " R|t" they provide to test again. It dosen't work either.

//Rotation Matrix| t
-0.999762 0.000000 -0.021799 0.790932
0.000000 1.000000 0.000000 1.300000
0.021799 0.000000 -0.999762 1.462270
//transform to TUM format
0.790932    1.3    1.46227          0    0.99994          0 -0.0109001
  • I am not sure f_y in K matrix should be negative. In our case,I think using positive f_y could make projections work properly.

So have you had the same problems when you run cubeSLAM with ICL_NUIM dataset and how did you make it work at that time?

Hope for your reply. Thanks again :)

sudden change in cuboid angle

Hi shichaoy

Thank You for this great package that you have developed. I have tried to get cuboids from some chairs in my own dataset and sometimes I see sudden changes or even wrong calculations in the results. Is this natural? or there is a problem that I need to fix.
I attached a video that you can observe my results.

Thank You

video_2020-11-04_15-44-18.mp4.zip

error while launching orb_object_slam

Hi

I am trying to use "roslaunch orb_object_slam mono.launch" command to use orb_object_slam. I have changed the address in mono.launch and I have attached it here. When I use the command I get following error:

mohammad@mohammad:~/cubeslamws$ roslaunch orb_object_slam mono.launch 
... logging to /home/mohammad/.ros/log/fd8e5456-17bf-11eb-8dec-5c80b69e8dce/roslaunch-mohammad-31764.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://mohammad:45929/

SUMMARY
========

PARAMETERS
 * /associate_point_with_object: True
 * /ba_dyna_obj_cam: True
 * /ba_dyna_obj_velo: True
 * /ba_dyna_pt_obj_cam: True
 * /base_data_folder: /home/shichao/ysc...
 * /build_worldframe_on_ground: True
 * /bundle_object_opti: True
 * /camera_object_BA_weight: 2.0
 * /draw_map_truth_paths: True
 * /draw_nonlocal_mappoint: True
 * /enable_ground_height_scale: True
 * /enable_loop_closing: False
 * /enable_viewer: True
 * /enable_viewimage: True
 * /enable_viewmap: True
 * /ground_dist_ratio: 0.08
 * /ground_everyKFs: 10
 * /ground_inlier_pts: 20
 * /ground_roi_lower: 3.0
 * /ground_roi_middle: 3.0
 * /init_qw: 0.7071
 * /init_qx: -0.7071
 * /init_qy: 0
 * /init_qz: 0
 * /init_x: 0
 * /init_y: 0
 * /init_z: 1.7
 * /mono_allframe_Obj_depth_init: False
 * /mono_firstframe_Obj_depth_init: False
 * /mono_firstframe_truth_depth_init: False
 * /obj_det_2d_thre: 0.5
 * /object_velocity_BA_weight: 0.5
 * /parallel_mapping: True
 * /remove_dynamic_features: False
 * /rosdistro: kinetic
 * /rosversion: 1.12.16
 * /scene_name: kitti
 * /triangulate_dynamic_pts: False
 * /use_dynamic_klt_features: False
 * /use_truth_trackid: False
 * /whether_detect_object: True
 * /whether_dynamic_object: False
 * /whether_read_offline_cuboidtxt: True
 * /whether_save_final_optimized_cuboids: False
 * /whether_save_online_detected_cuboids: False

NODES
  /mono/
    image_proc (image_proc/image_proc)
  /
    ros_mono (orb_object_slam/ros_mono)

auto-starting new master
process[master]: started with pid [31776]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to fd8e5456-17bf-11eb-8dec-5c80b69e8dce
process[rosout-1]: started with pid [31789]
started core service [/rosout]
process[mono/image_proc-2]: started with pid [31806]
process[ros_mono-3]: started with pid [31807]
Base_data_folder:  /home/shichao/ysc_space/dataset/processed_third/slam/kitti/kitti_odom/seq_07
[ WARN] [1603739893.320635552]: Turn off global loop closing!!
Input sensor was set to: Monocular

Loading ORB Vocabulary. This could take a while...
[ros_mono-3] process has died [pid 31807, exit code -11, cmd /home/mohammad/catkin_ws/devel/lib/orb_object_slam/ros_mono /home/mohammad/catkin_ws/src/cube_slam/orb_object_slam/Vocabulary/ORBvoc.bin /home/mohammad/catkin_ws/src/cube_slam/orb_object_slam/Examples/Monocular/KITTI04-12_me.yaml /camera/image_raw:=/kitti/left/image_raw __name:=ros_mono __log:=/home/mohammad/.ros/log/fd8e5456-17bf-11eb-8dec-5c80b69e8dce/ros_mono-3.log].
log file: /home/mohammad/.ros/log/fd8e5456-17bf-11eb-8dec-5c80b69e8dce/ros_mono-3*.log

I don't know why am I getting this error. Also the Base_data_folder is still wrong. Although I have changed it. Also, when I go to the cube_slam/orb_object_slam/launch folder and run the mono.launch file, the address gets corrected, but I still get the same errors. Do you know what might be the problem here?

mono.launch.zip

pop_pose_to_ground is not initialized when using online cuboid proposal method

While reading through the code in Tracking.cc
In function void Tracking::DetectCuboid(KeyFrame *pKF)
In the code block where using online cuboid proposal method, between line 1615 to 1621

cv::Mat frame_pose_to_init = pKF->GetPoseInverse();
cv::Mat frame_pose_to_ground = frame_pose_to_init;
if(!build_worldframe_on_ground) frame_pose_to_ground = InitToGround * frame_pose_to_ground;
Eigen::Matrix4f cam_transToGround = Converter::toMatrix4f(pop_pose_to_ground);    // ??? pop_pose_to_ground is not given any value, I assume that the frame_pose_to_ground should be assigned to pop_pose_to_ground, am I right?
detect_cuboid_obj->detect_cuboid(pKF->raw_img,cam_transToGround.cast<double>(), ....)

SO, is the pop_pose_to_ground intentionally left empty here?
Thanks for all your help.

There is an erorr when i roslaunch orb_object_slam mono.launch

Hello shichaoy,

Thanks for your sharing,

There is an erorr when i roslaunch orb_object_slam mono.launch

[ros_mono-3] process has died [pid 6899, exit code -11, cmd /home/sharine/cubeslam_ws/devel/lib/orb_object_slam/ros_mono /home/sharine/cubeslam_ws/src/cube_slam/orb_object_slam/Vocabulary/ORBvoc.bin /home/sharine/cubeslam_ws/src/cube_slam/orb_object_slam/Examples/Monocular/KITTI04-12_me.yaml /camera/image_raw:=/kitti/left/image_raw __name:=ros_mono __log:=/home/sharine/.ros/log/8b3d30fe-efc8-11e9-a14c-9cb6d0e0ac2d/ros_mono-3.log].
log file: /home/sharine/.ros/log/8b3d30fe-efc8-11e9-a14c-9cb6d0e0ac2d/ros_mono-3*.log

Crashed

I am running with my own data. It worked well except that it crashed sometimes at frame 2000, sometime at frame 3000, sometime frame 4000. For example, the last crashed was because of the following. How can I fix the crash?

Created new keyframe! 330 total ID 4737
ERROR!!! Cannot read txt file C:\gcong\hy\VO\video\orb_hy_dense_half/edge_detection/LSD/004737_edge.txt
created local object num 1
Detect cuboid for pKF id: 330 total id: 4737 numObj: 1
begin to associate cuboids #candidate: 0 #landmarks 2 #localKFs 14
Cloud size 1
Potential plane pt size 1 11
[pcl::SampleConsensusModel::getSamples] Can not select 0 unique points out of 1!
[pcl::RandomSampleConsensus::computeModel] No samples could be selected!
[pcl::RandomSampleConsensus::computeModel] RANSAC found no model.
[pcl::SACSegmentation::segment] Error segmenting the model! No solution found.

something wrong when launch the object_slam_example

`... logging to /home/zwh/.ros/log/0c768bf8-c059-11ec-a2b4-d46a6a8b2053/roslaunch-zwh-Inspiron-7472-25422.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://zwh-Inspiron-7472:36499/

SUMMARY

PARAMETERS

  • /base_folder: /home/zwh/catkin_...
  • /online_detect_mode: True
  • /rosdistro: melodic
  • /rosversion: 1.14.12
  • /save_results_to_txt: False

NODES
/
object_slam_node (object_slam/object_slam_node)
rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [25432]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 0c768bf8-c059-11ec-a2b4-d46a6a8b2053
process[rosout-1]: started with pid [25443]
started core service [/rosout]
process[object_slam_node-2]: started with pid [25446]
process[rviz-3]: started with pid [25447]

base_folder /home/zwh/catkin_ws/src/cube_slam/object_slam/data/
[ WARN] [1650424933.163888663]: Online detect object mode !!

double free or corruption (out)
[object_slam_node-2] process has died [pid 25446, exit code -6, cmd /home/zwh/catkin_ws/devel/lib/object_slam/object_slam_node __name:=object_slam_node __log:=/home/zwh/.ros/log/0c768bf8-c059-11ec-a2b4-d46a6a8b2053/object_slam_node-2.log].
log file: /home/zwh/.ros/log/0c768bf8-c059-11ec-a2b4-d46a6a8b2053/object_slam_node-2*.log
`

Could you please tell me how to solve it?

liborb_object_slam.so (not found)

During the make step, around 94%, I got this error:

No rule to make target '/home/ros/cubeslam_ws/src/cube_slam/orb_object_slam/Thirdparty/DBoW2/lib/libDBoW2.so', needed by '/home/ros/cubeslam_ws/devel/lib/liborb_object_slam.so'. Stop.

I've went into the folder "cubeslam_ws/devel/lib/", and "liborb_object_slam.so" is missing.

Im on Ubuntu16.04
image

run orb_object_slam error

when I run 'orb-object-slam', the error --terminate called after throwing an instance of 'std::bad_alloc' what():std::bad_alloc--is occurred.
How can I solve this problem or has anyone have the same problem as me?

Matlab YOLO2 sample output

What?
Can you please provide a sample file or even a meta description of a 2D object bounding box txt file?

Why?
I would like to run the mono example online using my own 2D object bounding box txt files.
But as I do not have Matlab I can not figure out what format a file /mats/filter_match_2d_boxes_txts/<frame_index_c>__yolo2_0.2.txt should have.

Some problems were encountered while running the example

I have run ORB-SLAM2 and the first example on unbuntu16, but when I run orb_object_slam, the following problems are always prompted. And "ros_mono.log" doesn't exist in the folder, after trying some methods, I still can't run.
Uploading 屏幕截图 2022-01-19 222221.png…

KeyFrame stuck together

Hi, @shichaoy thanks for your work.
The size of the objects turned to be normal after the issue: #32
But I am still not sure why sometimes the size of the map turns to be smaller, I am wonder is this the problem of all monoSLAM or some parameter setting of cubeSLAM?

I gave an example result on my own dataset, and the order of these images are from 1 to 4. As the images showed, the size get smaller and smaller while sometimes it can be corrected by LOOPCLOSing. But without LoopClosing(as shown in image 4), the keyFrames just stuck at a same place. Are there any suggestion for this situation?

Please check the frames at : https://github.com/ns15417/cube_slam/tree/func/DebugMySequence/Result

Thanks for your work and time :)

object_slam run error

when I run roslaunch object_slam object_slam_example.launch, the error I encountered is as follows:
[object_slam_node-1] process has died [pid 18032, exit code -11, cmd /home/wzb/cubeslam_ws/devel/lib/object_slam/object_slam_node __name:=object_slam_node __log:=/home/wzb/.ros/log/b7f52834-a492-11ea-8ac7-7cb27d1a2d0e/object_slam_node-1.log].
log file: /home/wzb/.ros/log/b7f52834-a492-11ea-8ac7-7cb27d1a2d0e/object_slam_node-1*.log

And I find the code exit at cube_slam/detect_3d_cuboid/src/object_3d_util.cpp line 304:
merge_lines_out = all_lines;

And when I use gdb to backtrace, the displayed content is as follows:
Thread 1 "object_slam_nod" received signal SIGSEGV, Segmentation fault.
0x00000000004444a0 in void Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::assign_op >(Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::internal::assign_op const&) ()
(gdb) bt
#0 0x00000000004444a0 in void Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::assign_op >(Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::internal::assign_op const&) ()
#1 0x00007ffff45cd21c in merge_break_lines(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&, double, double, double)
() from /home/wzb/cubeslam_ws/devel/lib/libdetect_3d_cuboid.so
#2 0x00007ffff45c13b1 in detect_3d_cuboid::detect_cuboid(cv::Mat const&, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::vector<std::vector<cuboid*, std::allocator<cuboid*> >, std::allocator<std::vector<cuboid*, std::allocator<cuboid*> > > >&) ()
from /home/wzb/cubeslam_ws/devel/lib/libdetect_3d_cuboid.so
#3 0x000000000042f7f4 in incremental_build_graph(Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&) ()
#4 0x0000000000421712 in main ()

Could you please help me to solve the problem? Thank you very much!

matlab_cuboid_detect: frame_full_infos.Rot for ICL-NUIM dataset

Copy from shichaoy/matlab_cuboid_detect#2 (comment)

Thanks a lot for your work.
In the process of running "detect_cuboid.m" on the ICL_NUIM dataset, I encountered this problem:
The camera Rot need be input into "frame_full_infos.mat", so I get the camera pose from the groudtruth.
However ,the y-axis of ICLNUIM world frame is vertically upward. Detect_cuboid.m ask the z-axis of the world coordinate system is upward.
So I input [1,0,0;0,0,-1;0,1,0]*R as the frame_full_infos.Rot, where R is got from the groudtruth.
But, there are still errors on generating VPs. I think frame_full_infos.Rot is still wrong. Would you be so kind to provide some instructions?
Could you tell how to input the frame_full_infos.Rot when you run the ICL_NUIM dataset.
Thanks in advance for your support!

Weights for different costs in the optimization

Hi, thanks for the code! It says in the paper From our experiments, object-camera and point-camera measurements have similar weights, I am wondering where are those weights? I found this in the code, is this the weight?

		Vector9d inv_sigma;inv_sigma<<1,1,1,1,1,1,1,1,1;
		inv_sigma = inv_sigma*2.0*cube_landmark_meas->meas_quality;
		Matrix9d info = inv_sigma.cwiseProduct(inv_sigma).asDiagonal();

Question on update SE3Quat

Could you explain why
res.pose = this->pose *SE3Quat::exp(update.head<6>()); // NOTE bug before. switch position
rather than
res.pose = SE3Quat::exp(update.head<6>())*this->pose ;
which is the same as the update function in class VertexSE3Expmap ?
I know that VertexSE3Expmap is world to camera, however I still could not understand why we can simply switch the position.
Thank you !

What Does InitToGround mean??

Hi, I am so happy i run orb_object_slam successfully and Thanks for your work;
While Running on my own dataset, i found the whole size turned smaller and smaller, especially whrn some object are detected. SO i was wondering are there any other parameters which may affect the scale of the whole map?
I found InitToGround in Tracking.cpp and i am not sure what this parameter means? Transfering points in camera to Ground? I am not sure what the Ground Coordinate looks like? Front is x, Left is Y,and up is Z (Like Odom)? What is the camera Coordinate looks like? is it the same as OrbSlam, it is Front is z, Right is x, and Down is y. ?
I am confused because of the InitToGround of kitti in Tracking::Tracking() in which InitToGround Quaternion is set to (0.7071,0,0,-0.7071) which in Eular Angle is (z,y,x) = (0,0,90). Why the relation between this two coordinates is rotate 90 around x-axis ?

In the package object_slam, why does the 3D cuboid detection use a constant transToWolrd?

I am learning the package object_slam by reading the source code. I found that the cuboid detection is with a constant variable "transToWolrd", as the line

detect_cuboid_obj.detect_cuboid(raw_rgb_img,transToWolrd,raw_2d_objs,all_lines_raw, frames_cuboids);
shows
The code
"detect_cuboid_obj.detect_cuboid(raw_rgb_img,transToWolrd,raw_2d_objs,all_lines_raw, frames_cuboids);" can detect the cuboid with constant "transToWolrd", but I think the camera is moving around the target cuboid, the transToWolrd should change. So how does the "detect_3d_cuboid::detect_cuboid“ work with a constant input "transToWolrd".
Thanks!

Error for running " roslaunch object_slam object_slam_example.launch"

[object_slam_node-2] process has died [pid 10190, exit code -11, cmd /home/scopus/cubeslam_ws/devel/lib/object_slam/object_slam_node __name:=object_slam_node __log:=/home/scopus/.ros/log/ca99dc1c-dc12-11e9-b323-e8b1fc04332d/object_slam_node-2.log].
log file: /home/scopus/.ros/log/ca99dc1c-dc12-11e9-b323-e8b1fc04332d/object_slam_node-2*.log

Thanks!

How to evaluate 3D IOU for Seq. 93

Hi Shichao,

In your CubeSLAM paper, table below, there's 3D IOU for Seq. 93. However, I can't get the correct tracklet and trajectory alignment, as the car seems to be going downwards.

I am wondering whether you could advice how to process the tracklet file correctly? Eg. how do you load the tracklet and plot the bounding boxes, and whether have you set the camera height to some fixed value? It would be even better if you could kindly share your code for evaluation of 3D IOU for Sq. 93

image

Here's what I get. bounding boxes are on the horizontal plane,

image

but trajectory is downwards.

image

So I am also curious how to get trans % error for 0093, since the gt trajectory appears to be wrong.

Dynamic data association

Hello, shichao, thanks for your great job and open source sharing.
I have a question about the dynamic data association. According to your paper, 2-D KLT sparse optical flow algorithm is used for the point and object dynamic association. However, I didn't see how to generate 'mvKeysHarris' in your code, and I found its value is always empty when testing. So I wonder if my understanding is wrong?

Does 2d detection need depth?

HI,Thanks for your project. Recently, i am trying to run it on my own dataset and there are some part i am not quiet understand. PS. i already successfully ran all demo on my computer.
Take object_slam_example.launch for example. i make my own data as the code said: raw_imgs for original RGB images, filter_2d_obj_txts for 2D detection of images, truth_cam_poses.txt for camera poses(in which only the first pose is right); when running object_slam_example.launch, i set online_detect_mode to true cuz i want the online cube detection.
And as the note said on main_obj.cpp, detect_cuboids_saved.txt and pop_cam_poses_saved.txt are not used in online detection, so i didn't read these two files.
My code runs well but stuck at publish_all_poses() and it reads the depth image. so does this mean that it needs RGBD dataset for tansferring 2D detection to 3D cube? or the depth image is only used for visualization?
i am not quiet understand what kinds of data do i need to prepare for online and offline. and i didn't find any files to clarify this. so i am still confused.
Thanks for your time and I really appreciate your open-source code. Thanks!!

Some error while catkin_make

When i do catkin_make i have this errors. But when i add include <numeric> and include <vector> i have the same problem.

In file included from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:1:0:

/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:47:101: error: ‘std::vector’ has not been declared
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:47:107: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:49:102: error: ‘std::vector’ has not been declared
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:49:108: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &strings);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:52:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:52:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:53:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:53:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:60:30: error: ‘vector’ in namespace ‘std’ does not name a template type
void print_vector(const std::vector &vec);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:60:36: error: expected ‘,’ or ‘...’ before ‘<’ token
void print_vector(const std::vector &vec);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:64:51: error: ‘std::vector’ has not been declared
void linespace(T starting, T ending, T step, std::vector &res);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:64:57: error: expected ‘,’ or ‘...’ before ‘<’ token
void linespace(T starting, T ending, T step, std::vector &res);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:236:101: error: ‘std::vector’ has not been declared
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:236:107: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘bool read_obj_detection_txt(std::__cxx11::string, Eigen::MatrixXd&, int)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:238:37: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(const string&)’
if (!std::ifstream(txt_file_name))
^
In file included from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:9:0:
/usr/include/c++/5/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/5/fstream:495:7: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const char*’
/usr/include/c++/5/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/5/fstream:481:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/5/fstream:455:11: note: candidate: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/5/fstream:455:11: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const std::basic_ifstream&’
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:243:5: error: ‘all_strings’ was not declared in this scope
all_strings.clear();
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:274:102: error: ‘std::vector’ has not been declared
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:274:108: error: expected ‘,’ or ‘...’ before ‘<’ token
bool read_obj_detection2_txt(const std::string txt_file_name, Eigen::MatrixXd &read_number_mat, std::vectorstd::string &all_strings)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘bool read_obj_detection2_txt(std::__cxx11::string, Eigen::MatrixXd&, int)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:276:37: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(const string&)’
if (!std::ifstream(txt_file_name))
^
In file included from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:9:0:
/usr/include/c++/5/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/5/fstream:495:7: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const char*’
/usr/include/c++/5/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/5/fstream:481:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/5/fstream:455:11: note: candidate: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/5/fstream:455:11: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const std::basic_ifstream&’
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:281:5: error: ‘all_strings’ was not declared in this scope
all_strings.clear();
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:316:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:316:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void sort_indexes(const VectorXd&, int)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:318:23: error: ‘idx’ was not declared in this scope
std::partial_sort(idx.begin(), idx.begin() + top_k, idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:318:50: error: ‘top_k’ was not declared in this scope
std::partial_sort(idx.begin(), idx.begin() + top_k, idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:318:119: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
std::partial_sort(idx.begin(), idx.begin() + top_k, idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:321:52: error: ‘std::vector’ has not been declared
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:321:58: error: expected ‘,’ or ‘...’ before ‘<’ token
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void sort_indexes(const VectorXd&, int)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:321:6: error: redefinition of ‘void sort_indexes(const VectorXd&, int)’
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:316:6: note: ‘void sort_indexes(const VectorXd&, int)’ previously defined here
void sort_indexes(const Eigen::VectorXd &vec, std::vector &idx, int top_k)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:10: error: ‘idx’ was not declared in this scope
sort(idx.begin(), idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:85: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
sort(idx.begin(), idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:86: error: ‘sort’ was not declared in this scope
sort(idx.begin(), idx.end(), [&vec](int i1, int i2) { return vec(i1) < vec(i2); });
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:323:86: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
from /usr/local/include/eigen3/Eigen/Core:269,
from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/matrix_utils.h:4,
from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:4718:5: note: ‘std::sort’
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:339:30: error: ‘vector’ in namespace ‘std’ does not name a template type
void print_vector(const std::vector &vec)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:339:36: error: expected ‘,’ or ‘...’ before ‘<’ token
void print_vector(const std::vector &vec)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void print_vector(int)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:341:28: error: ‘vec’ was not declared in this scope
for (size_t i = 0; i < vec.size(); i++)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:345:39: error: ‘vector’ in namespace ‘std’ does not name a template type
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:345:45: error: expected ‘,’ or ‘...’ before ‘<’ token
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:345:15: error: template-id ‘print_vector<>’ for ‘void print_vector(int)’ does not match any template declaration
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:346:39: error: ‘vector’ in namespace ‘std’ does not name a template type
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:346:45: error: expected ‘,’ or ‘...’ before ‘<’ token
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:346:15: error: template-id ‘print_vector<>’ for ‘void print_vector(int)’ does not match any template declaration
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:347:39: error: ‘vector’ in namespace ‘std’ does not name a template type
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:347:45: error: expected ‘,’ or ‘...’ before ‘<’ token
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:347:15: error: template-id ‘print_vector<>’ for ‘void print_vector(int)’ does not match any template declaration
template void print_vector(const std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:350:51: error: ‘std::vector’ has not been declared
void linespace(T starting, T ending, T step, std::vector &res)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:350:57: error: expected ‘,’ or ‘...’ before ‘<’ token
void linespace(T starting, T ending, T step, std::vector &res)
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In function ‘void linespace(T, T, T, int)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:352:5: error: ‘res’ was not declared in this scope
res.reserve((ending - starting) / step + 2);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: At global scope:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:364:45: error: ‘std::vector’ has not been declared
template void linespace(int, int, int, std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:364:51: error: expected ‘,’ or ‘...’ before ‘<’ token
template void linespace(int, int, int, std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:365:54: error: ‘std::vector’ has not been declared
template void linespace(double, double, double, std::vector &);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:365:60: error: expected ‘,’ or ‘...’ before ‘<’ token
template void linespace(double, double, double, std::vector &);
^
In file included from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/object_3d_util.h:12:0,
from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp:1:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:65:41: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_plot_detail_images = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:66:40: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_plot_final_images = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:67:40: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_save_final_images = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:69:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool print_details = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:72:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool consider_config_1 = true; // false true
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:73:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool consider_config_2 = true;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:74:44: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_sample_cam_roll_pitch = false; // sample camera roll pitch in case don't have good camera pose
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:75:41: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_sample_bbox_height = false; // sample object height as raw detection might not be accurate
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:77:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
int max_cuboid_num = 1; //final return best N cuboids
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:78:35: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
double nominal_skew_ratio = 1; // normally this 1, unless there is priors
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:79:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
double max_cut_skew = 3;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In instantiation of ‘bool read_all_number_txt(std::__cxx11::string, Eigen::Matrix<LhsScalar, -1, -1, 0>&) [with T = double; std::__cxx11::string = std::__cxx11::basic_string]’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:233:64: required from here
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:199:5: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(const string&)’
if (!std::ifstream(txt_file_name))
^
In file included from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:9:0:
/usr/include/c++/5/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/5/fstream:495:7: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const char*’
/usr/include/c++/5/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/5/fstream:481:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/5/fstream:455:11: note: candidate: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/5/fstream:455:11: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const std::basic_ifstream&’
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp: In instantiation of ‘bool read_all_number_txt(std::__cxx11::string, Eigen::Matrix<LhsScalar, -1, -1, 0>&) [with T = int; std::__cxx11::string = std::__cxx11::basic_string]’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:234:64: required from here
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:199:5: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(const string&)’
if (!std::ifstream(txt_file_name))
^
In file included from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/matrix_utils.cpp:9:0:
/usr/include/c++/5/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/5/fstream:495:7: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const char*’
/usr/include/c++/5/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/5/fstream:481:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/5/fstream:455:11: note: candidate: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/5/fstream:455:11: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const std::basic_ifstream&’
CMakeFiles/detect_3d_cuboid.dir/build.make:110: recipe for target 'CMakeFiles/detect_3d_cuboid.dir/src/matrix_utils.cpp.o' failed
make[2]: *** [CMakeFiles/detect_3d_cuboid.dir/src/matrix_utils.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp: In function ‘void fuse_normalize_scores_v2(const VectorXd&, const VectorXd&, Eigen::VectorXd&, std::vector&, double, bool)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp:503:9: error: ‘iota’ is not a member of ‘std’
std::iota(dist_sorted_inds.begin(), dist_sorted_inds.end(), 0);
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/object_3d_util.cpp:529:9: error: ‘iota’ is not a member of ‘std’
std::iota(final_keep_inds.begin(), final_keep_inds.end(), 0);
^
In file included from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/object_3d_util.h:12:0,
from /home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/box_proposal_detail.cpp:29:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:65:41: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_plot_detail_images = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:66:40: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_plot_final_images = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:67:40: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_save_final_images = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:69:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool print_details = false;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:72:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool consider_config_1 = true; // false true
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:73:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool consider_config_2 = true;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:74:44: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_sample_cam_roll_pitch = false; // sample camera roll pitch i
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:75:41: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
bool whether_sample_bbox_height = false; // sample object height as ra
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:77:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
int max_cuboid_num = 1; //final return best N cuboids
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:78:35: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
double nominal_skew_ratio = 1; // normally this 1, unless there is priors
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/include/detect_3d_cuboid/detect_3d_cuboid.h:79:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
double max_cut_skew = 3;
^
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/box_proposal_detail.cpp: In member function ‘void detect_3d_cuboid::detect_cuboid(const cv::Mat&, const Matrix4d&, const MatrixXd&, Eigen::MatrixXd, std::vector<std::vector<cuboid*> >&)’:
/home/valeriia/cubeslam_ws/src/cube_slam/detect_3d_cuboid/src/box_proposal_detail.cpp:531:55: error: ‘iota’ was not declared in this scope
iota(sort_idx_small.begin(), sort_idx_small.end(), 0);
^
CMakeFiles/detect_3d_cuboid.dir/build.make:86: recipe for target 'CMakeFiles/detect_3d_cuboid.dir/src/object_3d_util.cpp.o' failed
make[2]: *** [CMakeFiles/detect_3d_cuboid.dir/src/object_3d_util.cpp.o] Error 1
CMakeFiles/detect_3d_cuboid.dir/build.make:62: recipe for target 'CMakeFiles/detect_3d_cuboid.dir/src/box_proposal_detail.cpp.o' failed
make[2]: *** [CMakeFiles/detect_3d_cuboid.dir/src/box_proposal_detail.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/detect_3d_cuboid.dir/all' failed
make[1]: *** [CMakeFiles/detect_3d_cuboid.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'detect_3d_cuboid':
Command '['/home/valeriia/cubeslam_ws/devel_isolated/tictoc_profiler/env.sh', 'make', '-j6', '-l6']' returned non-zero exit status 2

Reproduce this error by running:
==> cd /home/valeriia/cubeslam_ws/build_isolated/detect_3d_cuboid && /home/valeriia/cubeslam_ws/devel_isolated/tictoc_profiler/env.sh make -j6 -l6

Command failed, exiting.

Ubuntu 16.04, ROS KInetic, OpenCV 3.4

For dynamic mono SLAM - how to get cuboid.txt and maskmap?

To test mono_dynamic on seq_18 that you provided

How to get the following:
1- folder 'pred_3d_obj_matched_tracked_txt' which contains the 3d_cuboids.txt of every frame
2- folder 'rcnn_labelmap_3dmatched' which contains maskmap.png and maskcolor.jpg
and what's the difference between maskmap and maskcolor and how to get them?

1- My understanding is that the cuboid.txt file has the following format:
pos(3) yaw(1) scale(3) x1 y1 w h prob track_id
From detect_cuboid.m code, I can save the first 12 elements, however I'm not sure how to get the track_id for dynamic data. Is it a unique tracking id for each object throughout a sequence? Can you please provide more explanations on how to get this tracking id?

2- I can see that you only use the maskmap.png which I assume is the mask rcnn results for each image where 0 is used for background and indices from 1,...,n are used for the n detected object masks in the image. If that's the case, I can produce these myself. Otherwise, please advise.

Thanks a lot!

How to get the data /pred_3d_obje_matched_tracked_txt/frame_id_3d_cuboids.txt?

Hello, shichao, thanks for your great job and open source sharing.
When testing the object_orb_slam (run mono_dynamic.launch), the data you provided (kitti (0018)) is required. I see the format of the 3D_cuboids data in /pred_3d_obj_matched_tracked_txt/frame_id_3d_cuboids.txt, i.e., [cuboid_center, yaw, cuboid_scale, [x,y,w,h], prop, truth_id]. I know the the [x,y,w,h] can be provided by YOlO or other detectors, but how should the 'cuboid_center, yaw, cuboid_scale, and truth_id' data be obtained? Can by the detect_3d_cuboid package?

How to run it with my own image sequences

Hi shichaoy,
Thanks for your sharing. I have some question on how to run it on my own image sequences.
In notes,I supposed that the filter_2d_obj_txts, raw_imgs, detect_cuboids_saved.txt, pop_cam_poses_saved.txt are required. The filter_2d_obj_txts,detect_cuboids_saved.txt may obtain using other packages. So can you give more details on how to get pop_cam_poses_saved.txt?
Thanks in advance.

What is the mathematical basis for computing the movement of camera?

Hi, thank you for your great contribution!
I am reading the source code of object_slam. I found that in you code the movement of camera is related to the variable "odom_val". This variable is computed with two other variables "prev_pose_Tcw" and "prev_prev_pose_Tcw". Then the current pose of camera, i.e. "curr_cam_pose_Twc" can be got.
But both "prev_pose_Tcw" and "prev_prev_pose_Tcw" are computed by optimization using g2o, i.e. "SE3Vertex->estimate()".
It is well-known that image matching and PnP is a good method to compute the relative movement between two images. What is the theory basis in your code? Thanks!

How does object_slam get the correct depth cloud when whether_sample_cam_roll_pitch is false?

The package object_slam can build the map for a cuboid. I run the online_detect_mode of object_slam with different parameter settings.
When the parameter "detect_cuboid_obj.whether_sample_cam_roll_pitch" is set to be true, the /slam_odom_pose is close to the /truth_odom_pose, the /cubes_opti_hist is also close to the /cubes_raw_frame. The built depth cloud of the cuboid is great.
However, when the parameter "detect_cuboid_obj.whether_sample_cam_roll_pitch" is set to be false, the /slam_odom_pose is far from the /truth_odom_pose, the /cubes_opti_hist is also far from the /cubes_raw_frame. But in this case the built depth cloud of the cuboid is same as the "detect_cuboid_obj.whether_sample_cam_roll_pitch" is true.
rviz_screenshot_2019_11_06-16_20_48
As above image shows, the blue /slam_odom_pose drifts far from red /truth_odom_pose. Both the /cubes_opti_hist and /cubes_raw_frame are far from the built depth cloud. It seems that the depth cloud is correct.

So when the camera poses drifts so much far from the truth poses, why can it still build the correct map(depth cloud)?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.