@@ -228,19 +228,23 @@ def _on_ctrl_menu(self, pos):
228
228
# Show context menu
229
229
menu = QMenu (self ._widget .ctrl_table_view )
230
230
if ctrl .state == "active" :
231
- action_deactivate = menu .addAction (self ._icons ["inactive" ], "Deactivate" )
232
- action_kill = menu .addAction (self ._icons ["unloaded" ], "Deactivate and Unload" )
231
+ action_deactivate = menu .addAction (self ._icons ["inactive" ], "Deactivate (inactive)" )
232
+ action_kill = menu .addAction (
233
+ self ._icons ["unloaded" ], "Deactivate and Unload (unloaded)"
234
+ )
233
235
elif ctrl .state == "inactive" :
234
- action_activate = menu .addAction (self ._icons ["active" ], "Activate" )
235
- action_cleanup = menu .addAction (self ._icons ["unconfigured" ], "Cleanup" )
236
+ action_activate = menu .addAction (self ._icons ["active" ], "Activate (active)" )
237
+ action_cleanup = menu .addAction (
238
+ self ._icons ["unconfigured" ], "Unload and Load (unconfigured)"
239
+ )
240
+ action_unload = menu .addAction (self ._icons ["unloaded" ], "Unload (unloaded)" )
236
241
elif ctrl .state == "unconfigured" :
237
- action_configure = menu .addAction (self ._icons ["inactive" ], "Configure" )
238
- action_spawn = menu .addAction (self ._icons ["active" ], "Configure and Activate" )
242
+ action_spawn = menu .addAction (self ._icons ["active" ], "Configure and Activate (active)" )
243
+ action_configure = menu .addAction (self ._icons ["inactive" ], "Configure (inactive)" )
244
+ action_unload = menu .addAction (self ._icons ["unloaded" ], "Unload (unloaded)" )
239
245
else :
240
246
# Controller isn't loaded
241
- action_load = menu .addAction (self ._icons ["unconfigured" ], "Load" )
242
- action_configure = menu .addAction (self ._icons ["inactive" ], "Load and Configure" )
243
- action_activate = menu .addAction (self ._icons ["active" ], "Load, Configure and Activate" )
247
+ action_load = menu .addAction (self ._icons ["unconfigured" ], "Load (unconfigured)" )
244
248
245
249
action = menu .exec_ (self ._widget .ctrl_table_view .mapToGlobal (pos ))
246
250
@@ -256,25 +260,23 @@ def _on_ctrl_menu(self, pos):
256
260
self ._activate_controller (ctrl .name )
257
261
elif action is action_cleanup :
258
262
# TODO: use cleanup service once available
263
+ # https://github.com/ros-controls/ros2_control/issues/759
259
264
unload_controller (self ._node , self ._cm_name , ctrl .name )
260
265
load_controller (self ._node , self ._cm_name , ctrl .name )
266
+ elif action is action_unload :
267
+ unload_controller (self ._node , self ._cm_name , ctrl .name )
261
268
elif ctrl .state == "unconfigured" :
262
269
if action is action_configure :
263
270
configure_controller (self ._node , self ._cm_name , ctrl .name )
264
271
elif action is action_spawn :
265
272
configure_controller (self ._node , self ._cm_name , ctrl .name )
266
273
self ._activate_controller (ctrl .name )
274
+ elif action is action_unload :
275
+ unload_controller (self ._node , self ._cm_name , ctrl .name )
267
276
else :
268
277
# Assume controller isn't loaded
269
278
if action is action_load :
270
279
load_controller (self ._node , self ._cm_name , ctrl .name )
271
- elif action is action_configure :
272
- load_controller (self ._node , self ._cm_name , ctrl .name )
273
- configure_controller (self ._node , self ._cm_name , ctrl .name )
274
- elif action is action_activate :
275
- load_controller (self ._node , self ._cm_name , ctrl .name )
276
- configure_controller (self ._node , self ._cm_name , ctrl .name )
277
- self ._activate_controller (ctrl .name )
278
280
279
281
def _on_ctrl_info (self , index ):
280
282
popup = self ._popup_widget
0 commit comments