Editing Motion Commander
-
- Beginner
- Posts: 9
- Joined: Mon Oct 14, 2019 5:02 am
Editing Motion Commander
Is it possible to edit the motion_commander.py file? While trying to run the test python script, the crazyflie fails to take off properly. I think this is due to the lack of thrust in the takeoff sequence. When I go to edit the MotionCommander class, the changes are not reflected in my flight script because the import of the MotionCommander module is not updated. Is this the right way of handling this problem?
Re: Editing Motion Commander
You are likely using a system install of the lib and not your local lib. To use your local lib you need to install it in edit mode with "pip3 install -e .". The following commands should do it:
Code: Select all
python3 -m pip uninstall cflib
python3 -m pip uninstall cflib # to make sure it was not also installed system-wide
cd crazyflie-lib-python
python3 -m pip install -e .
-
- Beginner
- Posts: 9
- Joined: Mon Oct 14, 2019 5:02 am
Re: Editing Motion Commander
Arnaud,
Thank you for the reply. I ran the commands in the terminal but it responds with "-e option requires 1 argument". Is there something that I have to put after the -e in order to make it run?
Thank you for the reply. I ran the commands in the terminal but it responds with "-e option requires 1 argument". Is there something that I have to put after the -e in order to make it run?
Re: Editing Motion Commander
Yes, a dot for the current folder.
-
- Beginner
- Posts: 9
- Joined: Mon Oct 14, 2019 5:02 am
Re: Editing Motion Commander
Arnaud,
Brilliant, that installed correctly. However, when I run the test python script provided on the wiki the crazyflie still does not generate enough thrust to take off. Seeing as I can run it get it to take off with my phone, I don't believe this is a motor or hardware issue. Do you have any suggestions for this?
Brilliant, that installed correctly. However, when I run the test python script provided on the wiki the crazyflie still does not generate enough thrust to take off. Seeing as I can run it get it to take off with my phone, I don't believe this is a motor or hardware issue. Do you have any suggestions for this?
Re: Editing Motion Commander
This script is designed to be used with some kind of positioning system like with the flow deck. Do you have a flow deck or other positioning mean installed on your Crazyflie?
A good way to debug would be to fly with the client in assist hover mode, this will essencially control the Crazyflie the same way as motion_commander.
A good way to debug would be to fly with the client in assist hover mode, this will essencially control the Crazyflie the same way as motion_commander.
-
- Beginner
- Posts: 9
- Joined: Mon Oct 14, 2019 5:02 am
Re: Editing Motion Commander
Yes I do have the flow deck. Will the changes in the client be reflected when used just with my python scripts? Thank you for working with me.
Re: Editing Motion Commander
Nothing will be saved by the client. However with the client you can control the drone manually an get some understanding of what could be happening. If hover mode works in the client for example, it will rule-out motors problems. One thing I would look at in the client is the actual height measurement in the flight control tab, it should be accurate for the hover mode to work at all.
-
- Beginner
- Posts: 9
- Joined: Mon Oct 14, 2019 5:02 am
Re: Editing Motion Commander
Arnaud,
I think I am beginning to understand the problem. While the flow deck is installed, the crazyflie is not detecting it. I noticed this by looking at the console. Do you know of any ways to solve this?
I think I am beginning to understand the problem. While the flow deck is installed, the crazyflie is not detecting it. I noticed this by looking at the console. Do you know of any ways to solve this?
Re: Editing Motion Commander
There could be multiple things but start by checking that it is mounted in the correct way (direction). If it is mounted correctly it could be a connection problem but as only two pin is needed to identity the deck, GND and (marked OW) that is not as likely.