Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build dogm with ros failed #77

Open
synsin0 opened this issue Nov 28, 2020 · 2 comments
Open

Build dogm with ros failed #77

synsin0 opened this issue Nov 28, 2020 · 2 comments

Comments

@synsin0
Copy link

synsin0 commented Nov 28, 2020

Hi, I am building the ros version of dogm, and at the last stage I failed possibly because of some dependencies issues. my error is like follows:

/usr/bin/ld: /usr/local/lib/libdogm.a(dogm.cu.o): relocation R_X86_64_PC32 against symbol `_ZN4dogm12ParticlesSoAC1Ev' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
dynamic-occupancy-grid-map-ros/dogm_ros/CMakeFiles/dogm_ros.dir/build.make:136: recipe for target '/home/yining/rfs_map/devel/lib/libdogm_ros.so' failed
make[2]: *** [/home/yining/rfs_map/devel/lib/libdogm_ros.so] Error 1
CMakeFiles/Makefile2:1204: recipe for target 'dynamic-occupancy-grid-map-ros/dogm_ros/CMakeFiles/dogm_ros.dir/all' failed
make[1]: *** [dynamic-occupancy-grid-map-ros/dogm_ros/CMakeFiles/dogm_ros.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
make: *** [all] Error 2

Maybe I need to recompile dogm? But I don't know where goes wrong, maybe it should not be libdogm.a but libdogm.so?

@TheCodez
Copy link
Owner

Hi @synsin0,

currently the ROS branch is unfishished and highly outdated. I don't know when I can finish it, as I have very little time at the moment.
Your best bet currently is probably to use the code demo from the master branch (as this code is up to date) and try to include it into a custom ROS node.

@GarronLiu
Copy link

GarronLiu commented Jan 4, 2024

I was confronted with the same problem! But now I fix it. The solution is below:

  1. Delete your original compiled build folder. Modify the cmakelists.txt of DOGM project:
    add_library(dogm STATIC ${HEADERS_FILES} ${SRC_FILES} )
    into
    add_library(dogm SHARED ${HEADERS_FILES} ${SRC_FILES} )
    [In this way you build it into a SHARED object which can be linked to by the ROS code]. Re-run the command
    mkdir build && cd build; cmake .. && make; sudo make install;
  2. add #include <OgreTexture.h> in the dogm_rviz_plugin/include/dogm_rviz_plugin/dogm_display.h file. Re-run catkin_make in the WS folder.
    Then you can use the ros version of DOGM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants