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

Eclipse debugging in ROS

asked 2011-05-27 20:53:36 -0600

BillyG gravatar image

updated 2014-01-28 17:09:45 -0600

ngrennan gravatar image

Hi.

Being from a Windows background, I've found debugging on ROS (Ubuntu 10.10) fairly difficult and not very efficient. I had hoped that Eclipse would allow debugging of nodes launched using ROSLAUNCH, but so far, I have not been successful.

So, my questions:

1) Has anyone succeeded in debugging a ROS node launched by ROSLAUNCH in Eclipse?

2) If not using Eclipse or an equivalent IDE, do most of the members of the ROS community depend on the likes of gdb to perform debugging?

Regards, Billy

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
5

answered 2011-05-27 21:18:35 -0600

pbrook gravatar image

I've regularly debugged nodes inside of Eclipse. Is there a particular reason you need to launch your node with roslaunch? If you can launch it separately you should be able to create the eclipse project around your package with make eclipse-project, add it, compile it, and then run it in debug mode.

edit flag offensive delete link more

Comments

Same here: to debug a node I removed it from the launch file, run the launch-file in a separate terminal and then debug my code on eclipse. I agree with you, GDB is certainly not user friendly
Augusto Luis Ballardini gravatar image Augusto Luis Ballardini  ( 2011-05-27 21:34:56 -0600 )edit
I have been using the same strategy as Augusto with no problems for both nodes and nodelets. There was a recent posting that presented a method to execute a launch file from Eclipse, but I haven't tested it. Tags roslaunch and Eclipse.
Bart gravatar image Bart  ( 2011-05-28 05:46:11 -0600 )edit

In debug mode how can i put breakpoint which make compiler stop in each spin of ros or iteration?

Usman gravatar image Usman  ( 2016-09-20 04:08:17 -0600 )edit
3

answered 2011-06-14 07:31:47 -0600

Alexandr Buyval gravatar image

I succeeded to debug a ROS node launched by ROSLAUNCH in Eclipse. I created the Eclipse project as described on the IDEs page. I then created a "Debug configurations" with the type of "С/С++ Attach To Application". After starting the ROSLAUNCH I click "Debug" in Eclipse and attach to the desired process.

edit flag offensive delete link more

Comments

Can I debug a particular package instead of the whole node in Eclipse? Suppose, I want to debug navfn, instead of debugging a move_base node?

Mercy gravatar image Mercy  ( 2015-01-30 08:08:16 -0600 )edit
3

answered 2011-05-29 20:53:04 -0600

updated 2011-05-29 20:57:46 -0600

There's some information how to debug nodes inside Eclipse on the IDEs page. It describes in some detail how to launch a single node in debug mode, while the rest are launched by a separate launch file.

Bonus tip: Eclipse also uses GDB internally, it just wraps it into a nice user-friendly interface. That means you can also use the GDB pretty-printers, which makes it possible to inspect vectors etc. directly via the Eclipse interface.

edit flag offensive delete link more

Comments

Already, I have many built packages (without eclipse). If I need to use eclipse for debugging nodes in those built packges, Should I rebuilt those projects with eclispe or to make seperate copy and rebuilt it with eclipse? Which is possible and better one?

Sudhan gravatar image Sudhan  ( 2012-10-26 03:55:13 -0600 )edit
1

Don't make a separate copy, just create the eclipse project files (as explained on the IDEs page), import into eclipse (again, don't check "copy into workspace") and debug them. If the package is already built, you don't need to rebuild it from eclipse (but it doesn't hurt either).

Martin Günther gravatar image Martin Günther  ( 2012-10-26 04:19:19 -0600 )edit

Question Tools

Stats

Asked: 2011-05-27 20:53:36 -0600

Seen: 6,770 times

Last updated: Apr 18 '14