0
$\begingroup$

Rosanswers logo

Hi!

My setup:

  • ** Remote PC**: ROS Indigo, Ubuntu 14.04 LTS
  • ** Local PC**: ROS Indigo, Ubuntu 14.04 LTS, Qt Creator 3.0.1

I have a remote PC where I start my node using gdbserver:

user@remote:~$ gdbserver :1234 ~/catkin_ws/devel/lib/my_node/my_node

This node contains multiple SimpleActionServer-s and callbacks for each of those. All servers' flag for autostart have been set to false (see here). I'm using this tutorial as a reference.

On my local PC I have two things (note that here and above I exclude the obvious roscore running :)):

  • Qt Creator 3.01 - here I want to connect to the gdbserver on the remote and debug my node
  • Publishing - using rostopic pub ... I publish Goal messages to my remote.

I should say that normally everything works. However when I use gdbserver the callbacks don't get activated. At first I thought it was my Qt Creator's configuration. However everything there works fine and up to the spin() point I can debug step-wise through my code. Once the spin() is reached I can only pause it (it stops at the spin function call) which tells me two things:

  • The node is spinning properly
  • The messages for some reason are not passed to the action server(s)

In order to investigate further I decided to call my executable on the remote machine (without Qt Creator or even gdbserver). I connected via SSH to it and ran

user@remote:~$ ~/catkin_ws/devel/lib/my_node/my_node

The node started. However every time I send a goal to it nothing happens (same behaviour as with Qt Creator).

  • My first question is do I always have to run ROS nodes using rosrunor roslaunch? I guess that rosrun as well as roslaunch load some things without which a node cannot function in its full glory.
  • My second question is how do I go around all that?

If I really have to use rosrun the complexity of the debugging procedure skyrockets:

  • Server's callback runs in a separate thread
  • Server is started as an attached child process to rosrun
  • Rosrun is executed by gdbserver
  • Local machine connects to remote gdbserver (however we have rosrun here so we have too hook Qt Creator to the child process of rosrun representing our node)

This seems to be an overkill so I'm guessing/hoping that I've done something weird and in fact things are much simpler...


Originally posted by rbaleksandar on ROS Answers with karma: 299 on 2015-09-14

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There is no requirement to run nodes with rosrun or roslaunch; they're just convenience tools to make it easier to find and run your executables.

rosrun does even not pass any additional arguments to your node.

Any bug you have is in your code.


Originally posted by ahendrix with karma: 47576 on 2015-09-14

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by rbaleksandar on 2015-09-14:
I have followed the tutorial and it works perfectly fine (I have 5-6 SimpleActionServer-s active in that node) whenever I use rosrun or roslaunch in combination with rostopic for publishing or the ActionClient in an extra node. Where do I even start to look at in a situation like this?

Comment by rbaleksandar on 2015-09-14:
I will check the namespaces and such because this is usually the spot where most of my errors spawn from.

Comment by ahendrix on 2015-09-14:
Start by comparing how you're running the node with rosrun to how you're running it without rosrun. Are you passing any arguments to rosrun?

Comment by rbaleksandar on 2015-09-21:
You were right. Though I'm still having difficulties sending message to my node when it's running inside gdbserver at least I got it up and running.I also found out that roslaunch offers support for such things and you can add a launch-prefix that enables the gdbserver + passes all the arguments

Comment by ahendrix on 2015-09-22:
Have a look at the roslaunch nodes in GDB tutorial as well.

Comment by rbaleksandar on 2015-09-22:
Already did 3-4 days ago. Thanks for the link though. Will definitely be helpful for people who come here.

$\endgroup$

Your Answer

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