rpng / ov_maplab

Interface for OpenVINS with the maplab project
https://docs.openvins.com/
GNU General Public License v3.0
85 stars 15 forks source link

build_error #4

Closed arenas7307979 closed 1 year ago

arenas7307979 commented 2 years ago

These errors occur when I compile

In file included from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:48:0,
                 from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h: At global scope:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:228:91: error: ‘Simulator’ was not declared in this scope
    static void sim_save_total_state_to_file(std::shared_ptr<State> state, std::shared_ptr<Simulator> sim, std::ofstream &of_state_est,
                                                                                           ^~~~~~~~~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:228:91: note: suggested alternative:
In file included from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:39:0,
                 from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:48,
                 from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:
/datasets/catkin_ws_maplab/src/open_vins/ov_init/src/sim/Simulator.h:55:7: note:   ‘ov_init::Simulator’
 class Simulator {
       ^~~~~~~~~
In file included from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:48:0,
                 from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:228:100: error: template argument 1 is invalid
    static void sim_save_total_state_to_file(std::shared_ptr<State> state, std::shared_ptr<Simulator> sim, std::ofstream &of_state_est,
                                                                                                    ^
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h: In static member function ‘static void ov_msckf::RosVisualizerHelper::sim_save_total_state_to_file(std::shared_ptr<ov_msckf::State>, int, std::ofstream&, std::ofstream&, std::ofstream&)’:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:237:13: error: invalid operands of types ‘int’ and ‘std::nullptr_t’ to binary ‘operator!=’
     if (sim != nullptr) {
         ~~~~^~~~~~~~~~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:242:46: error: base operand of ‘->’ is not a pointer
       timestamp_inI = state->_timestamp + sim->get_true_parameters().calib_camimu_dt;
                                              ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:243:14: error: base operand of ‘->’ is not a pointer
       if (sim->get_state(timestamp_inI, state_gt)) {
              ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:257:27: error: base operand of ‘->’ is not a pointer
         of_state_gt << sim->get_true_parameters().calib_camimu_dt << " ";
                           ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:266:29: error: base operand of ‘->’ is not a pointer
           of_state_gt << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(0) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:267:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(1) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:268:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(2) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:269:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(3) << " ";
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:270:29: error: base operand of ‘->’ is not a pointer
           of_state_gt << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(4) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:271:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(5) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:272:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(6) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:273:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_intrinsics.at(i)->get_value()(7) << " ";
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:275:29: error: base operand of ‘->’ is not a pointer
           of_state_gt << sim->get_true_parameters().camera_extrinsics.at(i)(0) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:276:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_extrinsics.at(i)(1) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:277:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_extrinsics.at(i)(2) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:278:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_extrinsics.at(i)(3) << " ";
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:279:29: error: base operand of ‘->’ is not a pointer
           of_state_gt << sim->get_true_parameters().camera_extrinsics.at(i)(4) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:280:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_extrinsics.at(i)(5) << " "
                             ^~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:281:29: error: base operand of ‘->’ is not a pointer
                       << sim->get_true_parameters().camera_extrinsics.at(i)(6) << " ";
                             ^~
In file included from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:0:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h: At global scope:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:75:104: error: ‘Simulator’ was not declared in this scope
   ROS1Visualizer(std::shared_ptr<ros::NodeHandle> nh, std::shared_ptr<VioManager> app, std::shared_ptr<Simulator> sim = nullptr);
                                                                                                        ^~~~~~~~~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:75:104: note: suggested alternative:
In file included from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:39:0,
                 from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:48,
                 from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:
/datasets/catkin_ws_maplab/src/open_vins/ov_init/src/sim/Simulator.h:55:7: note:   ‘ov_init::Simulator’
 class Simulator {
       ^~~~~~~~~
In file included from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:0:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:75:113: error: template argument 1 is invalid
   ROS1Visualizer(std::shared_ptr<ros::NodeHandle> nh, std::shared_ptr<VioManager> app, std::shared_ptr<Simulator> sim = nullptr);
                                                                                                                 ^
In file included from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:0:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:132:19: error: ‘Simulator’ was not declared in this scope
   std::shared_ptr<Simulator> _sim;
                   ^~~~~~~~~
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:132:19: note: suggested alternative:
In file included from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/RosVisualizerHelper.h:39:0,
                 from /datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:48,
                 from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:
/datasets/catkin_ws_maplab/src/open_vins/ov_init/src/sim/Simulator.h:55:7: note:   ‘ov_init::Simulator’
 class Simulator {
       ^~~~~~~~~
In file included from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:0:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:132:28: error: template argument 1 is invalid
   std::shared_ptr<Simulator> _sim;
                            ^
In file included from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:32:0:
/datasets/catkin_ws_maplab/src/open_vins/ov_msckf/src/ros/ROS1Visualizer.h:75:121: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘int’
   ROS1Visualizer(std::shared_ptr<ros::NodeHandle> nh, std::shared_ptr<VioManager> app, std::shared_ptr<Simulator> sim = nullptr);
                                                                                                                         ^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /opt/ros/melodic/include/ros/platform.h:38,
                 from /opt/ros/melodic/include/ros/time.h:53,
                 from /opt/ros/melodic/include/ros/ros.h:38,
                 from /datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:22:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = ov_msckf::ROS1Visualizer; _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}; _Tp = ov_msckf::ROS1Visualizer]’:
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = ov_msckf::ROS1Visualizer; _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}; _Tp = ov_msckf::ROS1Visualizer; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<ov_msckf::ROS1Visualizer>]’
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}; _Tp = ov_msckf::ROS1Visualizer; _Alloc = std::allocator<ov_msckf::ROS1Visualizer>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from ‘std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = ov_msckf::ROS1Visualizer; _Alloc = std::allocator<ov_msckf::ROS1Visualizer>; _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<ov_msckf::ROS1Visualizer>; _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}; _Tp = ov_msckf::ROS1Visualizer; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<ov_msckf::ROS1Visualizer>; _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}; _Tp = ov_msckf::ROS1Visualizer]’
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = ov_msckf::ROS1Visualizer; _Alloc = std::allocator<ov_msckf::ROS1Visualizer>; _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}]’
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = ov_msckf::ROS1Visualizer; _Args = {std::shared_ptr<ros::NodeHandle>&, std::shared_ptr<ov_msckf::VioManager>&}]’
/datasets/catkin_ws_maplab/src/ov_maplab/src/ros1_serial_msckf.cpp:70:49:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: cannot convert ‘std::nullptr_t’ to ‘int’ for argument ‘3’ to ‘ov_msckf::ROS1Visualizer::ROS1Visualizer(std::shared_ptr<ros::NodeHandle>, std::shared_ptr<ov_msckf::VioManager>, int)’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ros1_serial_msckf.dir/src/ros1_serial_msckf.cpp.o] Error 1
make[1]: *** [CMakeFiles/ros1_serial_msckf.dir/all] Error 2
make: *** [all] Error 2
goldbattle commented 2 years ago

Can you make sure you checkout the develop_v2.5 branch of open_vins?

arenas7307979 commented 2 years ago

Thank you for all your assistance