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

Revision history [back]

Thank you for your answer! I have done as you suggest, but it still does not work. If I create a subscriber in OnInit(), the node does not subscribe to any messages. If I call subscribe in OnRun(), the callback function works (i.e gets called when a message arrive). However, when I try to update the icon of a button in the callback, I get a segmentation fault because this point to null.

I have tried to have the callback function in the wxApp class and in the wxFrame class (the one that starts the GUI and the GUI itself respectively). The result is the same; all references are gone (points to null) in the callback method.

It feels like it has something to do with threads, but I can't figure out why this should be a problem in this case...