Gazebo | Ignition | Community
Ask Your Question
0

Debug Gazebo (without ROS) using GDB

asked 2017-05-09 15:06:48 -0600

dbrodeur gravatar image

How is it possible to use gdb to debug Gazebo.

I do not use ROS, only Gazebo 7 on Ubuntu 14.04 (a bit old but I have other dependencies that require me to use 14.04). I built Gazebo from source and it worked fine. Following the instructions I used the command :

cmake -DCMAKE_BUILD_TYPE=Debug ../

to make sure I will be able to use gdb but when I start the program with gdb and I make the program crash, the stack is always empty. Should this be because I did not configure or start gdb correctly?

edit retag flag offensive close merge delete

Comments

Are you starting gzserver and gzclient separately? Running gdb on both?

chapulina gravatar imagechapulina ( 2017-05-09 15:26:48 -0600 )edit

No I was running both at the same time using gazebo instead of gzserver <world> and then gzclient as was suggested to me on the other answer below. Thanks for your help!

dbrodeur gravatar imagedbrodeur ( 2017-05-10 07:25:34 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-05-09 15:30:37 -0600

Carlos Agüero gravatar image

Instead of using gazebo, you have to use gzserver <world>, and then, gzclient.

E.g. for debugging gzserver:

gdb gzserver
r <your_world>

Once gzserver is running, you can launch gzclient if you want.

Alternatively, you can just launch gzserver as usual:

gzserver <your_world>

And run gdb on gzclient with:

gdb gzclient
r

Take a look at this related question too.

edit flag offensive delete link more

Comments

Ah you're right! I was running both server and client at the same time. Thanks it works!

dbrodeur gravatar imagedbrodeur ( 2017-05-10 07:21:28 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-05-09 15:06:48 -0600

Seen: 2,308 times

Last updated: May 09 '17