0
$\begingroup$

Rosanswers logo

Hi all,

Somebody who have used gdb to debug a ros control plugin please share some experience with me:)

I added the "launch-prefix="gdb -ex run --args" " attribute in the node tag of my launch file.

But when roslaunch the launch file here is what I got

"/opt/ros/indigo/lib/controller_manager/spawner": not in executable format: File format not recognized
Starting program:  joint1_effort_controller __name:=controller_spawner __log:=/home/lc/.ros/log/7a02b5fc-3c75-11e6-8071-0023248137eb/rrbot-controller_spawner-1.log
No executable file specified.

My gdb version is 7.7.1 and my ubuntu version is 14.04, my ros version is indigo.

And by the way if don't use gdb, is there any other debug tools for debugging a plugin?

Thanks in advance

Erli


Originally posted by cangjiaxuan on ROS Answers with karma: 20 on 2016-06-27

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The spawner script is a Python script that invokes some services to load / start / stop / unload your controllers. If you want to debug a controller, I think you'd need to run the process that contains your controller_manager and possibly your hardware_interface in gdb.


Originally posted by gvdhoorn with karma: 86574 on 2016-06-28

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by cangjiaxuan on 2016-06-28:
Thank you for your comment, now I know why I have such error. For debugging a controller in gdb, would you mind to describe it in more detail or provides me with some link solving similar question? Thanks again!

Erli

Comment by gvdhoorn on 2016-06-29:
It should be a matter of determining which node is running your controller_manager and then loading that node in gdb using the launch-prefix approach you already found.

Comment by cangjiaxuan on 2016-06-29:
Great! I think I got your idea, I would try it later.

Comment by cangjiaxuan on 2016-07-09:
Hi, I tied several ways and finally I can use gdb to debug my plugin. I write my experience below.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.