Skip to content

Commit 699e20b

Browse files
author
Bradley Schmerl
committed
Changes to work in docker env
1 parent 4e8d291 commit 699e20b

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

ig_action_server/src/ig_server.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ def __init__(self, name):
8181

8282
def preempt_cb(self):
8383
rospy.loginfo('Server preempted')
84+
print("Canceling current instructions")
8485
self._canceled.cancel()
8586
publisher.move_base_action_client().cancel_all_goals()
8687

8788
def execute_cb(self, goal):
8889
# Setting the rate of execution.
8990
if not self._canceled is None and not self._canceled.is_canceled():
91+
print("Should cancel a goal first")
9092
rospy.loginfo('Received a set of instructions without canceling the previous ones')
9193
return
9294
r =rospy.Rate(1)
@@ -347,7 +349,8 @@ def doaction(self, action, node):
347349
self.publish_feedback("%s:Charge(%s): START" % (node, secs))
348350
if self.cp1 is None:
349351
self.cp1 = cp1.CP1_Instructions()
350-
status, msg = self.cp1.charge(seconds=secs)
352+
self.cp1.track_battery_charge()
353+
status, msg = self.cp1.charge()
351354
if self._canceled.is_canceled():
352355
self.publish_feedback("%s:Charge(%s): CANCELED" % (node, secs))
353356
return False
@@ -365,13 +368,13 @@ def checkcond(self, cond):
365368
# we currently only support checking for visible objects and if an object is
366369
# nearby
367370
if cond.operator == VISIBLE:
368-
print "Checking if %s is visible..." %cond.params[0]
369-
print "Is %s visible?" %cond.params[0]
371+
print( "Checking if %s is visible..." %cond.params[0])
372+
print( "Is %s visible?" %cond.params[0])
370373
ans = raw_input()
371374
return ans in ("yes", "y", "", "\n")
372-
elif cond.operatopr == STOP:
373-
print "Checking if %s is within %s distance..." %(cond.params[1], cond.params[0])
374-
print "Is %s within %s distance?" %(cond.params[1], cond.params[0])
375+
elif cond.operator == STOP:
376+
print( "Checking if %s is within %s distance..." %(cond.params[1], cond.params[0]))
377+
print( "Is %s within %s distance?" %(cond.params[1], cond.params[0]))
375378
ans = raw_input()
376379
return ans in ("yes", "y", "", "\n")
377380

@@ -423,14 +426,15 @@ def eval(self, ast):
423426
config = config2
424427
break;
425428
if status == WAITING:
426-
print "Robot is waiting for input! But this shouldn't happen in this simulation! What's going on?"
429+
print("Robot is waiting for input! But this shouldn't happen in this simulation! What's going on?")
427430
break
428431
elif status == TERMINATED:
429-
print "Finished!"
432+
print( "Finished!")
430433
self.publish_feedback("Finished!");
431434
break
432435
elif status == FAIL:
433-
print "Failed!"
436+
print( "Failed!")
437+
print("Here")
434438
self.publish_feedback("Terminating because of failure")
435439
break
436440
else:

0 commit comments

Comments
 (0)