what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Discussions about all things Bitcraze
NickCong
Beginner
Posts: 29
Joined: Sun Oct 15, 2017 12:24 pm

what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by NickCong »

Hi
Image
i follow the instruction in the crazyflie-lib-python,but i don't understand the word "path" in the "pip install -e path/to/cflib",so i try to input the crazyflie-lib-python as the path ,and it say like this Image
it seems say i has success install the cflib
but when i I'm going to do that python examples/basiclog,it says Image
i guess the problem is the path which i input is wrong before.
,what should i do ? thank you
Last edited by NickCong on Tue Nov 28, 2017 11:53 am, edited 2 times in total.
Jens_Lee
Member
Posts: 40
Joined: Sun Nov 19, 2017 8:14 pm

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by Jens_Lee »

Hi NickCong

If you 'cd' into the examples folder, so your path looks something like this:

Code: Select all

jenslee@jenslee-ThinkPad-T400:~/crazyflie/crazyflie-lib-python/examples$
and the run the example:

Code: Select all

python basiclog.py
What happens then?
NickCong
Beginner
Posts: 29
Joined: Sun Oct 15, 2017 12:24 pm

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by NickCong »

Jens_Lee wrote: Wed Nov 22, 2017 3:40 pm Hi NickCong

If you 'cd' into the examples folder, so your path looks something like this:

Code: Select all

jenslee@jenslee-ThinkPad-T400:~/crazyflie/crazyflie-lib-python/examples$
and the run the example:

Code: Select all

python basiclog.py
What happens then?
Hi,Jens_Lee
i follow your say to do,but it occurs the same problem

Code: Select all

nickcong@nickcong-Inspiron-3537:~$ cd crazyflie-lib-python/examples/
nickcong@nickcong-Inspiron-3537:~/crazyflie-lib-python/examples$ python basiclog.py 
Traceback (most recent call last):
  File "basiclog.py", line 34, in <module>
    import cflib.crtp  # noqa
ImportError: No module named cflib.crtp
Jens_Lee
Member
Posts: 40
Joined: Sun Nov 19, 2017 8:14 pm

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by Jens_Lee »

Try and see if cflib is actually installed

Code: Select all

pip search cflib
or actually:

Code: Select all

pip freeze
NickCong
Beginner
Posts: 29
Joined: Sun Oct 15, 2017 12:24 pm

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by NickCong »

Jens_Lee wrote: Wed Nov 22, 2017 4:39 pm Try and see if cflib is actually installed

Code: Select all

pip search cflib
or actually:

Code: Select all

pip freeze
Hi,Jens_Lee
I seem success,i may be konw what you mean,
first i

Code: Select all

nickcong@nickcong-Inspiron-3537:~/crazyflie-lib-python$ source venv/bin/activate
and then in the venv mode i input

Code: Select all

(venv) nickcong@nickcong-Inspiron-3537:~$ pip install -e crazyflie-lib-python/
it says

Code: Select all

(venv) nickcong@nickcong-Inspiron-3537:~$ pip install -e crazyflie-lib-python/
Obtaining file:///home/nickcong/crazyflie-lib-python
Requirement already satisfied: pyusb>=1.0.0b2 in ./crazyflie-lib-python/venv/lib/python3.5/site-packages (from cflib==0.1.3)
Installing collected packages: cflib
  Running setup.py develop for cflib
Successfully installed cflib
and then i just try it

Code: Select all

(venv) nickcong@nickcong-Inspiron-3537:~/crazyflie-lib-python$ python examples/basiclog.py 
Scanning interfaces for Crazyflies...
Crazyflies found:
No Crazyflies found, cannot run example
Traceback (most recent call last):
  File "examples/basiclog.py", line 143, in <module>
    while le.is_connected:
NameError: name 'le' is not defined
the problem before seems not exist,but a new matter is occur,it says Crazyflies no found,but i have connected the crazyfile2.0 via radio in the cfclient and it can work .
Last edited by NickCong on Wed Nov 22, 2017 5:09 pm, edited 1 time in total.
Jens_Lee
Member
Posts: 40
Joined: Sun Nov 19, 2017 8:14 pm

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by Jens_Lee »

it says Crazyflies no found,but i have connected the crazyfile2.0 via radio in the cfclient and it can work .
It won't work if you are connected through the cfclient at the same time. Try disconnecting there, and then run the script again.
NickCong
Beginner
Posts: 29
Joined: Sun Oct 15, 2017 12:24 pm

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by NickCong »

Jens_Lee wrote: Wed Nov 22, 2017 5:09 pm
it says Crazyflies no found,but i have connected the crazyfile2.0 via radio in the cfclient and it can work .
It won't work if you are connected through the cfclient at the same time. Try disconnecting there, and then run the script again.
Hi
it is also the same,the crazyflie can't be found and say name 'le' is not defined

Code: Select all

Scanning interfaces for Crazyflies...
Crazyflies found:
No Crazyflies found, cannot run example
Traceback (most recent call last):
  File "examples/basiclog.py", line 143, in <module>
    while le.is_connected:
