flightmare icon indicating copy to clipboard operation
flightmare copied to clipboard

OMPL for Motion Planning build error

Open anoopsonar30 opened this issue 3 years ago • 5 comments

Hi! I installed Open3D, OMPL and OpenMP but am still running into this error while building flightros with motion planning using OMPL.

Errors     << flightros:make /home/snoop/catkin_ws/logs/flightros/build.make.063.log                                    
/home/snoop/catkin_ws/src/flightmare/flightros/src/motion_planning/motion_planning.cpp: In function ‘std::vector<motion_planning::float3> motion_planning::readPointCloud()’:
/home/snoop/catkin_ws/src/flightmare/flightros/src/motion_planning/motion_planning.cpp:24:17: warning: unused variable ‘size_mb’ [-Wunused-variable]
   24 |     const float size_mb = file_stream->tellg() * float(1e-6);
      |                 ^~~~~~~
/usr/bin/ld: CMakeFiles/motion_planning.dir/src/motion_planning/motion_planning.cpp.o: in function `ompl::base::SE3StateSpace::SE3StateSpace()':
motion_planning.cpp:(.text._ZN4ompl4base13SE3StateSpaceC2Ev[_ZN4ompl4base13SE3StateSpaceC5Ev]+0x3d): undefined reference to `ompl::base::StateSpace::getName() const'
/usr/bin/ld: motion_planning.cpp:(.text._ZN4ompl4base13SE3StateSpaceC2Ev[_ZN4ompl4base13SE3StateSpaceC5Ev]+0x5f): undefined reference to `ompl::base::StateSpace::setName(std::string const&)'
/usr/bin/ld: motion_planning.cpp:(.text._ZN4ompl4base13SE3StateSpaceC2Ev[_ZN4ompl4base13SE3StateSpaceC5Ev]+0x1a2): undefined reference to `ompl::base::StateSpace::getName() const'
/usr/bin/ld: motion_planning.cpp:(.text._ZN4ompl4base13SE3StateSpaceC2Ev[_ZN4ompl4base13SE3StateSpaceC5Ev]+0x1bf): undefined reference to `ompl::base::StateSpace::setName(std::string const&)'
/usr/bin/ld: motion_planning.cpp:(.text._ZN4ompl4base13SE3StateSpaceC2Ev[_ZN4ompl4base13SE3StateSpaceC5Ev]+0x2a3): undefined reference to `ompl::base::StateSpace::getName() const'
/usr/bin/ld: motion_planning.cpp:(.text._ZN4ompl4base13SE3StateSpaceC2Ev[_ZN4ompl4base13SE3StateSpaceC5Ev]+0x2c0): undefined reference to `ompl::base::StateSpace::setName(std::string const&)'
/usr/bin/ld: CMakeFiles/motion_planning.dir/src/motion_planning/motion_planning.cpp.o: in function `main':
motion_planning.cpp:(.text.startup+0xbdc): undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
/usr/bin/ld: motion_planning.cpp:(.text.startup+0xc5d): 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&)'
/usr/bin/ld: motion_planning.cpp:(.text.startup+0xccf): 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&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/motion_planning.dir/build.make:373: /home/snoop/catkin_ws/devel/lib/flightros/motion_planning] Error 1
make[1]: *** [CMakeFiles/Makefile2:994: CMakeFiles/motion_planning.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
cd /home/snoop/catkin_ws/build/flightros; catkin build --get-env flightros | catkin env -si  /usr/bin/make --jobserver-auth=4,5; cd -
........................................................................................................................
Failed     << flightros:make                                [ Exited with code 2 ]                                      
Failed    <<< flightros                                     [ 8.0 seconds ]                                             
[build] Summary: 33 of 34 packages succeeded.                                                                           
[build]   Ignored:   2 packages were skipped or are blacklisted.                                                        
[build]   Warnings:  None.                                                                                              
[build]   Abandoned: None.                                                                                              
[build]   Failed:    1 packages failed.    

It seems like a linking error and I've tried editing the CMakeLists.txt but it still fails with the same errors. The linker is failing not just on ompl functions but also on the ros functions so I'm not sure what the problem is.

anoopsonar30 avatar Mar 25 '21 06:03 anoopsonar30