gdb says "program is not being run" upon gazebo
While I'm trying to solve this issue, I'm stuck at gdb that's suggested by a commenter. I'm new to gdb (though I'm used to the debugger feature on Eclipse). I'm referring to this instruction.
Phenom: gdb seems not processing gazebo like following:
DellMachine@ROS-User:~/ros_workspace/pr2_tutorials$ ps -ef|grep gazebo/bin/gazebo
1000 4239 4197 99 16:20 ? 00:02:03 /opt/ros/diamondback/stacks/simulator_gazebo/gazebo/bin/gazebo -u /opt/ros/diamondback/stacks/simulator_gazebo/gazebo_worlds/worlds/empty.world __name:=gazebo __log:=/home/ROS-User/.ros/log/44905b94-c85e-11e0-ae9a-0026b9168399/gazebo-2.log
1000 6626 1885 0 16:22 pts/0 00:00:00 grep --color=auto gazebo/bin/gazebo
DellMachine@ROS-User:~/ros_workspace/pr2_tutorials$ sudo gdb --pid 4239
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Attaching to process 4239
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
(gdb) cont
The program is not being run.
(gdb)
.
Step made: following this page, a file pr2_nav_tutorial.launch that's used for running gazebo is modified as:
<launch>
<!-- machine tags for sim, be sure to set environment variable ROBOT to sim -->
<include file="$(find pr2_machine)/sim.machine" />
<include file="$(find pr2_navigation_global)/amcl_node.xml" />
<include file="$(find pr2_navigation_teleop)/teleop.xml" />
<include file="$(find pr2_navigation_perception)/lasers_and_filters.xml" />
<!--include file="$(find 2dnav_pr2)/config/map_server.launch" /-->
<include file="$(find pr2_navigation_perception)/ground_plane.xml" />
<!-- The navigation stack and associated parameters -->
<include file="$(find pr2_navigation_global)/move_base.xml" />
<node name="map_server" pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/map_blank.png 0.1" respawn="true" />
***<!-- Added for gdb -->***
<!-- start gazebo with an empty plane -->
<param name="/use_sim_time" value="true" />
<node name="gazebo" pkg="gazebo" launch-prefix="$(find gazebo_worlds)/scripts/gdbrun" type="gazebo" args="$(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/>
</launch>
Thanks.