Example script problem

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
umanueu
Beginner
Posts: 4
Joined: Thu Sep 25, 2014 8:39 am

Example script problem

Post by umanueu »

Hi all, I'm trying to run the provided example of the crazyflie client. With the XBox 360 Joystick everything works great and the CF flies well (Crazyflie 1.0). Now I want to run the ramp.py example from my linux system, I've installed the dependencies and i run "python2 ramp.py" from terminal (of course inside the example directory). This is the result:

Scanning interfaces for Crazyflies...
Crazyflies found:
radio://0/10/250K
Connecting to radio://0/10/250K

After the last line nothing happens....why???
Thank you
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Re: Example script problem

Post by Slaxx »

I had the same problem:
http://forum.bitcraze.se/viewtopic.php?f=5&t=1370

Before the while loop can start, the startup thrust protection must be unlocked:
#Unlock startup thrust protection
self._cf.commander.send_setpoint(0, 0, 0, 0)

I didn't know how to Put it in the Git ;)
umanueu
Beginner
Posts: 4
Joined: Thu Sep 25, 2014 8:39 am

Re: Example script problem

Post by umanueu »

Hi,

I tried to insert that line of code, but nothing happens.
The situation is the same as before.
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Re: Example script problem

Post by Slaxx »

Ah i just saw you are using the Crazyflie 1.0. Mine worked with the Crazyflie 2.0 so there might be a small difference.
umanueu
Beginner
Posts: 4
Joined: Thu Sep 25, 2014 8:39 am

Re: Example script problem

Post by umanueu »

Yes I am!

Thank you anyway!!
umanueu
Beginner
Posts: 4
Joined: Thu Sep 25, 2014 8:39 am

Re: Example script problem

Post by umanueu »

The problem is that the connection callback is not called!
dgellow
Beginner
Posts: 2
Joined: Wed Aug 12, 2015 9:06 pm

Re: Example script problem

Post by dgellow »

Hello, I have the same problem.
When I run

Code: Select all

python2 ramp.py
from within the examples folder I have this output:

Code: Select all

Scanning interfaces for Crazyflies...
Crazyflies found:
radio://0/10/250K
Connecting to radio://0/10/250K
then it is waiting infinitely.

I am running Archlinux, my version of python is the 2.7.10.

Any idea ?

EDIT: I just tried with my raspberry pi, same problem.
EDIT 2: It works on my raspberry pi if I checkout to the branch 2014.01.0 and rerun a sudo sh setup.sh.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Example script problem

Post by arnaud »

Hi,

Usually that happens when the Crazyflie firmware is old, you can try to update it.

To be able to see what is happening you can set the logging threshold from ERROR to DEBUG, you will find the line at the beginning of ramp.py:

Code: Select all

logging.basicConfig(level=logging.DEBUG)
You will then see a lot of what the lib is doing and hopefully why it is getting stuck.
dgellow
Beginner
Posts: 2
Joined: Wed Aug 12, 2015 9:06 pm

Re: Example script problem

Post by dgellow »

Hello arnaud,

Thank you for your reply, I will take some time this week-end to test what you suggest.
Post Reply