Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Threading python robot
#1
I'm facing a problem in my application:

I'm developing a kind of robot... (using python, raspberry pi 3, a ttf lcd 3.5 and pygame lib)

So it has:

An interface - A background and some information on the screen. A Voice gtts - Talks and listen to my mic...

And an animation...- That draw a circle in my background while mixer is playing the audio recorded from gtts... making a "talk" effect...

Below is my code.. (I have uploaded my code to my public Google drive folder, so no permission problems) I didn't write the code here, because it is not that so long, but it will be very hard to not make a large text here...

https://drive.google.com/open?id=1BEh0ce...Pe05Sp5WoV

The problem:

I want to call the function: bertaTalkingAnimation(berta.py) inside of talkToMe function (voice.py) it is commented on the code, because everything that the robot will talk it'll need this talk animation developed on bertaTalkingAnimation...

I don't want to call it from my function main (below the KEY_SPACE event handle), because my function main it's not finished yet.. (Just using keyboard keys events to test my robot...)

I'm calling init_voice (to call all the functions to listen and talks back) through a thread, because I don't want to stop my background information every time that robot speak, and that's the problem, because I can't pass (even using args) a surface to draw on...

How can I call bertaTalkingAnimation outside main function and after talkToMe runs?

Thank you so much!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Concurrent futures threading running at same speed as non-threading billykid999 13 1,813 May-03-2023, 08:22 AM
Last Post: billykid999
  The Wall-E Robot Argentum 1 1,409 Apr-03-2022, 03:01 PM
Last Post: sastonrobert
  Tutorials on sockets, threading and multi-threading? muzikman 2 2,120 Oct-01-2021, 08:32 PM
Last Post: muzikman
  Can I open\use threading in Python? korenron 2 1,793 Jun-30-2021, 10:42 AM
Last Post: korenron
  DarkPaw Robot code Tyrelex78 3 2,134 Nov-27-2020, 12:06 AM
Last Post: Tyrelex78
  Embedding python cause crash when use boost::asio multi threading udvatt108 0 1,716 Oct-04-2020, 03:15 PM
Last Post: udvatt108
  Python - Keyboard module - Threading problem ppel123 1 3,062 Apr-13-2020, 04:49 PM
Last Post: deanhystad
  Turning Robot towards goal, comparison of angles SpaceTime 0 2,749 Jan-21-2019, 10:26 PM
Last Post: SpaceTime
  how to program robot to pass wise man puzzle steven12341234 0 1,928 Dec-02-2018, 08:31 AM
Last Post: steven12341234
  Parallel Processing in Python with Robot crcali 6 5,156 Apr-06-2018, 03:48 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020