ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I had a similar problem in groovy and hydro. After comparing fuerte-libg2o with groovy-libg2o, I found out that in /opt/ros/groovy/share/libg2o the folder cmake is missing. I copied the cmake folder from my fuerte distro and it worked. You can get the relevant files here:
https:// www.dropbox.com/s/l0q4oc7yuk00t92/if_g2o_is_missed.zip
In addition, my compiler had problems finding the cs.h. Therefore I used the FindSuiteSparse.cmake script (It is included in if_g2o_is_missed.zip).
Inside CMakeLists.txt I handled libg2o like a common catkin-package and added this:
find_package(SuiteSparse)
if(CSPARSE_FOUND)
message(STATUS "CSPARSE_IS_FOUND")
else(CSPARSE_FOUND)
message(STATUS "CSPARSE_NOTFOUND")
endif(CSPARSE_FOUND)
FIND_PACKAGE(libg2o REQUIRED)
include_directories(
include
${catkin_INCLUDE_DIRS}
${CSPARSE_INCLUDE_DIR}
${CHOLMOD_INCLUDE_DIR}
${libg2o_INCLUDE_DIRS}
)
target_link_libraries(node
${catkin_LIBRARIES}
${CHOLMOD_LIBRARIES}
${CSPARSE_LIBRARIES}
/usr/lib/libcxsparse.so # not included in findSUITESPARSE cmake macro
${libg2o_LIBRARIES}
)
Maybe a better solution would be to create a FindG2O.cmake Hope this helps.
2 | No.2 Revision |
I had a similar problem in groovy and hydro. After comparing fuerte-libg2o with groovy-libg2o, I found out that in /opt/ros/groovy/share/libg2o the folder cmake is missing. I copied the cmake folder from my fuerte distro and it worked. You can get the relevant files here:
https://www.dropbox.com/s/l0q4oc7yuk00t92/if_g2o_is_missed.zip
In addition, my compiler had problems finding the cs.h. Therefore I used the FindSuiteSparse.cmake script (It is included in if_g2o_is_missed.zip).
Inside CMakeLists.txt I handled libg2o like a common catkin-package and added this:
find_package(SuiteSparse)
if(CSPARSE_FOUND)
message(STATUS "CSPARSE_IS_FOUND")
else(CSPARSE_FOUND)
message(STATUS "CSPARSE_NOTFOUND")
endif(CSPARSE_FOUND)
FIND_PACKAGE(libg2o REQUIRED)
include_directories(
include
${catkin_INCLUDE_DIRS}
${CSPARSE_INCLUDE_DIR}
${CHOLMOD_INCLUDE_DIR}
${libg2o_INCLUDE_DIRS}
)
target_link_libraries(node
${catkin_LIBRARIES}
${CHOLMOD_LIBRARIES}
${CSPARSE_LIBRARIES}
/usr/lib/libcxsparse.so # not included in findSUITESPARSE cmake macro
${libg2o_LIBRARIES}
)
Maybe a better solution would be to create a FindG2O.cmake Hope this helps.