ros | vim | youcompleteme

asked 2016-08-04 10:45:23 -0500

Randerson gravatar image

Hello all, I am passing a really bad time trying to configure Vim and YouCompleteMe to work with ros packages. The main trouble is that I am not able to appropriate configure the autocomplete functionality for C-family provide by ycm. Bellow, there are a detailed description of the problems.

Firstly, I got the .ycm_extra_conf.py from here (this is the file to configure the YCM to work appropriated with ROS and it is recommended in ROS IDEs documentation). Because the headers of the project that I am working is not in ~/catkin_ws/src/project/include but is in ~/catkin_ws/src/project/include/project I did a small change in the .ycm_extra_conf.py to it find the headers.

This workaround worked pretty well. After this I tried do solve other problem, which was: YouCompleteMe was not able to find the headers of the library mrpt, specifically the one in mrpt/gui. To solve these issue, I went in the flags section in .ycm_extra_conf.py and added that path of the header. Bellow we have a picture of this.

image description

As we can, I added the flag -isystem/usr/include/mrpt/gui/include. This seems to work the YCM stated to find the desired headers from mrpt but, I do not know why, some other problems appeared, which are presented in figure bellow.

This picture is from the header ransac_lib.hpp, and we can see in lines 28 and 31 that YCM is prompting the error expected namespace name. image description

This picture is from the declaration file ransac_lib.cpp, and we can see in line 4 the error unkown type name 'vector' image description

Unfortunately for myself I am a beginner in ROS, VIM and C++ and I just can not solve this issue. Someone has any clue about how to solve this?

Thanks in advance.

Just a small complement about the error: The one from the header I do not have any guess about its origin but the one from the source file it seems to me that the YCM is not appropriated reading the header file and finding the include command for vector and the use of using namespace std.

edit retag flag offensive close merge delete