Skip to content

Commit

Permalink
fix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
CullenSUN committed Nov 6, 2023
1 parent 463e85a commit 9558a1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 5 additions & 6 deletions mini_pupper_dance/mini_pupper_dance/pose_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ def interpolation_timer_callback(self):
elif (reference_y > state_y):
state_y = state_y + self.increment

self.pose_state.orientation.x,
self.pose_state.orientation.y,
self.pose_state.orientation.z,
self.pose_state.orientation.w = quaternion_from_euler(state_r,
state_p,
state_y)
x, y, z, w = quaternion_from_euler(state_r, state_p, state_y)
self.pose_state.orientation.x = x
self.pose_state.orientation.y = y
self.pose_state.orientation.z = z
self.pose_state.orientation.w = w

self.pose_state.position.x = self.pose_reference.position.x
self.pose_state.position.y = self.pose_reference.position.y
Expand Down
8 changes: 6 additions & 2 deletions mini_pupper_music/mini_pupper_music/music_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def stop_sound(self):
self.playback_thread.join(timeout=1.0) # Wait for 1 second for the thread to finish
if self.playback_thread.is_alive():
# If the thread is still running, terminate it forcefully
self.get_logger().warning('Playback thread did not terminate gracefully. Terminating forcefully.')
self.get_logger().warning('Playback thread did not terminate gracefully.')
self.get_logger().warning('Terminating forcefully.')
self.terminate_thread(self.playback_thread)

def terminate_thread(self, thread):
Expand All @@ -96,7 +97,10 @@ def terminate_thread(self, thread):

thread_id = thread.ident
# Terminate the thread using ctypes
ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(thread_id), ctypes.py_object(SystemExit))
ctypes.pythonapi.PyThreadState_SetAsyncExc(
ctypes.c_long(thread_id),

Check warning on line 101 in mini_pupper_music/mini_pupper_music/music_server.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 trailing whitespace Raw Output: ./mini_pupper_music/mini_pupper_music/music_server.py:101:38: W291 trailing whitespace
ctypes.py_object(SystemExit)
)
self.get_logger().warning('Playback thread terminated forcefully.')


Expand Down

0 comments on commit 9558a1f

Please sign in to comment.