raulmur / ORB_SLAM

A Versatile and Accurate Monocular SLAM
http://webdiis.unizar.es/~raulmur/orbslam/
Other
1.53k stars 820 forks source link

But the last step has issues, #141

Open yanyan-li opened 7 years ago

yanyan-li commented 7 years ago

It's almost done. But the last step has issues now. Can somebody help? I have no ideas about it. Thanks.

[ 84%] Building CXX object CMakeFiles/ORB_SLAM.dir/src/KeyFrameDatabase.cc.o [ 89%] Building CXX object CMakeFiles/ORB_SLAM.dir/src/Sim3Solver.cc.o [ 94%] Building CXX object CMakeFiles/ORB_SLAM.dir/src/Initializer.cc.o [100%] Linking CXX executable ../bin/ORB_SLAM CMakeFiles/ORB_SLAM.dir/src/main.cc.o: In function main': main.cc:(.text.startup+0xbc8): undefined reference toros::init(int&, char, std::string const&, unsigned int)' main.cc:(.text.startup+0xccb): undefined reference to ros::package::getPath(std::string const&)' main.cc:(.text.startup+0xe5c): undefined reference toros::package::getPath(std::string const&)' main.cc:(.text.startup+0x13b4): undefined reference to ros::package::getPath(std::string const&)' main.cc:(.text.startup+0x193b): undefined reference toros::console::initializeLogLocation(ros::console::LogLocation, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In function ORB_SLAM::Tracking::CreateInitialMap(cv::Mat&, cv::Mat&)': Tracking.cc:(.text+0x21e4): undefined reference toros::console::initializeLogLocation(ros::console::LogLocation, std::string const&, ros::console::levels::Level)' Tracking.cc:(.text+0x229f): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In functionORB_SLAM::Tracking::Run()': Tracking.cc:(.text+0x2946): undefined reference to ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In functionORB_SLAM::Tracking::GrabImage(boost::shared_ptr<sensormsgs::Image<std::allocator > const> const&)': Tracking.cc:(.text+0x4589): undefined reference to cv_bridge::toCvShare(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, std::string const&)' Tracking.cc:(.text+0x5e11): undefined reference toros::console::initializeLogLocation(ros::console::LogLocation, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In function ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)': Tracking.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x604): undefined reference toros::console::initializeLogLocation(ros::console::LogLocation, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/LoopClosing.cc.o: In function ORB_SLAM::LoopClosing::CorrectLoop()': LoopClosing.cc:(.text+0x2a47): undefined reference toros::console::initializeLogLocation(ros::console::LogLocation, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/FramePublisher.cc.o: In function ORB_SLAM::FramePublisher::FramePublisher()': FramePublisher.cc:(.text+0x1c3a): undefined reference toros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less, std::allocator<std::pair<std::string const, std::string> > > const&)' CMakeFiles/ORB_SLAM.dir/src/MapPublisher.cc.o: In function `ORB_SLAM::MapPublisher::MapPublisher(ORB_SLAM::Map)': MapPublisher.cc:(.text+0xb7e): undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less, std::allocator<std::pair<std::string const, std::string> > > const&)' collect2: error: ld returned 1 exit status CMakeFiles/ORB_SLAM.dir/build.make:1645: recipe for target '../bin/ORB_SLAM' failed make[2]: * [../bin/ORB_SLAM] Error 1 CMakeFiles/Makefile2:324: recipe for target 'CMakeFiles/ORB_SLAM.dir/all' failed make[1]: [CMakeFiles/ORB_SLAM.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: [all] Error 2

my OS is Ubuntu16.04. Thanks a lot.

wangzhaoguang commented 7 years ago

Actually I got this too ! The last step for compiling ORB-SLAM on Ubuntu 16.04 installed. Any hints ? cheers !!


CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o:in function ‘ORB_SLAM::Tracking::GrabImage(boost::shared_ptr<sensormsgs::Image<std::allocator > const> const&)’中: Tracking.cc:(.text+0x494b):对‘cv_bridge::toCvShare(boost::shared_ptr<sensormsgs::Image<std::allocator > const> const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’undefined reference. CMakeFiles/ORB_SLAM.dir/src/FramePublisher.cc.o:in function ‘ORB_SLAM::FramePublisher::PublishFrame()’中: FramePublisher.cc:(.text+0x24e5):对‘cv_bridge::CvImage::toImageMsg() const’ undefined reference. collect2: error: ld returned 1 exit status CMakeFiles/ORB_SLAM.dir/build.make:1567: recipe for target '../bin/ORB_SLAM' failed make[2]: [../bin/ORB_SLAM] # Error 1 CMakeFiles/Makefile2:324: recipe for target 'CMakeFiles/ORB_SLAM.dir/all' failed make[1]: [CMakeFiles/ORB_SLAM.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2


wangzhaoguang commented 7 years ago

hello world, for the building problem I encountered, I got through via: see the attached pictures.

cheers. 2017-07-23 15-58-18 2017-07-23 16-00-18

jtbon20 commented 7 years ago

@wangzhaoguang Is there anything else you changed? I deleted Opencv2 as well and it still didn't work

wangzhaoguang commented 7 years ago

No i did not change other parts.

jinchenglee commented 7 years ago

Check your gcc version. I met similar problem in ROS nodes building. Gcc 4.9 has linking problem, but gcc 5.4 works fine.

whyscience commented 6 years ago

refer to this, solve it for ROS catkin build on Ubuntu 16.04, thanks.

Debbieliang9 commented 3 years ago

Where shall we place the code? @wangzhaoguang Thanks!