ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

g2o in ROS creates problems with Csparse

asked 2013-09-26 05:01:35 -0500

ubisum gravatar image

Hello everyone. I downloaded g2o library to use it from inside ROS. Everything seemed to work well, since writing

using namespace g20;

and including test library

#include "/opt/ros/fuerte/include/g2o/core/block_solver.h"

allowed compiling through rosmake from inside my package.
Problems arose when I started to write the real g2o code and just one line

SparseOptimizer optimizer;

caused the following error:

 /opt/ros/fuerte/include/g2o/solvers/csparse/csparse_helper.h:23:16: fatal error: cs.h: File o directory non esistente

Then I updated my system to have Csparse:

sudo apt-get install libsuitesparse-dev

but I got a message advising me that it's already there.
Finally, I modified my package's CMakeLists file:

include_directories(${CSPARSE_INCLUDE_DIR})

but nothing changed.
Does anyone how to solve the problem? thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-09-28 20:34:38 -0500

tfoote gravatar image

If you are doing include_directories of CSPARSE_INCLUDE_DIR, are you successfully calling find_package on CSPARSE first? If so does CSPARSE_INCLUDE_DIR hold any value? You might have a typo in the variable name. (Not all packages have the same capitalization in CMake rules etc)

edit flag offensive delete link more

Comments

thanks for answer. I tried to solve problem through an explicit inclusion: include_directories(/home/ubisum/fuerte_workspace/CSparse/Include) include_directories(/home/ubisum/fuerte_workspace/CSparse/Source) This seems to work, it should be equivalent to...

ubisum gravatar image ubisum  ( 2013-09-28 23:03:27 -0500 )edit

... SET(CSPARSE_INCLUDE_DIR /home/ubisum/fuerte_workspace/CSparse/Include /home/ubisum/fuerte_workspace/CSparse/Source) include_directories(${CSPARSE_INCLUDE_DIR}) am I mistaking? anyway now a bigger problem has figured out: g2o doesn't find its own functions...

ubisum gravatar image ubisum  ( 2013-09-28 23:04:52 -0500 )edit

this is the link to my new post: http://answers.ros.org/question/84746/g2o-doesnt-find-its-own-functions-in-ros/. If you can help, I'll be very glad. I'm just a newbie... :)))

ubisum gravatar image ubisum  ( 2013-09-28 23:40:16 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2013-09-26 05:01:35 -0500

Seen: 2,658 times

Last updated: Sep 28 '13