NameError: name 'le' is not defined
how can i connect the crazyflie in the terminal?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by tobias »

how can i connect the crazyflie in the terminal?
That should work. Is the CF2 turned on? And you had no problem when connecting using the cfclient?

This is my output:

Code: Select all

Scanning interfaces for Crazyflies...
Crazyflies found:
radio://0/110/2M
Connecting to radio://0/110/2M
Connected to radio://0/110/2M
[25453][Stabilizer]: {'stabilizer.roll': -5.625945091247559, 'stabilizer.yaw': 2.656627893447876, 'stabilizer.pitch': 1.7939248085021973}
[25463][Stabilizer]: {'stabilizer.roll': -5.567243576049805, 'stabilizer.yaw': 2.634549617767334, 'stabilizer.pitch': 1.777416467666626}
[25473][Stabilizer]: {'stabilizer.roll': -5.510120391845703, 'stabilizer.yaw': 2.723010540008545, 'stabilizer.pitch': 1.854751467704773}
...
NickCong
Beginner
Posts: 29
Joined: Sun Oct 15, 2017 12:24 pm

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by NickCong »

tobias wrote: Thu Nov 23, 2017 8:10 am
how can i connect the crazyflie in the terminal?
That should work. Is the CF2 turned on? And you had no problem when connecting using the cfclient?

This is my output:

Code: Select all

Scanning interfaces for Crazyflies...
Crazyflies found:
radio://0/110/2M
Connecting to radio://0/110/2M
Connected to radio://0/110/2M
[25453][Stabilizer]: {'stabilizer.roll': -5.625945091247559, 'stabilizer.yaw': 2.656627893447876, 'stabilizer.pitch': 1.7939248085021973}
[25463][Stabilizer]: {'stabilizer.roll': -5.567243576049805, 'stabilizer.yaw': 2.634549617767334, 'stabilizer.pitch': 1.777416467666626}
[25473][Stabilizer]: {'stabilizer.roll': -5.510120391845703, 'stabilizer.yaw': 2.723010540008545, 'stabilizer.pitch': 1.854751467704773}
...
Hi,tobis
i am very glad to you see the problem,and very thank you for your answer.
i try again and again,finally i find the problem,but i don't know why.now,it can work in the terminal.
i have no problem when connecting using the cfclient,but it needed sudo or it can't connect, so i guess it may be the same reason that can't connect the CF2 in the terminal ,so when i add sudo,it output like this

Code: Select all

(venv) nickcong@nickcong-Inspiron-3537:~/crazyflie-lib-python$ sudo python examples/basiclog.py 
Traceback (most recent call last):
  File "examples/basiclog.py", line 34, in <module>
    import cflib.crtp  # noqa
ImportError: No module named cflib.crtp
if i don't add sudo ,it output like this

Code: Select all

(venv) nickcong@nickcong-Inspiron-3537:~/crazyflie-lib-python$ python examples/basiclog.py 
Scanning interfaces for Crazyflies...
Crazyflies found:
No Crazyflies found, cannot run example
Traceback (most recent call last):
  File "examples/basiclog.py", line 143, in <module>
    while le.is_connected:
NameError: name 'le' is not defined
in the end,i just try do it in the root mode,thanks god,it success at last
it out put like this

Code: Select all

(venv) root@nickcong-Inspiron-3537:/home/nickcong/crazyflie-lib-python# python examples/basiclog.py
Scanning interfaces for Crazyflies...
Crazyflies found:
usb://0
Connecting to usb://0
Connected to usb://0
[438809][Stabilizer]: {'stabilizer.yaw': -0.31768038868904114, 'stabilizer.pitch': -1.4990111589431763, 'stabilizer.roll': 1.2577241659164429}
[438819][Stabilizer]: {'stabilizer.yaw': -0.3178338408470154, 'stabilizer.pitch'
1.so,later if i want to do like this does it means i always need the root mode?
2.i have bought your loco position system ,because i want get my CF2 automatic flight.i have the question that do i modify directly the sequence coordinate in the "autonomousSequence.py" and then do "python examples/autonomousSequence.py" is ok?
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 = [
    (2.5, 2.5, 1.2, 0),
    (1.5, 2.5, 1.2, 0),
    (2.5, 2.0, 1.2, 0),
    (3.5, 2.5, 1.2, 0),
    (2.5, 3.0, 1.2, 0),
    (2.5, 2.5, 1.2, 0),
    (2.5, 2.5, 0.4, 0),
]
do i think have problem?or need i do other things? (i am a new,it is my first to use the linux and my first time to touch the CF2)

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.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: what is the specific meaning of "path" in the "pip install -e path/to/cflib"

Post by tobias »

Great that you got it to work. I will answer your nr 1 question but the 2,3 should be a new topic in the autonomous flight category. Can you please start the discussion there?
1.so,later if i want to do like this does it means i always need the root mode?
By adding udev rules to linux you don't have to be root as e.g. described here.
Post Reply