Redirecting ROS node log to Qt widget

asked 2019-07-25 03:16:07 -0600

schizzz8 gravatar image

Hi all,

I implemented an action server (see #q326543) to record certain sensor data while a robot is moving.

On the client side, I implemented functions to send goal and receive feedback and result. Now, I'd like to implement a GUI wrapper for the client node as an RViz panel plug-in.

I managed to follow the tutorial and have a simplistic custom panel loaded in RViz. My question now is rather a design one.

Suppose I have the following result callback:

void CustomClient::doneCB(const actionlib::SimpleClientGoalState &state,
                                     const custom_action_msgs::CustomActionResultConstPtr &result)
{
  ROS_INFO("Finished in state [%s]", state.toString().c_str());
  ROS_INFO_STREAM("Result: " << result->execution_time);
}

I'd like to add in the panel a "console" widget that can show the node log. I'm pretty new to Qt, I just know that there is a QPlainTextEdit that can show text and that the typical way of handling events in Qt is by SIGNALS/SLOTS.

However, in this case I can't figure out how to intercept the event from Qt that the callback has been executed. I'd be very glad if someone could show me how to do that.

Thanks.

edit retag flag offensive close merge delete