question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mambo with sched schedular not working

See original GitHub issue
sched.scheduler(time.time, self.mambo.smart_sleep).enter(10, 2, self.mambo.fly_direct, (20, 0, 0, 0, 1))
sched.scheduler(time.time, self.mambo.smart_sleep).enter(40, 2, self.mambo.fly_direct, (20, 0, 0, 0, 1))
sched.scheduler(time.time, self.mambo.smart_sleep).enter(70, 2, self.mambo.fly_direct, (-20, 0, 0, 0, 1))
sched.scheduler(time.time, self.mambo.smart_sleep).enter(100, 2, self.mambo.fly_direct, (-20, 0, 0, 0, 1))

I want to send roll, pitch, yaw angles to the parrot mambo for every 30 second to see its mathematical behavior. However If I write a code like above pyparrot giving an error with description

timeout - trying again

This error sometimes solving by itself without writing any correction code, however generaly it gives me an error.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ihsancemilcommented, Mar 8, 2019

It seems that even self.s = sched.scheduler(time.time, self.mambo.smart_sleep) breaks wifi connection. Writing my own scheduler algorithm solved the problem.

I simply initialize a list with tasks inside (second, function, args, is_done)

                self.task_list = [[10, self.mambo.fly_direct, (20, 0, 0, 0, 1), False],
                                  [40, self.mambo.fly_direct, (20, 0, 0, 0, 1), False],
                                  [70, self.mambo.fly_direct, (-20, 0, 0, 0, 1), False],
                                  [100, self.mambo.fly_direct, (-20, 0, 0, 0, 1), False]]

then I perform if second claimed

            second = time.time() - self.start_time
            print("Time get: ", second)
            for task_index in range(len(self.task_list)):
                if not (self.task_list[task_index][3]) and (second -1 < self.task_list[task_index][0] < second + 1):
                    print("Performing task: ", task_index)
                    self.task_list[task_index][3] = True
                    self.task_list[task_index][1](*self.task_list[task_index][2]) 

even if it is spagetti code, this is enough for me for now.

0reactions
ihsancemilcommented, Mar 8, 2019

Yes mambo starts blinking when I try to send data and I get timeout. Also what did you mean bu “automated timer that tries to reconnect”. Should I call mambo.connect over and over again to escape timeout error?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions | The University of New Orleans
Is MAMBO online or in person? Great question-- it's both! Your MAMBO schedule will include an Online day, an In-person day, a Service...
Read more >
Upcoming Progressive Series - Mambo Room - Norfolk VA
A Progressive Series consists of multiple consecutive dance classes structured to build skills from week to week. To get the best results possible, ......
Read more >
Mambo TV Listings and Schedule | TV Guide
Find out when and where you can watch Mambo with TV Guide's full TV listings schedule.
Read more >
Grand Mambo Cafe Tlalnepantla Tickets - Ticketmaster
Find Grand Mambo Cafe Tlalnepantla venue concert and event schedules, ... Event Schedule (0) ... Do Not Sell or Share My Personal Information....
Read more >
Python scheduler not running a function scheduled in an import
run() has to be called in order to run any scheduled tasks. The scheduler.enter() method on it's own will just schedule events, not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found