Ask Your Question
0

Eclipse IDE problem

asked 2013-11-27 06:27:33 -0500

tuuzdu gravatar image

updated 2014-01-28 17:18:39 -0500

ngrennan gravatar image

Hi everyone! I configurate eclipse 3.8 for catkin workspace. talker.cpp and listener.cpp (from examples) compile and work fine (build by eclipse), but herewith eclipse find few errors. In talker:

LINE: ros::Publisher chatter_pub = n.advertise < std_msgs::String > ("chatter", 1000);


Description Resource    Path    Location    Type
Invalid arguments '
Candidates are:
ros::Publisher advertise(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, bool)
ros::Publisher advertise(ros::AdvertiseOptions &)
ros::Publisher advertise(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, const boost::function<void (const ros::SingleSubscriberPublisher &)> &, const boost::function<void (const ros::SingleSubscriberPublisher &)> &, const boost::shared_ptr<const void> &, bool)
'   talker.cpp  /Project@build/[Source directory]/beginner_tutorials/src    line 45 Semantic Error

In listener:

LINE: ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);


Description Resource    Path    Location    Type
Invalid arguments '
Candidates are:
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(#0), #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(ros::SubscribeOptions &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(#0)const, #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(const boost::shared_ptr<const #0> &), #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(const boost::shared_ptr<const #0> &)const, #1 *, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(#0), const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(#0)const, const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(const boost::shared_ptr<const #0> &), const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (#1::*)(const boost::shared_ptr<const #0> &)const, const boost::shared_ptr<#1> &, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (*)(#0), const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, void (*)(const boost::shared_ptr<const #0> &), const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, const boost::function<void (const boost::shared_ptr<const #0> &)> &, const boost::shared_ptr<const void> &, const ros::TransportHints &)
ros::Subscriber subscribe(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, ?, const boost::function<void (#1)> &, const boost::shared_ptr<const void> &, const ros::TransportHints &)
'   listener.cpp    /Project@build/[Source directory]/beginner_tutorials/src    line 79 Semantic Error

What's the matter?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2013-11-29 02:29:22 -0500

mozcelikors gravatar image

If I see correctly, your Eclipse does not recognize ros libraries. Follow these steps to install the Kepler Eclipse and then do a cmake compilation in order to make it recognisable.

1) http://www.eclipse.org/downloads/ From the eclipse page, scroll down to C/C++ for Developers and download it. Then untar it and copy it into /opt folder.

2) Start eclipse by command

/opt/eclipse/./eclipse

3) If it complaints for java, install openjdk-7-jre.

4) Now go right to your catkin workspace and create a ros package

roscreate-pkg my_pkg_example roscpp

5) Make it eclipse project

cd ~/catkin_ws/src/my_pkg_example/
make eclipse-project

6) Now, go ahead and create the file src/myfile.cpp and edit cmake by adding something like this to the default cmake (Assuming your executable is in src directory)

rosbuild_add_executable(my_pkg_example src/myfile.cpp)

7) On the terminal type

cd ~/catkin_ws/src/my_pkg_example/
cmake .
make

8) The last thing to do now is to go to Eclipse and Project > Run & Debug Settings (or something like this I don't remember). Add C/C++ Application. Select binary file which is ~/catkin_ws/src/my_pkg_example/bin/my_pkg_example. Then hit Apply.

Now your file should be correct.

edit flag offensive delete link more

Comments

I followed a manual http://answers.ros.org/question/52013/catkin-and-eclipse/?answer=53090#post-id-53090 and Eclipse build the workspace successfully. But Eclipse issue errors above.

tuuzdu gravatar imagetuuzdu ( 2013-11-29 22:11:05 -0500 )edit

I don't know about your manual, but if you do a fresh start and do these steps, I can help you with any related problem. Cheers.

mozcelikors gravatar imagemozcelikors ( 2013-12-01 09:04:40 -0500 )edit

Hey mozcelikors I am using ROS Hydro and trying to import a ROS package into Eclipse Kepler. When I get to the step using "make eclipse-project" I keep getting this error make: *** No rule to make target `eclipse-project'. Stop. Do you know why this happens? I would appreciate any tips. Thanks Mike

mfran89 gravatar imagemfran89 ( 2014-01-22 03:43:31 -0500 )edit

You have to execute make eclipse-project to a project that you've already created using "roscreate-pkg <pkg-name> roscpp. The folder should be like cd ~/catkin_ws/src/<pkg-name> , provided that your catkin workspace is in ~/catkin_ws.

mozcelikors gravatar imagemozcelikors ( 2014-01-22 19:57:23 -0500 )edit

If you assured that you havent done anything wrong there, I can ask a colleague of mine who had the same problem.

mozcelikors gravatar imagemozcelikors ( 2014-01-22 19:59:50 -0500 )edit

I created my ROS package using catkin_create_pkg instead of roscreate_pkg. The project is located in the catkin_ws which is in the home directory. I am using ROS Hydro as well. I still do not know where the problem lies.

mfran89 gravatar imagemfran89 ( 2014-01-23 01:39:10 -0500 )edit

I am using as well ROS Hydro with Catkin on Ubuntu 12.04 64bit with Eclipse. I have the same problem. Even after deleting the ecliplse project and the build and devel folder and running catkin_make -DCMAKE_BUILD_TYPE=DEBUG --force-cmake -G"Eclipse CDT4 - Unix Makefiles"

Markus Bader gravatar imageMarkus Bader ( 2014-01-27 22:31:23 -0500 )edit

By the way there is no command like "make eclipse-project"

Markus Bader gravatar imageMarkus Bader ( 2014-01-27 22:31:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2013-11-27 06:27:33 -0500

Seen: 1,183 times

Last updated: Nov 29 '13