Skip to content

Commit

Permalink
added version
Browse files Browse the repository at this point in the history
  • Loading branch information
cbteeple committed Mar 23, 2022
1 parent 9856f4b commit 14ba640
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions _version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.1
16 changes: 15 additions & 1 deletion src/simple_ur_move/controller_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_controllers_with_state(self, states=None):
----------
states : list or str
List of states (or s single state) to check for
(``initialized``, ``running``, ``stopped``,
(``uninitialized``, ``initialized``, ``running``, ``stopped``,
``waiting``, ``aborted``, ``unknown``)
Returns
Expand Down Expand Up @@ -99,6 +99,20 @@ def load_controller(self, controller):
response : str
Service response from the controller manager
'''
# Check if the controller is already loaded
all_controllers = self.get_controllers_with_state()
loaded_controllers = self.get_controllers_with_state(['running','stopped','initialized'])
if self.debug:
print("ALL CONTROLLERS")
print(all_controllers)
print('\n'+"LOADED CONTROLLERS")
print(loaded_controllers)

if str(controller) in loaded_controllers:
return True

if self.debug:
print("LOADING CONTROLLER: %s"%(controller))
name = self.robot_name+'/controller_manager/load_controller'
result = utils.call_service(name, LoadController, name=str(controller))
return result
Expand Down

0 comments on commit 14ba640

Please sign in to comment.