[SOLVED]How to get the crazyflie2.0 autonomous flight and what should i do?

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
NickCong
Beginner
Posts: 29
Joined: Sun Oct 15, 2017 12:24 pm

[SOLVED]How to get the crazyflie2.0 autonomous flight and what should i do?

Post by NickCong »

Hi
Dear Crazyflie workers
i want get my CF2 fly automatically,but i have some questions in my heart and i meet a problem today.
1. because lack of site,so i just place the anchor in my dormitory provisionally,and its space is very small. i set the lps coordinate in the cfclient is

Code: Select all

anchor0: 0.00  0.00  0.00
anchor1: 1.06  0.00  0.00
anchor2: 1.06  1.09  0.00
anchor3: 0.00  1.09  0.00
anchor4: 1.06  0.49  0.78
anchor5: 0.00  0.76  0.55
and write it to the anchor,
i place the CF2 in the middle of these nodes,but when i execute the"python examples/autonomousSequence.py",the message says "Too many packets lost",like this

Code: Select all

(venv) root@nickcong-Inspiron-3537:/home/nickcong/crazyflie-lib-python# python examples/autonomousSequence.py 
Connecting to radio://0/80/2M
Got link error callback [Too many packets lost] in state [1]
Connection to radio://0/80/2M failed: Too many packets lost
Traceback (most recent call last):
  File "examples/autonomousSequence0.py", line 147, in <module>
    with SyncCrazyflie(uri) as scf:
  File "/home/nickcong/crazyflie-lib-python/cflib/crazyflie/syncCrazyflie.py", line 68, in __enter__
    self.open_link()
  File "/home/nickcong/crazyflie-lib-python/cflib/crazyflie/syncCrazyflie.py", line 65, in open_link
    raise Exception(self._error_message)
Exception: Too many packets lost
what is the problem?what should i do?

2.my understanding of the sequence is that in the autonomousSequence.py the sequence in the up is the coordinate which i want the CF2 to fly.
so i just change the sequence of X,Y,Z,and i am not to change the other code.
then do "python examples/autonomousSequence.py" and will the CF2 fly automatically according to my setup in this ?

Code: Select all

# Change the sequence according to your setup
#             x    y    z  YAW
sequence = [
    (0.5, 0.3, 0.4, 0),
    (0.3, 0.5, 0.4, 0),
    (0.5, 1.0, 0.4, 0),
    (0.3, 0.8, 0.6, 0),
    (0.4, 0.4, 0.4, 0),
    ]
do i think have problem?or need i do other things? (i just want my CF2 can fly automatically)

3.in the linux,how can i install the toobelt?i browse the instruction in the README.md,it only say install toolbelt in the windows,but it doesn't guide install the toolbelt in the linux.

Thank you for your time and support!
Last edited by NickCong on Sat Dec 09, 2017 4:43 am, edited 1 time in total.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to get the crazyflie2.0 autonomous flight and what should i do?

Post by arnaud »

Hi,

For 1. are you sure you are using the right channel and datarate? You would get this message if there is a missmatch between the Crazyflie configuration and the link URI in the script. You can see the link URI at which the Crazyflie is configured by connecting to if with the client.

2. This looks correct, you should just have to change the list of waypoint and the Crazyflie will fly the waypoint. I suggest you make sure your system is working well by following the getting started doc first (connecting with the client, checking the position in the LPS tab and flying in position hold mode).

3. What readme are you referring to? On linux it is fairly easy to get the dev environment up and running without using the toolbelt so I would suggest you try without. All the projects should have instruction on how to get started in linux.
Post Reply