Skip to content

Commit

Permalink
fix stop check indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
scaredycode committed Oct 17, 2023
1 parent 0f312c8 commit 4720ff7
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions marimbabot_behavior/src/marimbabot_behavior/behavior_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,22 +319,20 @@ def callback_command(self, command_msg):
self.response_pub.publish('No notes recognized.')

elif command_msg.behavior == "stop":
rospy.logdebug('Aborting play.')
# stop any running threads by setting the event
self.event.set()

# check if the planning action server is currently active
if self.planning_client.simple_state == actionlib.SimpleGoalState.ACTIVE:
# cancel the goal of the planning action server
self.planning_client.cancel_goal()

# check if the lilypond_audio action server is currently active
if self.lilypond_audio_client.simple_state == actionlib.SimpleGoalState.ACTIVE:
# cancel the goal of the lilypond_audio action server
self.lilypond_audio_client.cancel_goal()

# send an empty message to the soundplay node to stop any audio preview (or TTS)
self.response_pub.publish('')
rospy.logdebug('Aborting play.')
# stop any running threads by setting the event
self.event.set()
# check if the planning action server is currently active
if self.planning_client.simple_state == actionlib.SimpleGoalState.ACTIVE:
# cancel the goal of the planning action server
self.planning_client.cancel_goal()
# check if the lilypond_audio action server is currently active
if self.lilypond_audio_client.simple_state == actionlib.SimpleGoalState.ACTIVE:
# cancel the goal of the lilypond_audio action server
self.lilypond_audio_client.cancel_goal()

# send an empty message to the soundplay node to stop any audio preview (or TTS)
self.response_pub.publish('')

else:
# check if a note sequence has been read via the 'read' command
Expand Down

0 comments on commit 4720ff7

Please sign in to comment.