4am-robotics/cob_command_tools

[cob_script_server] display (Trigger-)Response within cob_command_gui

fmessmer opened this issue · 5 comments

Currently you do not get any notification if e.g. init or recover calls fail!

@fmessmer FYI

You're right. The result can currently only be seen in the diagnostics window.
+1 for this feature.

Some time ago we discussed two possibilities:
(i) use colors (red and green) for the buttons to indicate service response or diagnostics.
(ii) show result in text field which currently shows the ROS_MASTER_URI

I vote for (ii) because (i) may lead to confusions if service response and diagnostics show different results. Furthermore there is no 1 to 1 mapping for buttons and diagnostics groups, e.g. behaviour.

There are two main problems here:

First, the TriggerResponse is currently only used for a rospy.logerr...and only if executed with blocking=True (which currently not the case for the Init all and Recover all buttons)

To solve this, the TriggerResponse (boolean success and string message) should be passed to the action_handle in order to be able to process it in the cob_command_gui as the handle is what is returned


Second - and this is even worse - in knoeppkes the functions registered to the buttons are executed in a separate thread.

According to the python API:

thread.start_new_thread(function, args[, kwargs])
Start a new thread and return its identifier. The thread executes the function function with the argument list args (which must be a tuple). The optional kwargs argument specifies a dictionary of keyword arguments. When the function returns, the thread silently exits. When the function terminates with an unhandled exception, a stack trace is printed and then the thread exits (but other threads continue to run).

So, I see no chance to option for accessing/evaluating the return value (if we manage to return the required information) of the script server functions from within knoeppkes...

implemented in #141

knoeppkes_error_dialog

Well, it turned out that pop-ups are not the adequate way to display this information.
Thus, it has been removed and only the consistency changes within cob_script_server have been merged in #142

not planned