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

Revision history [back]

click to hide/show revision 1
initial version

Hey, there is another post in ROS Answers addressing how to debug a rosnode in Qtcreator: http://answers.ros.org/question/34966/debugging-ros-package-with-qtcreator/?answer=34977#post-id-34977

I think that the answer can be summarized to:

  1. compile the node/package that you want to compile in debug mode (add "set(CMAKE_BUILD_TYPE Debug)" to your CMakeLists.txt)
  2. start your roscore and everything else as usual, except for the node you want to debug
  3. start qtcreator with "sudo" (remember to source correctly your catkin workspace)
  4. in qtcreator start the debugging mode for the rosnode by going to "Debug"->"Start Debugging"->"Attach to unstarted Application...", look for your compiled node, it should be in: "${CATKIN_WORKSPACE_FOLDER}"/devel/lib/package_name/node_name and click "Start Watching".
  5. start the node in a terminal either with rosrun or roslaunch
  6. enjoy...

Note: you need to run qtcreator with "sudo", otherwise you get a "ptrace operation not allowed" problem. Note2: if you try to run qtcreator as a normal user afterwards, you will have problems accessing some of the Qt configuration files of your home folder, run these commands to get this back to normal:

sudo chown -R ${USER}:${USER} .qt
sudo chown -R ${USER}:${USER} .config/