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

What @StefanKohlbrecher suggests is correct but only partially. Attaching to an external process is an option and in fact it's the only option when you use roslaunch. However hooking to an external process adds an extra layer of complexity and if you can't use ptrace you are basically screwed. If you stick to rosrun you can simply dump the rosrun part and debug your node straight away use the "normal" debug mode in Qt Creator. Why? Because what the node basically is, is a normal application. Rosrun and especially roslaunch simply wrap some ROS functionality (such as passing node parameters via launch files) around it so that it's easier for the user to run nodes. If command line arguments are important for your node, you can modify your node to get those from pure argv (not through the NodeHandle) or read from a text file.

What @StefanKohlbrecher @Stefan Kohlbrecher suggests is correct but only partially. Attaching to an external process is an option and in fact it's the only option when you use roslaunch. However hooking to an external process adds an extra layer of complexity and if you can't use ptrace you are basically screwed. If you stick to rosrun you can simply dump the rosrun part and debug your node straight away use the "normal" debug mode in Qt Creator. Why? Because what the node basically is, is a normal application. Rosrun and especially roslaunch simply wrap some ROS functionality (such as passing node parameters via launch files) around it so that it's easier for the user to run nodes. If command line arguments are important for your node, you can modify your node to get those from pure argv (not through the NodeHandle) or read from a text file.

What @Stefan Kohlbrecher suggests is correct but only partially. Attaching to an external process is an option and in fact it's the only option when you use roslaunch. However hooking to an external process adds an extra layer of complexity and if you can't use ptrace you are basically screwed. If you stick to rosrun you can simply dump the rosrun part and debug your node straight away use using the "normal" debug mode in Qt Creator. Why? Because what the node basically is, is a normal application. Rosrun and especially roslaunch simply wrap some ROS functionality (such as passing node parameters via launch files) around it so that it's easier for the user to run nodes. If command line arguments are important for your node, you can modify your node to get those from pure argv (not through the NodeHandle) or read from a text file.